mirror of https://github.com/dirtbags/moth.git
Merge branch 'v3.5_devel' of https://github.com/dirtbags/moth into fix_authors_check
This commit is contained in:
commit
b2bf947031
|
@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
team by its team id (e.g., points.json?id=abc123).
|
team by its team id (e.g., points.json?id=abc123).
|
||||||
### Fixed
|
### Fixed
|
||||||
- Handle cases where non-legacy puzzles don't have an `author` attribute
|
- Handle cases where non-legacy puzzles don't have an `author` attribute
|
||||||
|
- Handle YAML-formatted file and script lists as expected
|
||||||
|
- YAML-formatted example puzzle actually works as expected
|
||||||
|
|
||||||
## [3.4.3] - 2019-11-20
|
## [3.4.3] - 2019-11-20
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -233,11 +233,39 @@ class Puzzle:
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
self.files[name] = PuzzleFile(stream, name, not hidden)
|
self.files[name] = PuzzleFile(stream, name, not hidden)
|
||||||
|
|
||||||
|
elif key == 'files' and isinstance(val, dict):
|
||||||
|
for filename, options in val.items():
|
||||||
|
if "source" in options:
|
||||||
|
source = options["source"]
|
||||||
|
else:
|
||||||
|
source = filename
|
||||||
|
|
||||||
|
if "hidden" in options and options["hidden"]:
|
||||||
|
hidden = True
|
||||||
|
else:
|
||||||
|
hidden = False
|
||||||
|
|
||||||
|
stream = open(source, "rb")
|
||||||
|
self.files[filename] = PuzzleFile(stream, filename, not hidden)
|
||||||
|
|
||||||
|
elif key == 'files' and isinstance(val, list):
|
||||||
|
for filename in val:
|
||||||
|
stream = open(filename, "rb")
|
||||||
|
self.files[filename] = PuzzleFile(stream, filename)
|
||||||
|
|
||||||
elif key == 'script':
|
elif key == 'script':
|
||||||
stream = open(val, 'rb')
|
stream = open(val, 'rb')
|
||||||
# Make sure this shows up in the header block of the HTML output.
|
# Make sure this shows up in the header block of the HTML output.
|
||||||
self.files[val] = PuzzleFile(stream, val, visible=False)
|
self.files[val] = PuzzleFile(stream, val, visible=False)
|
||||||
self.scripts.append(val)
|
self.scripts.append(val)
|
||||||
|
|
||||||
|
elif key == "scripts" and isinstance(val, list):
|
||||||
|
for script in val:
|
||||||
|
stream = open(script, "rb")
|
||||||
|
self.files[script] = PuzzleFile(stream, script, visible=False)
|
||||||
|
self.scripts.append(script)
|
||||||
|
|
||||||
elif key == "objective":
|
elif key == "objective":
|
||||||
self.objective = val
|
self.objective = val
|
||||||
elif key == "success":
|
elif key == "success":
|
||||||
|
|
Loading…
Reference in New Issue