diff --git a/devel/moth.py b/devel/moth.py index d228b72..1e834f6 100644 --- a/devel/moth.py +++ b/devel/moth.py @@ -235,9 +235,7 @@ class Puzzle: self.files[name] = PuzzleFile(stream, name, not hidden) elif key == 'script': stream = open(val, 'rb') - # Make sure this shows up in the header block of the HTML output. - self.files[val] = PuzzleFile(stream, val, visible=False) - self.scripts.append(val) + self.add_script_stream(stream, val) elif key == "objective": self.objective = val elif key == "success": @@ -290,6 +288,11 @@ class Puzzle: self.add_stream(stream, name, visible) return stream + def add_script_stream(self, stream, name): + # Make sure this shows up in the header block of the HTML output. + self.files[name] = PuzzleFile(stream, name, visible=False) + self.scripts.append(name) + def add_stream(self, stream, name=None, visible=True): if name is None: name = self.random_hash()