Quellcode durchsuchen

Update EventType enum, update class of details

pull/24/head
Tung Lam Nguyen Le vor 3 Jahren
committed by Jérôme Deuchnord
Ursprung
Commit
a182e9e7c8
3 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
  1. +1
    -0
      kosmorrolib/enum.py
  2. +4
    -3
      kosmorrolib/events.py
  3. +1
    -1
      kosmorrolib/model.py

+ 1
- 0
kosmorrolib/enum.py Datei anzeigen

@@ -30,6 +30,7 @@ class EventType(Enum):
MAXIMAL_ELONGATION = 4
MOON_PERIGEE = 5
MOON_APOGEE = 6
SEASON_CHANGE = 7


class ObjectType(Enum):


+ 4
- 3
kosmorrolib/events.py Datei anzeigen

@@ -185,7 +185,7 @@ def _search_maximal_elongations(
EventType.MAXIMAL_ELONGATION,
[aster],
translate_to_timezone(time.utc_datetime(), timezone),
details="{:.3n}°".format(elongation),
details={ 'deg': elongation},
)
)

@@ -272,9 +272,10 @@ def _search_earth_season_change(start_time: Time, end_time: Time, timezone: int)
return []
else:
events.append(Event(
SeasonType(y[0]),
EventType.SEASON_CHANGE,
[],
translate_to_timezone(t.utc_datetime()[0], timezone)))
translate_to_timezone(t.utc_datetime()[0], timezone)),
details={'season':SeasonType(y[0])} )
return events




+ 1
- 1
kosmorrolib/model.py Datei anzeigen

@@ -154,7 +154,7 @@ class Event(Serializable):
objects: [Object],
start_time: datetime,
end_time: Union[datetime, None] = None,
details: str = None,
details: dict=None,
):
self.event_type = event_type
self.objects = objects


Laden…
Abbrechen
Speichern