Skip to content

Commit

Permalink
Fix some code analysis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteCommander committed Apr 19, 2018
1 parent d7f8b34 commit 0315eca
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
5 changes: 0 additions & 5 deletions chatcommands.py
Expand Up @@ -11,11 +11,9 @@
from apigetpost import api_get_post, PostData
from datahandling import *
from blacklists import load_blacklists
from metasmoke import Metasmoke
from parsing import *
from spamhandling import check_if_spam, handle_spam
from gitmanager import GitManager
from tasks import Tasks
import threading
import random
import requests
Expand Down Expand Up @@ -917,8 +915,6 @@ def unnotify_all(msg):
"""
Unsubscribes a user to all events
:param msg:
:param room_id:
:param se_site:
:return: A string
"""
remove_all_from_notification_list(msg.owner.id)
Expand Down Expand Up @@ -1063,7 +1059,6 @@ def report(msg, args):
"""
Report a post (or posts)
:param msg:
:param urls:
:return: A string (or None)
"""
crn, wait = can_report_now(msg.owner.id, msg._client.host)
Expand Down
1 change: 1 addition & 0 deletions globalvars.py
Expand Up @@ -56,6 +56,7 @@ class GlobalVars:
startup_utc = datetime.utcnow().strftime("%H:%M:%S")
latest_questions = []
api_backoff_time = 0
deletion_watcher = None

metasmoke_last_ping_time = datetime.now()
not_privileged_warning = """
Expand Down
4 changes: 1 addition & 3 deletions spamhandling.py
@@ -1,6 +1,5 @@
# coding=utf-8
import sys
from threading import Thread
from findspam import FindSpam
import datahandling
import chatcommunicate
Expand All @@ -9,8 +8,6 @@
import parsing
import metasmoke
import excepthook
# noinspection PyCompatibility
import regex
from classes import Post, PostParseError
from helpers import log
from tasks import Tasks
Expand Down Expand Up @@ -120,6 +117,7 @@ def handle_spam(post, reasons, why):
log('debug', GlobalVars.parser.unescape(s).encode('ascii', errors='replace'))
GlobalVars.deletion_watcher.subscribe(post_url)

reason = message = None
for reason_count in range(5, 2, -1): # Try 5 reasons, then 4, then 3
reason = ", ".join(reasons[:reason_count])
if len(reasons) > reason_count:
Expand Down

0 comments on commit 0315eca

Please sign in to comment.