浏览代码

fix: fix code style after testing

pull/232/head
Roman Hanečák 3 年前
父节点
当前提交
b63e0d29bc
共有 2 个文件被更改,包括 16 次插入30 次删除
  1. +4
    -15
      _kosmorro/main.py
  2. +12
    -15
      _kosmorro/terms.py

+ 4
- 15
_kosmorro/main.py 查看文件

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



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


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



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


def print_term(term): def print_term(term):
print() 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]): def get_args(output_formats: [str]):
today = date.today() today = date.today()
@@ -368,17 +361,13 @@ def get_args(output_formats: [str]):
"--explain", "--explain",
default=None, default=None,
action="store_true", action="store_true",
help=_(
"Explanation of terms shown by current command output."
),
help=_("Explanation of terms shown by current command output."),
) )
parser.add_argument( parser.add_argument(
"--definitions", "--definitions",
default=None, default=None,
action="store_true", 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() return parser.parse_args()

+ 12
- 15
_kosmorro/terms.py 查看文件

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




terms = { 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\".",
}

正在加载...
取消
保存