diff --git a/kosmorro/__main__.py b/kosmorro/__main__.py index 197e315..63a03c9 100644 --- a/kosmorro/__main__.py +++ b/kosmorro/__main__.py @@ -68,10 +68,13 @@ def run(): return -1 position = None - if args.position not in [None, ""]: - position = get_position(args.position) - elif env_vars.position not in [None, ""]: - position = get_position(env_vars.position) + try: + if args.position not in [None, ""]: + position = get_position(args.position) + elif env_vars.position not in [None, ""]: + position = get_position(env_vars.position) + except ValueError as e: + print_stderr(colored(e.args[0], color="red", attrs=["bold"])) # if output format is not specified, try to use output file extension as output format if args.output is not None and output_format is None: diff --git a/kosmorro/locales/messages.pot b/kosmorro/locales/messages.pot index e2d2373..ca1e3e7 100644 --- a/kosmorro/locales/messages.pot +++ b/kosmorro/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2025-11-09 11:42+0100\n" +"POT-Creation-Date: 2025-11-11 11:06+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,86 +17,86 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.17.0\n" -#: kosmorro/__main__.py:89 +#: kosmorro/__main__.py:92 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:97 +#: kosmorro/__main__.py:100 msgid "" "PDF output will not contain the ephemerides, because you didn't provide " "the observation coordinates." msgstr "" -#: kosmorro/__main__.py:115 +#: kosmorro/__main__.py:118 msgid "" "Environment variable KOSMORRO_TIMEZONE is deprecated. Use TZ instead, " "which is more standard." msgstr "" -#: kosmorro/__main__.py:124 +#: kosmorro/__main__.py:127 #, python-brace-format msgid "Unknown timezone: {timezone}" msgstr "" -#: kosmorro/__main__.py:167 +#: kosmorro/__main__.py:170 #, python-brace-format msgid "The file could not be saved in \"{path}\": {error}" msgstr "" -#: kosmorro/__main__.py:181 +#: kosmorro/__main__.py:184 msgid "Please provide a file path to export in this format (--output)." msgstr "" -#: kosmorro/__main__.py:213 +#: kosmorro/__main__.py:216 #, python-brace-format msgid "Moon phase can only be computed between {min_date} and {max_date}" msgstr "" -#: kosmorro/__main__.py:264 +#: kosmorro/__main__.py:267 #, python-brace-format msgid "Running on Python {python_version} with Kosmorrolib v{kosmorrolib_version}" msgstr "" -#: kosmorro/__main__.py:277 +#: kosmorro/__main__.py:280 msgid "" "Compute the ephemerides and the events for a given date and a given " "position on Earth." msgstr "" -#: kosmorro/__main__.py:280 +#: kosmorro/__main__.py:283 msgid "" "By default, only the events will be computed for today.\n" "To compute also the ephemerides, latitude and longitude arguments are " "needed." msgstr "" -#: kosmorro/__main__.py:292 +#: kosmorro/__main__.py:295 msgid "Show the program version" msgstr "" -#: kosmorro/__main__.py:301 +#: kosmorro/__main__.py:304 msgid "" "The output format. If not provided, it will be inferred from the file " "extension of the output file." msgstr "" -#: kosmorro/__main__.py:310 +#: kosmorro/__main__.py:313 msgid "" "The observer's position on Earth, in the \"latitude,longitude\" format. " "Can also be set in the KOSMORRO_POSITION environment variable." msgstr "" -#: kosmorro/__main__.py:320 +#: kosmorro/__main__.py:323 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 current date." msgstr "" -#: kosmorro/__main__.py:331 +#: kosmorro/__main__.py:334 msgid "" "The timezone to use to display the hours. It can be either a number (e.g." " 1 for UTC+1) or a timezone name (e.g. Europe/Paris). See " @@ -104,29 +104,29 @@ msgid "" " timezone. Can also be set in the TZ environment variable." msgstr "" -#: kosmorro/__main__.py:340 +#: kosmorro/__main__.py:343 msgid "Disable the colors in the console." msgstr "" -#: kosmorro/__main__.py:347 +#: kosmorro/__main__.py:350 msgid "Use this option to save the result in a file." msgstr "" -#: kosmorro/__main__.py:354 +#: kosmorro/__main__.py:357 msgid "" "Do not generate a graph to represent the rise and set times in the LaTeX " "or PDF file." msgstr "" -#: kosmorro/__main__.py:361 +#: kosmorro/__main__.py:364 msgid "Show debugging messages" msgstr "" -#: kosmorro/__main__.py:369 +#: kosmorro/__main__.py:372 msgid "Print a script allowing completion for your shell" msgstr "" -#: kosmorro/__main__.py:379 +#: kosmorro/__main__.py:382 msgid "No completion script available for this shell." msgstr ""