Compare commits

..

No commits in common. "79ca90597ca5cc02dabfec4460e7baeab76e3008" and "ef361b3123329dd02fbd1715a4956858aaf65970" have entirely different histories.

12 changed files with 18 additions and 6978 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,15 +2,13 @@ Metadata-Version: 2.1
Name: drstats Name: drstats
Version: 1.3.37 Version: 1.3.37
Summary: dR stats Summary: dR stats
Home-page: UNKNOWN
Author: Retoor Author: Retoor
Author-email: retoor@molodetz.nl Author-email: retoor@molodetz.nl
License: MIT License: MIT
Platform: UNKNOWN
Requires-Python: >=3.7 Requires-Python: >=3.7
Description-Content-Type: text/markdown Description-Content-Type: text/markdown
Requires-Dist: aiohttp==3.10.10
Requires-Dist: dataset==1.6.2
Requires-Dist: matplotlib==3.9.2
Requires-Dist: requests==2.32.3
# dRStats # dRStats
@ -56,3 +54,5 @@ If you type `dr.` in terminal and press tab you'll see all available apps auto c
4. `dr.rant_stats_per_day` exports graphs to export folder. don't forget to execute `dr.sync` first. 4. `dr.rant_stats_per_day` exports graphs to export folder. don't forget to execute `dr.sync` first.
5. `dr.rant_stats_per_hour` exports graphs to export folder. don't forget to execute `dr.sync` first. 5. `dr.rant_stats_per_hour` exports graphs to export folder. don't forget to execute `dr.sync` first.
6. `dr.rant_stats_per_weekday` exports graphs to export folder. don't forget to execute `dr.sync` first. 6. `dr.rant_stats_per_weekday` exports graphs to export folder. don't forget to execute `dr.sync` first.

View File

@ -5,3 +5,4 @@ dr.rant_stats_per_hour = drstats.statistics:rant_stats_per_hour
dr.rant_stats_per_weekday = drstats.statistics:rant_stats_per_weekday dr.rant_stats_per_weekday = drstats.statistics:rant_stats_per_weekday
dr.stats_all = drstats.statistics:rant_stats_all dr.stats_all = drstats.statistics:rant_stats_all
dr.sync = drstats.sync:sync dr.sync = drstats.sync:sync

View File

@ -22,9 +22,9 @@ def dump():
printr(statistics_text[-1]) printr(statistics_text[-1])
print("\n".join(statistics_text)) print("\n".join(statistics_text))
all_content = "" all_content = ""
for user in list(db.get_users()): for user in db.get_users():
text = ( text = (
db.get_all_rants_of_user(user) db.get_all_rants_of_user(user).replace("\n", " ").replace(" ", " ").strip()
) )
total_text = "" total_text = ""
if text: if text:
@ -43,7 +43,7 @@ def dump():
f.write(text) f.write(text)
f.write("```") f.write("```")
text = ( text = (
db.get_all_posts_of_user(user) db.get_all_posts_of_user(user).replace("\n", " ").replace(" ", " ").strip()
) )
if text: if text:
total_text += text total_text += text
@ -62,7 +62,6 @@ def dump():
f.write("```") f.write("```")
all_content += total_text all_content += total_text
print("===Mentions of users:", "```") print("===Mentions of users:", "```")
users = db.get_users() users = db.get_users()
users.sort() users.sort()
for user in users: for user in users:

View File

@ -282,16 +282,16 @@ def get_contribution_average_per_user():
def get_all_rants_of_user(username): def get_all_rants_of_user(username):
with Db() as _db: with Db() as db:
try: try:
return list(_db.db["rants_of_user"].find(username=username))[0]["text"] return db.db["rants_of_user"].find_one(username=username)["text"]
except IndexError: except TypeError:
return "" return ""
def get_all_posts_of_user(username): def get_all_posts_of_user(username):
with Db() as _db: with Db() as db:
try: try:
return list(_db.db["posts_of_user"].find(username=username))[0]["text"] return db.db["posts_of_user"].find_one(username=username)["text"]
except IndexError: except TypeError:
return "" return ""