Browse Source

Merge branch 'master' into features

windows
Jérôme Deuchnord 3 years ago
parent
commit
a29ac0b8d5
5 changed files with 95 additions and 106 deletions
  1. +10
    -0
      CHANGELOG.md
  2. +1
    -1
      _kosmorro/__version__.py
  3. +12
    -7
      _kosmorro/dumper.py
  4. +5
    -8
      _kosmorro/i18n/strings.py
  5. +67
    -90
      _kosmorro/locales/messages.pot

+ 10
- 0
CHANGELOG.md View File

@@ -1,3 +1,13 @@
# [v0.10.5](https://github.com/Kosmorro/kosmorro/compare/v0.10.4...v0.10.5) (2021-11-09)


### Bug Fixes

* fix a display issue on the events list when Kosmorrolib returns events not supported by the CLI ([e82af8f](https://github.com/Kosmorro/kosmorro/commit/e82af8f4b9d3a1511876718ff99d5bcc6dce9067))
* fix KeyError on events processing ([be6bf53](https://github.com/Kosmorro/kosmorro/commit/be6bf530b7c57e9a54da09c86bcca7bfcbadf595))



# [v0.10.4](https://github.com/Kosmorro/kosmorro/compare/v0.10.3...v0.10.4) (2021-11-01)

This version is empty and contains exactly the same things as v0.10.3.


+ 1
- 1
_kosmorro/__version__.py View File

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


+ 12
- 7
_kosmorro/dumper.py View File

@@ -112,14 +112,16 @@ class TextDumper(Dumper):
text.append(self.get_moon(self.moon_phase))

if len(self.events) > 0:
text.append(
"\n".join(
[
self.style(_("Expected events:"), "h2"),
self.get_events(self.events),
]
events = self.get_events(self.events)
if events.strip("\n") != "":
text.append(
"\n".join(
[
self.style(_("Expected events:"), "h2"),
events,
]
)
)
)

if self.timezone == 0:
text.append(self.style(_("Note: All the hours are given in UTC."), "em"))
@@ -212,6 +214,9 @@ class TextDumper(Dumper):

for event in events:
description = strings.from_event(event)
if description is None:
continue

time_fmt = (
TIME_FORMAT
if event.start_time.day == self.date.day


+ 5
- 8
_kosmorro/i18n/strings.py View File

@@ -1,26 +1,23 @@
#!/usr/bin/env python3

from typing import Union
from .utils import _

from kosmorrolib import EventType, MoonPhaseType, ObjectIdentifier, Event


def from_event(event: Event, with_description: bool = True) -> str:
def from_event(event: Event, with_description: bool = True) -> Union[None, str]:
string, details = {
EventType.OPPOSITION: (_("%s is in opposition"), None),
EventType.CONJUNCTION: (_("%s and %s are in conjunction"), 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
),
lambda e: "{:.3n}°".format(e.details["deg"]),
),
EventType.PERIGEE: (_("%s is at its perigee"), None),
EventType.APOGEE: (_("%s is at its apogee"), None),
}.get(event.event_type)
}.get(event.event_type, (None, None))

if string is None:
return None
@@ -28,7 +25,7 @@ def from_event(event: Event, with_description: bool = True) -> str:
string = string % tuple([from_object(o.identifier) for o in event.objects])

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

return string



+ 67
- 90
_kosmorro/locales/messages.pot View File

@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: kosmorro 0.10.2\n"
"Project-Id-Version: kosmorro 0.10.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-08-26 22:07+0200\n"
"POT-Creation-Date: 2021-11-09 19:08+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -27,76 +27,76 @@ msgid ""
"offset format."
msgstr ""

#: _kosmorro/dumper.py:119
#: _kosmorro/dumper.py:120
msgid "Expected events:"
msgstr ""

#: _kosmorro/dumper.py:126
#: _kosmorro/dumper.py:127
msgid "Note: All the hours are given in UTC."
msgstr ""

#: _kosmorro/dumper.py:133
#: _kosmorro/dumper.py:134
msgid "Note: All the hours are given in the UTC{offset} timezone."
msgstr ""

#: _kosmorro/dumper.py:201 _kosmorro/dumper.py:331
#: _kosmorro/dumper.py:202 _kosmorro/dumper.py:335
msgid "Object"
msgstr ""

#: _kosmorro/dumper.py:202 _kosmorro/dumper.py:332
#: _kosmorro/dumper.py:203 _kosmorro/dumper.py:336
msgid "Rise time"
msgstr ""

#: _kosmorro/dumper.py:203 _kosmorro/dumper.py:334
#: _kosmorro/dumper.py:204 _kosmorro/dumper.py:338
msgid "Culmination time"
msgstr ""

#: _kosmorro/dumper.py:204 _kosmorro/dumper.py:336
#: _kosmorro/dumper.py:205 _kosmorro/dumper.py:340
msgid "Set time"
msgstr ""

#: _kosmorro/dumper.py:232
#: _kosmorro/dumper.py:236
msgid "Moon phase is unavailable for this date."
msgstr ""

#: _kosmorro/dumper.py:236 _kosmorro/dumper.py:340
#: _kosmorro/dumper.py:240 _kosmorro/dumper.py:344
msgid "Moon phase:"
msgstr ""

#: _kosmorro/dumper.py:240
#: _kosmorro/dumper.py:244
msgid "{next_moon_phase} on {next_moon_phase_date} at {next_moon_phase_time}"
msgstr ""

#: _kosmorro/dumper.py:304
#: _kosmorro/dumper.py:308
msgid "Overview of your sky"
msgstr ""

#: _kosmorro/dumper.py:312
#: _kosmorro/dumper.py:316
msgid ""
"This document summarizes the ephemerides and the events of {date}. It "
"aims to help you to prepare your observation session. All the hours are "
"given in {timezone}."
msgstr ""

#: _kosmorro/dumper.py:322
#: _kosmorro/dumper.py:326
msgid ""
"Don't forget to check the weather forecast before you go out with your "
"equipment."
msgstr ""

#: _kosmorro/dumper.py:329
#: _kosmorro/dumper.py:333
msgid "Ephemerides of the day"
msgstr ""

#: _kosmorro/dumper.py:338
#: _kosmorro/dumper.py:342
msgid "hours"
msgstr ""

#: _kosmorro/dumper.py:345
#: _kosmorro/dumper.py:349
msgid "Expected events"
msgstr ""

#: _kosmorro/dumper.py:499
#: _kosmorro/dumper.py:503
msgid ""
"Building PDF was not possible, because some dependencies are not "
"installed.\n"
@@ -104,7 +104,7 @@ msgid ""
"pdf/ for more information."
msgstr ""

#: _kosmorro/dumper.py:552
#: _kosmorro/dumper.py:556
#, python-format
msgid ""
"An error occurred during the compilation of the PDF.\n"
@@ -116,223 +116,200 @@ msgstr ""
msgid "The date must be between {minimum_date} and {maximum_date}"
msgstr ""

#: _kosmorro/exceptions.py:47
msgid ""
"Invalid output format: {output_format}. Output file must end with: "
"{accepted_extensions}"
msgstr ""

#: _kosmorro/geolocation.py:14
#, python-format
msgid "The given position (%s) is not valid."
msgstr ""

#: _kosmorro/geolocation.py:29
msgid "The given Plus Code seems to be a short code, please provide a full code."
msgstr ""

#: _kosmorro/main.py:73
#: _kosmorro/main.py:62
msgid ""
"Save the planet and paper!\n"
"Consider printing your PDF document only if really necessary, and use the"
" other side of the sheet."
msgstr ""

#: _kosmorro/main.py:82
#: _kosmorro/main.py:71
msgid ""
"PDF output will not contain the ephemerides, because you didn't provide "
"the observation coordinates."
msgstr ""

#: _kosmorro/main.py:132
#: _kosmorro/main.py:116
msgid "The file could not be saved in \"{path}\": {error}"
msgstr ""

#: _kosmorro/main.py:146
#: _kosmorro/main.py:130
msgid "Please provide a file path to export in this format (--output)."
msgstr ""

#: _kosmorro/main.py:179
#: _kosmorro/main.py:163
msgid "Moon phase can only be displayed between {min_date} and {max_date}"
msgstr ""

#: _kosmorro/main.py:228
#: _kosmorro/main.py:202
msgid "Running on Python {python_version} with Kosmorrolib v{kosmorrolib_version}"
msgstr ""

#: _kosmorro/main.py:238
msgid "Do you really want to clear Kosmorro's cache? [yN] "
msgstr ""

#: _kosmorro/main.py:246
msgid "Incorrect answer, cache not cleared."
msgstr ""

#: _kosmorro/main.py:256
#: _kosmorro/main.py:215
msgid ""
"Compute the ephemerides and the events for a given date and a given "
"position on Earth."
msgstr ""

#: _kosmorro/main.py:259
#: _kosmorro/main.py:218
msgid ""
"By default, only the events will be computed for today ({date}).\n"
"To compute also the ephemerides, latitude and longitude arguments are "
"needed."
msgstr ""

#: _kosmorro/main.py:273
#: _kosmorro/main.py:232
msgid "Show the program version"
msgstr ""

#: _kosmorro/main.py:281
msgid "Delete all the files from Kosmorro's cache."
#: _kosmorro/main.py:240
msgid "The format to output the information to"
msgstr ""

#: _kosmorro/main.py:289
#: _kosmorro/main.py:247
msgid ""
"The format to output the information to. If not provided, the output "
"format will be inferred from the file extension of the output file."
"The observer's latitude on Earth. Can also be set in the "
"KOSMORRO_LATITUDE environment variable."
msgstr ""

#: _kosmorro/main.py:299
#: _kosmorro/main.py:257
msgid ""
"The observer's position on Earth, in the \"{latitude},{longitude}\" "
"format.Can also be set in the KOSMORRO_POSITION environment variable."
"The observer's longitude on Earth. Can also be set in the "
"KOSMORRO_LONGITUDE environment variable."
msgstr ""

#: _kosmorro/main.py:309
#: _kosmorro/main.py:267
msgid ""
"The date for which the ephemerides must be calculated. Can be in the "
"YYYY-MM-DD format or an interval in the \"[+-]YyMmDd\" format (with Y, M,"
" and D numbers). Defaults to today ({default_date})."
msgstr ""

#: _kosmorro/main.py:320
#: _kosmorro/main.py:278
msgid ""
"The timezone to display the hours in (e.g. 2 for UTC+2 or -3 for UTC-3). "
"Can also be set in the KOSMORRO_TIMEZONE environment variable."
msgstr ""

#: _kosmorro/main.py:329
#: _kosmorro/main.py:287
msgid "Disable the colors in the console."
msgstr ""

#: _kosmorro/main.py:336
#: _kosmorro/main.py:294
msgid ""
"A file to export the output to. If not given, the standard output is "
"used. This argument is needed for PDF format."
msgstr ""

#: _kosmorro/main.py:345
#: _kosmorro/main.py:303
msgid ""
"Do not generate a graph to represent the rise and set times in the PDF "
"format."
msgstr ""

#: _kosmorro/main.py:353
#: _kosmorro/main.py:311
msgid "Show debugging messages"
msgstr ""

#: _kosmorro/i18n/strings.py:10
#: _kosmorro/i18n/strings.py:11
#, python-format
msgid "%s is in opposition"
msgstr ""

#: _kosmorro/i18n/strings.py:11
#: _kosmorro/i18n/strings.py:12
#, python-format
msgid "%s and %s are in conjunction"
msgstr ""

#: _kosmorro/i18n/strings.py:12
#: _kosmorro/i18n/strings.py:13
#, python-format
msgid "%s occults %s"
msgstr ""

#: _kosmorro/i18n/strings.py:14
#: _kosmorro/i18n/strings.py:15
#, python-format
msgid "Elongation of %s is maximal"
msgstr ""

#: _kosmorro/i18n/strings.py:21
#: _kosmorro/i18n/strings.py:18
#, python-format
msgid "%s is at its perigee"
msgstr ""

#: _kosmorro/i18n/strings.py:22
#: _kosmorro/i18n/strings.py:19
#, python-format
msgid "%s is at its apogee"
msgstr ""

#: _kosmorro/i18n/strings.py:38
#: _kosmorro/i18n/strings.py:35
msgid "New Moon"
msgstr ""

#: _kosmorro/i18n/strings.py:39
#: _kosmorro/i18n/strings.py:36
msgid "Waxing Crescent"
msgstr ""

#: _kosmorro/i18n/strings.py:40
#: _kosmorro/i18n/strings.py:37
msgid "First Quarter"
msgstr ""

#: _kosmorro/i18n/strings.py:41
#: _kosmorro/i18n/strings.py:38
msgid "Waxing Gibbous"
msgstr ""

#: _kosmorro/i18n/strings.py:42
#: _kosmorro/i18n/strings.py:39
msgid "Full Moon"
msgstr ""

#: _kosmorro/i18n/strings.py:43
#: _kosmorro/i18n/strings.py:40
msgid "Waning Gibbous"
msgstr ""

#: _kosmorro/i18n/strings.py:44
#: _kosmorro/i18n/strings.py:41
msgid "Last Quarter"
msgstr ""

#: _kosmorro/i18n/strings.py:45
#: _kosmorro/i18n/strings.py:42
msgid "Waning Crescent"
msgstr ""

#: _kosmorro/i18n/strings.py:56
#: _kosmorro/i18n/strings.py:53
msgid "Sun"
msgstr ""

#: _kosmorro/i18n/strings.py:57
#: _kosmorro/i18n/strings.py:54
msgid "Moon"
msgstr ""

#: _kosmorro/i18n/strings.py:58
#: _kosmorro/i18n/strings.py:55
msgid "Mercury"
msgstr ""

#: _kosmorro/i18n/strings.py:59
#: _kosmorro/i18n/strings.py:56
msgid "Venus"
msgstr ""

#: _kosmorro/i18n/strings.py:60
#: _kosmorro/i18n/strings.py:57
msgid "Mars"
msgstr ""

#: _kosmorro/i18n/strings.py:61
#: _kosmorro/i18n/strings.py:58
msgid "Jupiter"
msgstr ""

#: _kosmorro/i18n/strings.py:62
#: _kosmorro/i18n/strings.py:59
msgid "Saturn"
msgstr ""

#: _kosmorro/i18n/strings.py:63
#: _kosmorro/i18n/strings.py:60
msgid "Uranus"
msgstr ""

#: _kosmorro/i18n/strings.py:64
#: _kosmorro/i18n/strings.py:61
msgid "Neptune"
msgstr ""

#: _kosmorro/i18n/strings.py:65
#: _kosmorro/i18n/strings.py:62
msgid "Pluto"
msgstr ""



Loading…
Cancel
Save