Skip to content

Commit

Permalink
Move to end of reason list
Browse files Browse the repository at this point in the history
autopull
  • Loading branch information
𝐢𝐁𝐮𝐠 ♦ committed Sep 25, 2018
1 parent b05206c commit 0c3a3eb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion datahandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def update_reason_weights():
pass
if not os.path.isfile("rw.csv"):
return
d = {}
d = {'last_updated': time.time()}
with open("rw.csv", "r") as f:
next(f) # Pass the first line
for line in f:
Expand Down
3 changes: 1 addition & 2 deletions spamhandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def handle_spam(post, reasons, why):
escaped_username = escape_format(parsing.escape_markdown(username))
s = " {{}}: [{}]({}){} by [{}]({}) on `{}`".format(
sanitized_title, post_url, edited, escaped_username, poster_url, shortened_site)
s = " **{}** ".format(reason_weight) + s

Tasks.do(metasmoke.Metasmoke.send_stats_on_post,
post.title_ignore_type, post_url, reasons, post.body, username,
Expand All @@ -152,7 +151,7 @@ def handle_spam(post, reasons, why):
reason = ", ".join(reasons[:reason_count])
if len(reasons) > reason_count:
reason += ", +{} more".format(len(reasons) - reason_count)
reason = reason.capitalize()
reason = reason.capitalize() + " ({})".format(reason_weight)
message = prefix_ms + s.format(reason) # Insert reason list
if len(message) <= 500:
break # Problem solved, stop attempting
Expand Down
2 changes: 1 addition & 1 deletion ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
log('debug', "ChatExchange username loaded from config")
username = GlobalVars.chatexchange_u
else:
log('debug', "No ChatExchange username provided. Set it in config or provide it via environment variable")
log('error', "No ChatExchange username provided. Set it in config or provide it via environment variable")
os._exit(6)

if "ChatExchangeP" in os.environ:
Expand Down

0 comments on commit 0c3a3eb

Please sign in to comment.