Browse Source

chore: fix code style

pull/193/head
Jérôme Deuchnord 2 years ago
parent
commit
4f41b64058
No known key found for this signature in database GPG Key ID: 9F72B1EF93EDE1D4
4 changed files with 11 additions and 6 deletions
  1. +1
    -1
      _kosmorro/__version__.py
  2. +0
    -1
      _kosmorro/debug.py
  3. +1
    -2
      _kosmorro/dumper.py
  4. +9
    -2
      _kosmorro/i18n/strings.py

+ 1
- 1
_kosmorro/__version__.py View File

@@ -19,7 +19,7 @@
__title__ = "kosmorro" __title__ = "kosmorro"
__description__ = "A program that computes your ephemerides" __description__ = "A program that computes your ephemerides"
__url__ = "https://kosmorro.space" __url__ = "https://kosmorro.space"
__version__ = '0.10.1'
__version__ = "0.10.1"
__author__ = "Jérôme Deuchnord" __author__ = "Jérôme Deuchnord"
__author_email__ = "jerome@deuchnord.fr" __author_email__ = "jerome@deuchnord.fr"
__license__ = "AGPL" __license__ = "AGPL"


+ 0
- 1
_kosmorro/debug.py View File

@@ -13,4 +13,3 @@ def debug_print(what, force: bool = False):
print_exception(type(what), value=what, tb=None) print_exception(type(what), value=what, tb=None)
else: else:
print("[DEBUG] %s" % what) print("[DEBUG] %s" % what)


+ 1
- 2
_kosmorro/dumper.py View File

@@ -447,8 +447,7 @@ class _LatexDumper(Dumper):
continue continue


latex.append( latex.append(
r"\event{%s}{%s}"
% (event.start_time.strftime(TIME_FORMAT), event_name)
r"\event{%s}{%s}" % (event.start_time.strftime(TIME_FORMAT), event_name)
) )


return "".join(latex) return "".join(latex)


+ 9
- 2
_kosmorro/i18n/strings.py View File

@@ -10,7 +10,14 @@ def from_event(event: Event, with_description: bool = True) -> str:
EventType.OPPOSITION: (_("%s is in opposition"), None), EventType.OPPOSITION: (_("%s is in opposition"), None),
EventType.CONJUNCTION: (_("%s and %s are in conjunction"), None), EventType.CONJUNCTION: (_("%s and %s are in conjunction"), None),
EventType.OCCULTATION: (_("%s occults %s"), None), EventType.OCCULTATION: (_("%s occults %s"), None),
EventType.MAXIMAL_ELONGATION: (_("Elongation of %s is maximal"), ('{:.3n}°'.format(event.details['deg']) if type(event.details) is dict else event.details)),
EventType.MAXIMAL_ELONGATION: (
_("Elongation of %s is maximal"),
(
"{:.3n}°".format(event.details["deg"])
if type(event.details) is dict
else event.details
),
),
EventType.MOON_PERIGEE: (_("%s is at its perigee"), None), EventType.MOON_PERIGEE: (_("%s is at its perigee"), None),
EventType.MOON_APOGEE: (_("%s is at its apogee"), None), EventType.MOON_APOGEE: (_("%s is at its apogee"), None),
}.get(event.event_type) }.get(event.event_type)
@@ -21,7 +28,7 @@ def from_event(event: Event, with_description: bool = True) -> str:
string = string % tuple([from_object(o.identifier) for o in event.objects]) string = string % tuple([from_object(o.identifier) for o in event.objects])


if details is not None and with_description: if details is not None and with_description:
return '%s (%s)' % (string, details)
return "%s (%s)" % (string, details)


return string return string




Loading…
Cancel
Save