From 4286c4a895548bdaaa190b248b43b1388e630a62 Mon Sep 17 00:00:00 2001
From: jwansek <eddie.atten.ea29@gmail.com>
Date: Fri, 31 Jul 2020 20:02:13 +0100
Subject: fixed a bug with logging

---
 actions.log  | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 database.py  |  2 +-
 subreddit.py |  4 +--
 3 files changed, 98 insertions(+), 3 deletions(-)

diff --git a/actions.log b/actions.log
index 6965ad3..d752a8e 100644
--- a/actions.log
+++ b/actions.log
@@ -348423,3 +348423,98 @@ ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or googl
 11601	[2020-07-30 20:18:03,293]	a message with a concerning
 6914	[2020-07-31 16:10:51,862]	[2020-07-30 20:18:03,293]	a message without a concerning
 6914	[2020-07-31 16:11:16,473]	floofleberries
+13771	[2020-07-31 17:08:01,750]	####################[Jul 31 2020 16:08:01] RESTARTED####################
+13771	[2020-07-31 17:08:15,216]	'/u/_a_creative_username' has given '/u/bot-ocr' lambda!
+13771	[2020-07-31 17:08:15,218]	{ERROR} (1406, "Data too long for column 'reddit_id' at row 1")
+13771	[2020-07-31 17:08:16,430]	A moderator removed -14 lambda from /u/bot-ocr for the reason 'for the purposes of testing'
+13771	[2020-07-31 17:08:16,432]	{ERROR while removing λ} (1406, "Data too long for column 'reddit_id' at row 1")
+13771	[2020-07-31 17:08:16,433]	{ERROR} (1406, "Data too long for column 'reddit_id' at row 1")
+13771	[2020-07-31 17:08:17,541]	A moderator refunded 20 lambda from /u/bot-ocr for the reason 'For the purposes of testing'
+13771	[2020-07-31 17:08:17,546]	{ERROR while refunding λ} (1406, "Data too long for column 'reddit_id' at row 1")
+13771	[2020-07-31 17:08:17,551]	{ERROR} (1406, "Data too long for column 'reddit_id' at row 1")
+13771	[2020-07-31 17:08:19,739]	'/u/_a_creative_username' has given '/u/EuroSocialistsBot' lambda!
+13771	[2020-07-31 17:08:19,742]	{ERROR} (1406, "Data too long for column 'reddit_id' at row 1")
+13771	[2020-07-31 17:08:20,943]	A moderator removed 35 lambda from /u/bot-ocr for the reason 'for being a filthy degenerate plus edit edit2'
+13771	[2020-07-31 17:08:20,945]	{ERROR while removing λ} (1406, "Data too long for column 'reddit_id' at row 1")
+13771	[2020-07-31 17:08:20,948]	{ERROR} (1406, "Data too long for column 'reddit_id' at row 1")
+13771	[2020-07-31 17:08:38,809]	/u/_a_creative_username had their flair updated
+13771	[2020-07-31 17:08:49,927]	/u/_a_creative_username had their flair updated
+13771	[2020-07-31 17:09:02,161]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:04,139]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:04,802]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:06,178]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:07,708]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:09,031]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:10,328]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:11,830]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:13,200]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:14,619]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:16,009]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:17,176]	{ERROR} 'NoneType' object has no attribute 'permalink'
+13771	[2020-07-31 17:09:18,850]	{ERROR} 'NoneType' object has no attribute 'permalink'
+20219	[2020-07-31 19:27:38,814]	####################[Jul 31 2020 18:27:38] RESTARTED####################
+20219	[2020-07-31 19:28:01,658]	'/u/_a_creative_username' has given '/u/bot-ocr' lambda!
+20219	[2020-07-31 19:28:04,737]	/u/bot-ocr had their flair updated
+20219	[2020-07-31 19:28:09,614]	A moderator removed -14 lambda from /u/bot-ocr for the reason 'for the purposes of testing'
+20219	[2020-07-31 19:28:14,132]	/u/bot-ocr had their flair updated
+20219	[2020-07-31 19:28:27,203]	A moderator refunded 20 lambda from /u/bot-ocr for the reason 'For the purposes of testing'
+20219	[2020-07-31 19:28:28,178]	/u/bot-ocr had their flair updated
+20219	[2020-07-31 19:28:46,612]	'/u/_a_creative_username' has given '/u/EuroSocialistsBot' lambda!
+20219	[2020-07-31 19:28:49,499]	/u/EuroSocialistsBot had their flair updated
+20219	[2020-07-31 19:28:59,338]	A moderator removed 35 lambda from /u/bot-ocr for the reason 'for being a filthy degenerate plus edit edit2'
+20219	[2020-07-31 19:29:00,020]	/u/bot-ocr had their flair updated
+20219	[2020-07-31 19:29:29,920]	/u/_a_creative_username had their flair updated
+20219	[2020-07-31 19:30:08,859]	/u/_a_creative_username had their flair updated
+21411	[2020-07-31 19:43:51,533]	####################[Jul 31 2020 18:43:51] RESTARTED####################
+21411	[2020-07-31 19:45:01,188]	/u/_a_creative_username had their flair updated
+21411	[2020-07-31 19:45:25,072]	There has been a new submission: 'a brand new proposal', with flair 'None'
+21411	[2020-07-31 19:45:26,763]	There has been a new submission: 'The seventh /r/europeansocialists voting session is now accepting propoasls', with flair 'None'
+21822	[2020-07-31 19:53:09,503]	####################[Jul 31 2020 18:53:09] RESTARTED####################
+21822	[2020-07-31 19:53:45,474]	'/u/_a_creative_username' has given '/u/bot-ocr' lambda!
+21822	[2020-07-31 19:53:48,861]	/u/bot-ocr had their flair updated
+21822	[2020-07-31 19:53:59,435]	A moderator removed -14 lambda from /u/bot-ocr for the reason 'for the purposes of testing'
+21822	[2020-07-31 19:54:00,697]	/u/bot-ocr had their flair updated
+21822	[2020-07-31 19:54:14,186]	A moderator refunded 20 lambda from /u/bot-ocr for the reason 'For the purposes of testing'
+21822	[2020-07-31 19:54:21,708]	/u/bot-ocr had their flair updated
+21822	[2020-07-31 19:55:08,023]	'/u/_a_creative_username' has given '/u/EuroSocialistsBot' lambda!
+21822	[2020-07-31 19:55:15,759]	/u/EuroSocialistsBot had their flair updated
+21822	[2020-07-31 19:55:29,490]	A moderator removed 35 lambda from /u/bot-ocr for the reason 'for being a filthy degenerate plus edit edit2'
+21822	[2020-07-31 19:55:30,420]	/u/bot-ocr had their flair updated
+21822	[2020-07-31 19:56:20,706]	/u/_a_creative_username had their flair updated
+21822	[2020-07-31 19:57:19,173]	/u/_a_creative_username had their flair updated
+21822	[2020-07-31 19:57:43,838]	There has been a new submission: 'a brand new proposal', with flair 'None'
+21822	[2020-07-31 19:57:46,468]	There has been a new submission: 'The seventh /r/europeansocialists voting session is now accepting propoasls', with flair 'None'
+21822	[2020-07-31 19:57:54,299]	There has been a new submission: '[INCENDIARY] ORLANDO: Gutwrenching Video Surfaces of School Police Arresting 6-Year-Old Black Girl', with flair 'None'
+21822	[2020-07-31 19:58:02,047]	There has been a new submission: '[REDSPARK] District Leader Of Chand Led CPN Arrested In Bhojpur', with flair 'Redspark'
+21822	[2020-07-31 19:58:09,981]	There has been a new submission: '[NDFP] Welcome to Duterte’s willingness to talk peace and let backchannel talks to lay the ground', with flair 'NDFP'
+21822	[2020-07-31 19:58:21,102]	There has been a new submission: '[REDSPARK] District Leader Of Chand Led CPN Arrested In Bhojpur', with flair 'Redspark'
+21822	[2020-07-31 19:58:25,594]	There has been a new submission: '[REDSPARK] District Chairperson Of Trade Union Federation Attached To Chand Led CPN Arrested And Jailed', with flair 'Redspark'
+21822	[2020-07-31 19:58:26,267]	There has been a new submission: '[REDSPARK] CPI Maoist Working To Develop New Base Area In Amarkantak Forests', with flair 'Redspark'
+21822	[2020-07-31 19:58:29,178]	There has been a new submission: '[REDSPARK] CPI Maoist Openly Oppose U.S. President Donald Trump’s Recent Visit To India', with flair 'Redspark'
+21822	[2020-07-31 19:58:30,314]	There has been a new submission: '[REDSPARK] CPI Maoist Posters Surface In Ambayathode Town In Kannur District', with flair 'Redspark'
+21822	[2020-07-31 19:58:31,317]	There has been a new submission: '[REDSPARK] Chand Led CPN Issues Statement Denouncing Former Government Minister Gokul Baskota', with flair 'Redspark'
+21822	[2020-07-31 19:58:32,786]	There has been a new submission: '[REDSPARK] CPI Maoist Extends Support To Struggle Of Tribals In Visakha Area Of Andhra Pradesh', with flair 'Redspark'
+21822	[2020-07-31 19:58:33,670]	There has been a new submission: 'criquie', with flair ' 26:05 | :youtube: Vaush | 26:05 | :youtube: Vaush'
+21822	[2020-07-31 19:58:41,200]	file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.5/dist-packages/googleapiclient/discovery_cache/file_cache.py", line 33, in <module>
+    from oauth2client.contrib.locked_file import LockedFile
+ImportError: No module named 'oauth2client'
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.5/dist-packages/googleapiclient/discovery_cache/file_cache.py", line 37, in <module>
+    from oauth2client.locked_file import LockedFile
+ImportError: No module named 'oauth2client'
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File "/usr/local/lib/python3.5/dist-packages/googleapiclient/discovery_cache/__init__.py", line 44, in autodetect
+    from . import file_cache
+  File "/usr/local/lib/python3.5/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
+21822	[2020-07-31 19:58:55,227]	/u/_a_creative_username had their flair updated
+21822	[2020-07-31 20:01:07,304]	{ERROR} 
diff --git a/database.py b/database.py
index edfff74..2491c08 100755
--- a/database.py
+++ b/database.py
@@ -70,7 +70,7 @@ class Database:
                 datetime_ DATETIME NOT NULL,
                 category VARCHAR(10) NOT NULL DEFAULT 'INFO',
                 data_ VARCHAR(500) NOT NULL,
-                reddit_id VARCHAR(30) NULL
+                reddit_id VARCHAR(120) NULL
             );""")
             print("Added logging table...")
 
diff --git a/subreddit.py b/subreddit.py
index ff81bc4..eece316 100755
--- a/subreddit.py
+++ b/subreddit.py
@@ -365,7 +365,7 @@ def main():
                 with database.Database() as db:
                     if not db.id_in_blacklist(submission.id):
                         db.add_to_blacklist(submission.id)                         
-                        display("There has been a new submission: '%s', with flair '%s'" % (submission.title, submission.link_flair_text), concerning=comment.permalink)
+                        display("There has been a new submission: '%s', with flair '%s'" % (submission.title, submission.link_flair_text), concerning=submission.permalink)
 
                         response = None
                         if str(submission.author) not in get_mods():
@@ -374,7 +374,7 @@ def main():
                             reply.mod.distinguish(sticky = True)
                             reply.mod.approve()
 
-        except Exception as e:
+        except KeyboardInterrupt as e:
             display("{ERROR} %s" % e)
             continue
 
-- 
cgit v1.2.3