mirror of https://github.com/dirtbags/moth.git
flake8
This commit is contained in:
parent
19e0b7684a
commit
0ac8d8e9ac
|
@ -15,6 +15,7 @@ except ImportError:
|
||||||
NOT_FOUND = 404
|
NOT_FOUND = 404
|
||||||
OK = 200
|
OK = 200
|
||||||
|
|
||||||
|
|
||||||
def page(title, body):
|
def page(title, body):
|
||||||
return """<!DOCTYPE html>
|
return """<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
@ -120,7 +121,7 @@ you are a fool.
|
||||||
self.serve_md()
|
self.serve_md()
|
||||||
else:
|
else:
|
||||||
super().do_GET()
|
super().do_GET()
|
||||||
|
|
||||||
def serve_md(self, text=None):
|
def serve_md(self, text=None):
|
||||||
fspathstr = self.translate_path(self.path)
|
fspathstr = self.translate_path(self.path)
|
||||||
fspath = pathlib.Path(fspathstr)
|
fspath = pathlib.Path(fspathstr)
|
||||||
|
|
|
@ -335,7 +335,7 @@ class BlockLexer(object):
|
||||||
|
|
||||||
rest = len(item)
|
rest = len(item)
|
||||||
if i != length - 1 and rest:
|
if i != length - 1 and rest:
|
||||||
_next = item[rest-1] == '\n'
|
_next = item[rest - 1] == '\n'
|
||||||
if not loose:
|
if not loose:
|
||||||
loose = _next
|
loose = _next
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ def djb2hash(buf):
|
||||||
# to be done with Puzzle's random number generator, and it's cleaner to not pass that around.
|
# to be done with Puzzle's random number generator, and it's cleaner to not pass that around.
|
||||||
PuzzleFile = namedtuple('PuzzleFile', ['path', 'handle', 'name', 'visible'])
|
PuzzleFile = namedtuple('PuzzleFile', ['path', 'handle', 'name', 'visible'])
|
||||||
|
|
||||||
|
|
||||||
class Puzzle:
|
class Puzzle:
|
||||||
|
|
||||||
KNOWN_KEYS = [
|
KNOWN_KEYS = [
|
||||||
|
@ -197,7 +198,6 @@ class Puzzle:
|
||||||
|
|
||||||
return answer
|
return answer
|
||||||
|
|
||||||
|
|
||||||
def htmlify(self):
|
def htmlify(self):
|
||||||
return mistune.markdown(self.body)
|
return mistune.markdown(self.body)
|
||||||
|
|
||||||
|
@ -227,8 +227,8 @@ class Puzzle:
|
||||||
'summary': self['summary'],
|
'summary': self['summary'],
|
||||||
}
|
}
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Build a puzzle category')
|
parser = argparse.ArgumentParser(description='Build a puzzle category')
|
||||||
parser.add_argument('puzzledir', nargs='+', help='Directory of puzzle source')
|
parser.add_argument('puzzledir', nargs='+', help='Directory of puzzle source')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
@ -246,4 +246,3 @@ if __name__ == '__main__':
|
||||||
for points in sorted(puzzles):
|
for points in sorted(puzzles):
|
||||||
puzzle = puzzles[points]
|
puzzle = puzzles[points]
|
||||||
print(puzzle.secrets())
|
print(puzzle.secrets())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue