ccc editing is done

This commit is contained in:
Alibek Omarov 2023-10-01 18:29:58 +03:00
parent 41407e7387
commit 8dd590c781

34
main.py
View File

@ -63,20 +63,28 @@ def dump_and_compare_data(new):
os.rename('last.json.new', 'last.json')
def compose_text(data):
text = 'Today\'s CCC Editing Progress: \n'
# text = 'Today\'s CCC Editing Progress: \n'
text = 'CCC editing is finished! 🎉'
days_until_ccc = (date(2023, 12, 25) - date.today()).days
if days_until_ccc > 0:
text += '\n\n%d days until Fate/Extra CCC translation release' % days_until_ccc
elif days_until_ccc == 0:
text += '\n\nFate/Extra CCC is going to be released TODAY! 🎉'
elif days_until_ccc > -14:
text += '\n\nFate/Extra CCC was released few days ago, did you played it yet?'
for k in data:
d = data[k]
mark = ''
if d['update']:
if d['edited'] == d['all']:
mark = '🎉' # my font can't render this emoji lul
else:
mark = '⚠️'
percent = d['edited'] / float(d['all']) * 100.0
text += '%s: %.2f%% (%d/%d) %s\n' % (k, percent, d['edited'], d['all'], mark)
# for k in data:
# d = data[k]
# mark = ''
# if d['update']:
# if d['edited'] == d['all']:
# mark = '🎉' # my font can't render this emoji lul
# else:
# mark = '⚠️'
#
# percent = d['edited'] / float(d['all']) * 100.0
#
# text += '%s: %.2f%% (%d/%d) %s\n' % (k, percent, d['edited'], d['all'], mark)
days_until_fsr = (date(2023, 9, 29) - date.today()).days
if days_until_fsr > 0: