Run black on py

This commit is contained in:
2022-04-19 14:25:29 +02:00
parent 13cc531c5d
commit b925af1e7a
13 changed files with 95 additions and 86 deletions

View File

@@ -1,4 +1,4 @@
from ram.utils import git_suffix
__version__ = '0.0.1'
__version__ = "0.0.1"
__version__ += git_suffix(__file__)

View File

@@ -152,10 +152,7 @@ DECODER_INTERFACES = [
(5, "Next18/Next18S"),
]
MANUFACTURER_TYPES = [
("model", "Model"),
("real", "Real")
]
MANUFACTURER_TYPES = [("model", "Model"), ("real", "Real")]
ROLLING_STOCK_TYPES = [
("engine", "Engine"),

View File

@@ -11,13 +11,14 @@ def git_suffix(fname):
"""
try:
gh = subprocess.check_output(
['git', 'rev-parse', '--short', 'HEAD'],
stderr=open(os.devnull, 'w')).strip()
gh = "-git" + gh.decode() if gh else ''
["git", "rev-parse", "--short", "HEAD"],
stderr=open(os.devnull, "w"),
).strip()
gh = "-git" + gh.decode() if gh else ""
except Exception:
# trapping everything on purpose; git may not be installed or it
# may not work properly
gh = ''
gh = ""
return gh