Feat: Add biweekly and bimonthly and fix translations (#36)

This commit is contained in:
Stan Triepels
2022-11-13 01:00:11 +01:00
committed by GitHub
parent 17205549eb
commit 542e04db54
15 changed files with 906 additions and 612 deletions
+8 -11
View File
@@ -257,8 +257,8 @@ def info(broker=None):
term.black_on_green(
term.center(
_(
f'-- {Conf.PREFIX.capitalize()} { ".".join(str(v) for v in VERSION)} on {broker.info()} --'
)
'-- %(prefix)s %(version)s on %(info)s --'
) % {'prefix': Conf.PREFIX.capitalize(), 'version': ".".join(str(v) for v in VERSION), 'info': broker.info()}
)
)
)
@@ -293,7 +293,7 @@ def info(broker=None):
+ term.move_x(1 * col_width)
+ term.white(str(models.Schedule.objects.count()))
+ term.move_x(2 * col_width)
+ term.cyan(_(f"Tasks/{per}"))
+ term.cyan(_("Tasks/%(per)s") % {'per': per})
+ term.move_x(3 * col_width)
+ term.white(f"{tasks_per:.2f}")
+ term.move_x(4 * col_width)
@@ -475,17 +475,14 @@ def memory(run_once=False, workers=False, broker=None):
row += 1
print(
term.move(row, 0)
+ _("Available lowest (%): {} ({})").format(
str(MEMORY_AVAILABLE_LOWEST_PERCENTAGE),
MEMORY_AVAILABLE_LOWEST_PERCENTAGE_AT.strftime(
"%Y-%m-%d %H:%M:%S+00:00"
),
)
+ _("Available lowest (): %(memory_percent)s ((at)s)") % { 'memory_percent': str(MEMORY_AVAILABLE_LOWEST_PERCENTAGE), 'at': MEMORY_AVAILABLE_LOWEST_PERCENTAGE_AT.strftime(
"%Y-%m-%d %H:%M:%S+00:00"
)}
)
# for testing
if run_once:
return Stat.get_all(broker=broker)
print(term.move(row + 2, 0) + term.center("[Press q to quit]"))
print(term.move(row + 2, 0) + term.center(_("[Press q to quit]")))
val = term.inkey(timeout=1)
@@ -496,5 +493,5 @@ def get_ids():
for s in stat:
print(s.cluster_id)
else:
print("No clusters appear to be running.")
print(_("No clusters appear to be running."))
return True