diff options
-rw-r--r-- | actions.log | 73 | ||||
-rwxr-xr-x | subreddit.py | 9 |
2 files changed, 78 insertions, 4 deletions
diff --git a/actions.log b/actions.log index 0e242f2..805898e 100644 --- a/actions.log +++ b/actions.log @@ -214935,3 +214935,76 @@ ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or googl [2020-07-27 12:04:26,223] {ERROR} name 'db' is not defined [2020-07-27 12:04:27,248] {ERROR while refunding 位} name 'db' is not defined [2020-07-27 12:04:27,659] {ERROR} name 'db' is not defined +[2020-07-27 12:21:50,549] +#################### +[Jul 27 2020 11:21:50] RESTARTED +#################### + +[2020-07-27 12:21:55,681] '/u/mr_churs' has given '/u/The-Sanity' lambda! +[2020-07-27 12:21:56,274] {ERROR} name 'db' is not defined +[2020-07-27 12:21:57,751] '/u/mr_churs' has given '/u/Sunkissed-horizon' lambda! +[2020-07-27 12:21:58,323] {ERROR} name 'db' is not defined +[2020-07-27 12:25:00,503] +#################### +[Jul 27 2020 11:25:00] RESTARTED +#################### + +[2020-07-27 12:25:12,937] '/u/_a_creative_username' has given '/u/bot-ocr' lambda! +[2020-07-27 12:25:13,535] /u/bot-ocr had their flair updated +[2020-07-27 12:25:15,610] A moderator removed -14 lambda from /u/bot-ocr for the reason 'for the purposes of testing' +[2020-07-27 12:25:16,303] /u/bot-ocr had their flair updated +[2020-07-27 12:25:18,463] A moderator refunded 20 lambda from /u/bot-ocr for the reason 'For the purposes of testing' +[2020-07-27 12:25:19,066] /u/bot-ocr had their flair updated +[2020-07-27 12:25:22,237] '/u/_a_creative_username' has given '/u/EuroSocialistsBot' lambda! +[2020-07-27 12:25:23,028] /u/EuroSocialistsBot had their flair updated +[2020-07-27 12:25:26,049] A moderator removed 35 lambda from /u/bot-ocr for the reason 'for being a filthy degenerate plus edit edit2' +[2020-07-27 12:25:26,640] /u/bot-ocr had their flair updated +[2020-07-27 12:25:38,825] /u/_a_creative_username had their flair updated +[2020-07-27 12:25:46,398] /u/_a_creative_username had their flair updated +[2020-07-27 12:25:48,289] There has been a new submission: 'a brand new proposal', with flair 'None' +[2020-07-27 12:25:48,771] There has been a new submission: 'The seventh /r/europeansocialists voting session is now accepting propoasls', with flair 'None' +[2020-07-27 12:25:49,303] There has been a new submission: '[INCENDIARY] ORLANDO: Gutwrenching Video Surfaces of School Police Arresting 6-Year-Old Black Girl', with flair 'None' +[2020-07-27 12:25:49,701] There has been a new submission: '[REDSPARK] District Leader Of Chand Led CPN Arrested In Bhojpur', with flair 'Redspark' +[2020-07-27 12:25:50,214] There has been a new submission: '[NDFP] Welcome to Duterte鈥檚 willingness to talk peace and let backchannel talks to lay the ground', with flair 'NDFP' +[2020-07-27 12:25:50,935] There has been a new submission: '[REDSPARK] District Leader Of Chand Led CPN Arrested In Bhojpur', with flair 'Redspark' +[2020-07-27 12:25:51,444] There has been a new submission: '[REDSPARK] District Chairperson Of Trade Union Federation Attached To Chand Led CPN Arrested And Jailed', with flair 'Redspark' +[2020-07-27 12:25:51,949] There has been a new submission: '[REDSPARK] CPI Maoist Working To Develop New Base Area In Amarkantak Forests', with flair 'Redspark' +[2020-07-27 12:25:52,512] There has been a new submission: '[REDSPARK] CPI Maoist Openly Oppose U.S. President Donald Trump鈥檚 Recent Visit To India', with flair 'Redspark' +[2020-07-27 12:25:52,972] There has been a new submission: '[REDSPARK] CPI Maoist Posters Surface In Ambayathode Town In Kannur District', with flair 'Redspark' +[2020-07-27 12:25:53,521] There has been a new submission: '[REDSPARK] Chand Led CPN Issues Statement Denouncing Former Government Minister Gokul Baskota', with flair 'Redspark' +[2020-07-27 12:25:54,048] There has been a new submission: '[REDSPARK] CPI Maoist Extends Support To Struggle Of Tribals In Visakha Area Of Andhra Pradesh', with flair 'Redspark' +[2020-07-27 12:25:54,545] There has been a new submission: 'criquie', with flair 'None' +[2020-07-27 12:25:54,843] file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth +Traceback (most recent call last): + File "/usr/local/lib/python3.7/dist-packages/googleapiclient/discovery_cache/file_cache.py", line 33, in <module> + from oauth2client.contrib.locked_file import LockedFile +ModuleNotFoundError: No module named 'oauth2client' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/usr/local/lib/python3.7/dist-packages/googleapiclient/discovery_cache/file_cache.py", line 37, in <module> + from oauth2client.locked_file import LockedFile +ModuleNotFoundError: No module named 'oauth2client' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/usr/local/lib/python3.7/dist-packages/googleapiclient/discovery_cache/__init__.py", line 44, in autodetect + from . import file_cache + File "/usr/local/lib/python3.7/dist-packages/googleapiclient/discovery_cache/file_cache.py", line 41, in <module> + "file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth" +ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth +[2020-07-27 12:25:56,556] /u/_a_creative_username had their flair updated +[2020-07-27 12:25:59,623] There has been a new submission: 'test', with flair 'None' +[2020-07-27 12:26:00,447] /u/_a_creative_username had their flair updated +[2020-07-27 12:26:02,504] There has been a new submission: 'test 2', with flair 'None' +[2020-07-27 12:26:03,307] /u/_a_creative_username had their flair updated +[2020-07-27 12:26:05,465] There has been a new submission: 'test 3', with flair 'None' +[2020-07-27 12:26:06,689] /u/_a_creative_username had their flair updated +[2020-07-27 12:26:09,882] There has been a new submission: 'test 4', with flair 'None' +[2020-07-27 12:26:10,507] /u/_a_creative_username had their flair updated +[2020-07-27 12:26:12,262] There has been a new submission: 'tets', with flair 'None' +[2020-07-27 12:26:13,035] /u/_a_creative_username had their flair updated +[2020-07-27 12:26:14,992] There has been a new submission: 'test', with flair 'None' +[2020-07-27 12:26:15,801] /u/_a_creative_username had their flair updated diff --git a/subreddit.py b/subreddit.py index 6a398f2..5632b82 100755 --- a/subreddit.py +++ b/subreddit.py @@ -69,7 +69,8 @@ def update_users_flair(username): if username in get_mods(): newflair = "[馃弳 鈭炍籡 %s" % (flairtext) else: - actualscore = db.get_lambda(username)[0] + with database.Database() as db: + actualscore = db.get_lambda(username)[0] newflair = "[%s%i位] %s" % (get_medal(actualscore), actualscore, flairtext) logging.info("/u/%s had their flair updated" % username) @@ -187,7 +188,7 @@ def handle_givelambda(comment): elif str(comment.author) in get_mods(): text = "The moderator /u/%s has given /u/%s 1位. /u/%s now has %i位." % (str(comment.author), parentauthour, parentauthour, db.get_lambda(parentauthour)[0] + 1) db.give_lambda(parentauthour, submission.permalink, timestamp = int(submission.created_utc)) - display(text) + display(text) elif submission.link_flair_text in FREE_FLAIRS: text = "You cannot give lambda in free posts anymore." elif op != str(submission.author): @@ -216,8 +217,8 @@ def handle_takelambda(comment): toremove = int(splitted[2].replace("\\", "")) reason = " ".join(splitted[3:]) - text = "/u/%s has had %i位 taken away from them for the reason '%s'. /u/%s now has %i位" % (user, toremove, reason, user, db.get_lambda(user)[0] - toremove) with database.Database() as db: + text = "/u/%s has had %i位 taken away from them for the reason '%s'. /u/%s now has %i位" % (user, toremove, reason, user, db.get_lambda(user)[0] - toremove) db.change_lambda(user, -toremove) display("A moderator removed %i lambda from /u/%s for the reason '%s'" % (toremove, user, reason)) except Exception as e: @@ -234,8 +235,8 @@ def handle_refundlambda(comment): toadd = int(splitted[2].replace("\\", "")) reason = " ".join(splitted[3:]) - text = "/u/%s has had %i位 refunded for the reason '%s'. /u/%s now has %i位" % (user, toadd, reason, user, db.get_lambda(user)[0] + toadd) with database.Database() as db: + text = "/u/%s has had %i位 refunded for the reason '%s'. /u/%s now has %i位" % (user, toadd, reason, user, db.get_lambda(user)[0] + toadd) db.change_lambda(user, toadd) display("A moderator refunded %i lambda from /u/%s for the reason '%s'" % (toadd, user, reason)) except Exception as e: |