mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-06 04:38:28 +02:00
Ran flake8 and black linters, and other cleanup-related fixes.
Project now passes flake8 and black linter (also including more rst cleanup). Moved latex related things to dedicated ``latex.py`` module, and removed the ``makesheets -dF`` call from travis.
This commit is contained in:
@@ -3,8 +3,9 @@ from collections import namedtuple
|
||||
|
||||
from dungeonsheets.exceptions import DiceError
|
||||
|
||||
dice_re = re.compile('(\d+)d(\d+)', flags=re.I)
|
||||
Dice = namedtuple('Dice', ('num', 'faces'))
|
||||
dice_re = re.compile(r"(\d+)d(\d+)", flags=re.I)
|
||||
Dice = namedtuple("Dice", ("num", "faces"))
|
||||
|
||||
|
||||
def read_dice_str(dice_str):
|
||||
"""Interpret a D&D dice string, eg. 3d10.
|
||||
@@ -19,6 +20,5 @@ def read_dice_str(dice_str):
|
||||
match = dice_re.match(dice_str)
|
||||
if match is None:
|
||||
raise DiceError(f"Cannot interpret dice string {dice_str}")
|
||||
dice = Dice(num=int(match.group(1)),
|
||||
faces=int(match.group(2)))
|
||||
dice = Dice(num=int(match.group(1)), faces=int(match.group(2)))
|
||||
return dice
|
||||
|
||||
Reference in New Issue
Block a user