Comparar commits
No hay commits en común. '64cc856b41c4428e057f24090c7f948cbb7585f4' y '26c78f20f7b22d4933ebe2ba2e653e6b8fb03bf1' tienen historias completamente diferentes.
64cc856b41
...
26c78f20f7
S'han modificat 2 arxius amb 10 adicions i 14 eliminacions
|
@ -59,7 +59,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
while i < len(soft_total_project):
|
while i < 5:
|
||||||
|
|
||||||
|
|
||||||
db.write_top_soft(soft_total_project[i], soft_total_users[i], soft_total_mau[i], soft_total_servers[i])
|
db.write_top_soft(soft_total_project[i], soft_total_users[i], soft_total_mau[i], soft_total_servers[i])
|
||||||
|
|
22
upload.py
22
upload.py
|
@ -13,9 +13,9 @@ def date_string():
|
||||||
|
|
||||||
month = '{:02d}'.format(now.month)
|
month = '{:02d}'.format(now.month)
|
||||||
|
|
||||||
year = str(now.year)
|
year = str(now.year)[2:]
|
||||||
|
|
||||||
return day, month, year
|
return f'{year}{month}{day}'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
@ -25,19 +25,15 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
os.makedirs('dataset')
|
os.makedirs('dataset')
|
||||||
|
|
||||||
day, month, year = date_string()
|
date = date_string()
|
||||||
|
|
||||||
if not os.path.exists(f'dataset/{year}'):
|
if not os.path.exists(f'dataset/{date}'):
|
||||||
|
|
||||||
os.makedirs(f'dataset/{year}')
|
os.makedirs(f'dataset/{date}')
|
||||||
|
|
||||||
if not os.path.exists(f'dataset/{year}/{month}'):
|
filename = f'dataset_{date}.csv'
|
||||||
|
|
||||||
os.makedirs(f'dataset/{year}/{month}')
|
db.csv_save(f'dataset/{date}/{filename}')
|
||||||
|
|
||||||
filename = f'dataset_{year}{month}{day}.csv'
|
|
||||||
|
|
||||||
db.csv_save(f'dataset/{year}/{month}/{filename}')
|
|
||||||
|
|
||||||
fgj = Forgejo()
|
fgj = Forgejo()
|
||||||
|
|
||||||
|
@ -45,11 +41,11 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
with open(f'dataset/{year}/{month}/{filename}', 'rb') as input_file:
|
with open(f'dataset/{date}/{filename}', 'rb') as input_file:
|
||||||
data = input_file.read()
|
data = input_file.read()
|
||||||
file = base64.b64encode(data)
|
file = base64.b64encode(data)
|
||||||
|
|
||||||
response = fgj.repo_owner_create_file(gituser.login, fgj.stats_repo, f'dataset/{year}/{month}/{filename}', gituser.email, gituser.login, "main", file, f"{year}{month}{day} fediverse's dataset")
|
response = fgj.repo_owner_create_file(gituser.login, fgj.stats_repo, f'dataset/{date}/{filename}', gituser.email, gituser.login, "main", file, f"{date} fediverse's dataset")
|
||||||
|
|
||||||
if 'content' in response:
|
if 'content' in response:
|
||||||
|
|
||||||
|
|
Loading…
Referencia en una nova incidència