Parcourir la source

fix: fix code style after testing

pull/232/head
Roman Hanečák il y a 2 ans
Parent
révision
b63e0d29bc
2 fichiers modifiés avec 16 ajouts et 30 suppressions
  1. +4
    -15
      _kosmorro/main.py
  2. +12
    -15
      _kosmorro/terms.py

+ 4
- 15
_kosmorro/main.py Voir le fichier

@@ -51,13 +51,11 @@ def main():
if args.special_action is not None:
return 0 if args.special_action() else 1


if args.definitions is not None:
for term in term_dictionary:
print_term(term)
return 0

try:
compute_date = parse_date(args.date)
except ValueError as error:
@@ -130,8 +128,6 @@ def main():
debug.debug_print(error)
return 1


if args.output is not None:
try:
file_content = output.to_string()
@@ -263,11 +259,8 @@ def output_version() -> bool:

def print_term(term):
print()
print(colored(_('{key_term}\n').format(
key_term = term
),attrs=['bold']))
print(_('{explanation}\n').format(
explanation = term_dictionary[term]))
print(colored(_('{key_term}\n').format(key_term = term),attrs=['bold']))
print(_('{explanation}\n').format(explanation = term_dictionary[term]))

def get_args(output_formats: [str]):
today = date.today()
@@ -368,17 +361,13 @@ def get_args(output_formats: [str]):
"--explain",
default=None,
action="store_true",
help=_(
"Explanation of terms shown by current command output."
),
help=_("Explanation of terms shown by current command output."),
)
parser.add_argument(
"--definitions",
default=None,
action="store_true",
help=_(
"List of kosmorro terms. Program wont provide any calculations!"
),
help=_("List of kosmorro terms. Program wont provide any calculations!"),
)

return parser.parse_args()

+ 12
- 15
_kosmorro/terms.py Voir le fichier

@@ -18,18 +18,15 @@


terms = {
"Apogee" : "The Moon is told being at its apogee when it is at its furthest point from the Earth.",
"Conjunction" : "From the point of view of the Earth, two asters are said in conjunction when they are close together.\nIt is, of course, an illusion caused by the position of the Earth combined with the two other objects' ones.",
"Elongation" : "The elongation is the angle of visual separation between a planet and the Sun, as seen from the point of view of the Earth. \nFor the inferior planets, the time when the elongation is maximal is propice to their observation, because it is the moment when they are the most visible.",
"Occultation" : "An occultation is a special kind of conjunction where the closer aster to the Earth hides, at least partially, another one.",
"Opposition" : "An aster is said in opposition when it is positionned at the exact opposite of the Sun, from the point of view of the Earth,\ni.e. when their angle is equal to 180 degrees.\nFor all the superior planets, it is the best moment to observe them, because they will be at the smallest distance to the Earth.\nPlus, they will appear full. For instance, Mars is in opposition when the angle Mars-Earth-Sun is equal to 180 degrees.",
"Perigee" : "The Moon is told being at its apogee when it is at its nearest point from the Earth.",
"Planet" : "A planet is an aster that orbits around a star, is not a star itself, is massive enough to maintain it nearly round,\nand has cleaned its orbit from other massive objects.",
"Inferior planet" : "A planet is said \"inferior\" if its orbit radius is smaller than the planet of reference.\nFor instance, the inferior planets from the point of view of the Earth are Mercury and Venus.\nThe term should not be confused with \"inner planet\".",
"Inner planet" : "The \"inner planet\" term refers to the planets orbiting below the orbit of the asteroid belt between Mars and Jupiter.",
"Outer planet" : "The \"outer planet\" term refers to the planets orbiting beyond the orbit of the asteroid belt between Mars and Jupiter.",
"Superior planet" : "A planet is said \"superior\" if its orbit radius is higher than the planet of reference.\nFor instance, the superior planets from the point of view of the Earth are Mars, Jupiter, Saturn, Uranus and Neptune.\nThe term should not be confused with \"outer planet\"."
}



"Apogee": "The Moon is told being at its apogee when it is at its furthest point from the Earth.",
"Conjunction": "From the point of view of the Earth, two asters are said in conjunction when they are close together.\nIt is, of course, an illusion caused by the position of the Earth combined with the two other objects' ones.",
"Elongation": "The elongation is the angle of visual separation between a planet and the Sun, as seen from the point of view of the Earth. \nFor the inferior planets, the time when the elongation is maximal is propice to their observation, because it is the moment when they are the most visible.",
"Occultation": "An occultation is a special kind of conjunction where the closer aster to the Earth hides, at least partially, another one.",
"Opposition": "An aster is said in opposition when it is positionned at the exact opposite of the Sun, from the point of view of the Earth,\ni.e. when their angle is equal to 180 degrees.\nFor all the superior planets, it is the best moment to observe them, because they will be at the smallest distance to the Earth.\nPlus, they will appear full. For instance, Mars is in opposition when the angle Mars-Earth-Sun is equal to 180 degrees.",
"Perigee": "The Moon is told being at its apogee when it is at its nearest point from the Earth.",
"Planet": "A planet is an aster that orbits around a star, is not a star itself, is massive enough to maintain it nearly round,\nand has cleaned its orbit from other massive objects.",
"Inferior planet": "A planet is said \"inferior\" if its orbit radius is smaller than the planet of reference.\nFor instance, the inferior planets from the point of view of the Earth are Mercury and Venus.\nThe term should not be confused with \"inner planet\".",
"Inner planet": "The \"inner planet\" term refers to the planets orbiting below the orbit of the asteroid belt between Mars and Jupiter.",
"Outer planet": "The \"outer planet\" term refers to the planets orbiting beyond the orbit of the asteroid belt between Mars and Jupiter.",
"Superior planet": "A planet is said \"superior\" if its orbit radius is higher than the planet of reference.\nFor instance, the superior planets from the point of view of the Earth are Mars, Jupiter, Saturn, Uranus and Neptune.\nThe term should not be confused with \"outer planet\".",
}

Chargement…
Annuler
Enregistrer