mirror of https://gitlab.com/bashrc2/epicyon
Adding debug to exceptions
parent
e89538de47
commit
99ae054cf2
2
auth.py
2
auth.py
|
@ -255,5 +255,5 @@ def recordLoginFailure(baseDir: str, ipAddress: str,
|
||||||
ipAddress + ' port 443: ' +
|
ipAddress + ' port 443: ' +
|
||||||
'Too many authentication failures [preauth]\n')
|
'Too many authentication failures [preauth]\n')
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print('WARN: recordLoginFailure failed ' + str(failureLog))
|
print('EX: recordLoginFailure failed ' + str(failureLog))
|
||||||
pass
|
pass
|
||||||
|
|
16
blocking.py
16
blocking.py
|
@ -517,7 +517,7 @@ def mutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
os.remove(cachedPostFilename)
|
os.remove(cachedPostFilename)
|
||||||
print('MUTE: cached post removed ' + cachedPostFilename)
|
print('MUTE: cached post removed ' + cachedPostFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print('WARN: MUTE cached post not removed ' +
|
print('EX: MUTE cached post not removed ' +
|
||||||
cachedPostFilename)
|
cachedPostFilename)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -556,7 +556,7 @@ def mutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
print('MUTE: cached referenced post removed ' +
|
print('MUTE: cached referenced post removed ' +
|
||||||
cachedPostFilename)
|
cachedPostFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print('WARN: ' +
|
print('EX: ' +
|
||||||
'MUTE cached referenced post not removed ' +
|
'MUTE cached referenced post not removed ' +
|
||||||
cachedPostFilename)
|
cachedPostFilename)
|
||||||
pass
|
pass
|
||||||
|
@ -589,7 +589,7 @@ def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
os.remove(muteFilename)
|
os.remove(muteFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
if debug:
|
if debug:
|
||||||
print('WARN: unmutePost mute filename not deleted ' +
|
print('EX: unmutePost mute filename not deleted ' +
|
||||||
str(muteFilename))
|
str(muteFilename))
|
||||||
pass
|
pass
|
||||||
print('UNMUTE: ' + muteFilename + ' file removed')
|
print('UNMUTE: ' + muteFilename + ' file removed')
|
||||||
|
@ -640,7 +640,7 @@ def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
os.remove(cachedPostFilename)
|
os.remove(cachedPostFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
if debug:
|
if debug:
|
||||||
print('WARN: unmutePost cached post not deleted ' +
|
print('EX: unmutePost cached post not deleted ' +
|
||||||
str(cachedPostFilename))
|
str(cachedPostFilename))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -673,7 +673,7 @@ def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
cachedPostFilename)
|
cachedPostFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
if debug:
|
if debug:
|
||||||
print('WARN: ' +
|
print('EX: ' +
|
||||||
'unmutePost cached ref post not removed ' +
|
'unmutePost cached ref post not removed ' +
|
||||||
str(cachedPostFilename))
|
str(cachedPostFilename))
|
||||||
pass
|
pass
|
||||||
|
@ -819,7 +819,7 @@ def setBrochMode(baseDir: str, domainFull: str, enabled: bool) -> None:
|
||||||
try:
|
try:
|
||||||
os.remove(allowFilename)
|
os.remove(allowFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print('WARN: setBrochMode allow file not deleted ' +
|
print('EX: setBrochMode allow file not deleted ' +
|
||||||
str(allowFilename))
|
str(allowFilename))
|
||||||
pass
|
pass
|
||||||
print('Broch mode turned off')
|
print('Broch mode turned off')
|
||||||
|
@ -874,7 +874,7 @@ def brochModeLapses(baseDir: str, lapseDays: int) -> bool:
|
||||||
modifiedDate = \
|
modifiedDate = \
|
||||||
datetime.strptime(lastModified, "%Y-%m-%dT%H:%M:%SZ")
|
datetime.strptime(lastModified, "%Y-%m-%dT%H:%M:%SZ")
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print('WARN: brochModeLapses date not parsed ' + str(lastModified))
|
print('EX: brochModeLapses date not parsed ' + str(lastModified))
|
||||||
return False
|
return False
|
||||||
if not modifiedDate:
|
if not modifiedDate:
|
||||||
return False
|
return False
|
||||||
|
@ -886,7 +886,7 @@ def brochModeLapses(baseDir: str, lapseDays: int) -> bool:
|
||||||
os.remove(allowFilename)
|
os.remove(allowFilename)
|
||||||
removed = True
|
removed = True
|
||||||
except BaseException:
|
except BaseException:
|
||||||
print('WARN: brochModeLapses allow file not deleted ' +
|
print('EX: brochModeLapses allow file not deleted ' +
|
||||||
str(allowFilename))
|
str(allowFilename))
|
||||||
pass
|
pass
|
||||||
if removed:
|
if removed:
|
||||||
|
|
|
@ -52,6 +52,10 @@ def undoBookmarksCollectionEntry(recentPostsCache: {},
|
||||||
try:
|
try:
|
||||||
os.remove(cachedPostFilename)
|
os.remove(cachedPostFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
if debug:
|
||||||
|
print('EX: undoBookmarksCollectionEntry ' +
|
||||||
|
'unable to delete cached post file ' +
|
||||||
|
str(cachedPostFilename))
|
||||||
pass
|
pass
|
||||||
removePostFromCache(postJsonObject, recentPostsCache)
|
removePostFromCache(postJsonObject, recentPostsCache)
|
||||||
|
|
||||||
|
@ -160,6 +164,10 @@ def updateBookmarksCollection(recentPostsCache: {},
|
||||||
try:
|
try:
|
||||||
os.remove(cachedPostFilename)
|
os.remove(cachedPostFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
if debug:
|
||||||
|
print('EX: updateBookmarksCollection ' +
|
||||||
|
'unable to delete cached post ' +
|
||||||
|
str(cachedPostFilename))
|
||||||
pass
|
pass
|
||||||
removePostFromCache(postJsonObject, recentPostsCache)
|
removePostFromCache(postJsonObject, recentPostsCache)
|
||||||
|
|
||||||
|
|
1
cache.py
1
cache.py
|
@ -27,6 +27,7 @@ def _removePersonFromCache(baseDir: str, personUrl: str,
|
||||||
try:
|
try:
|
||||||
os.remove(cacheFilename)
|
os.remove(cacheFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: unable to delete cached actor ' + str(cacheFilename))
|
||||||
pass
|
pass
|
||||||
if personCache.get(personUrl):
|
if personCache.get(personUrl):
|
||||||
del personCache[personUrl]
|
del personCache[personUrl]
|
||||||
|
|
|
@ -96,6 +96,9 @@ def updateHashtagCategories(baseDir: str) -> None:
|
||||||
try:
|
try:
|
||||||
os.remove(categoryListFilename)
|
os.remove(categoryListFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: updateHashtagCategories ' +
|
||||||
|
'unable to delete cached category list ' +
|
||||||
|
categoryListFilename)
|
||||||
pass
|
pass
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
16
content.py
16
content.py
|
@ -272,6 +272,8 @@ def replaceEmojiFromTags(content: str, tag: [], messageType: str) -> str:
|
||||||
content = content.replace(tagItem['name'],
|
content = content.replace(tagItem['name'],
|
||||||
replaceChar)
|
replaceChar)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: replaceEmojiFromTags name ' +
|
||||||
|
str(iconName))
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# sequence of codes
|
# sequence of codes
|
||||||
|
@ -283,6 +285,8 @@ def replaceEmojiFromTags(content: str, tag: [], messageType: str) -> str:
|
||||||
icode, 16))
|
icode, 16))
|
||||||
except BaseException:
|
except BaseException:
|
||||||
iconCodeSequence = ''
|
iconCodeSequence = ''
|
||||||
|
print('EX: replaceEmojiFromTags code ' +
|
||||||
|
str(icode))
|
||||||
break
|
break
|
||||||
if iconCodeSequence:
|
if iconCodeSequence:
|
||||||
content = content.replace(tagItem['name'],
|
content = content.replace(tagItem['name'],
|
||||||
|
@ -943,11 +947,19 @@ def saveMediaInFormPOST(mediaBytes, debug: bool,
|
||||||
try:
|
try:
|
||||||
os.remove(possibleOtherFormat)
|
os.remove(possibleOtherFormat)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
if debug:
|
||||||
|
print('EX: saveMediaInFormPOST ' +
|
||||||
|
'unable to delete other ' +
|
||||||
|
str(possibleOtherFormat))
|
||||||
pass
|
pass
|
||||||
if os.path.isfile(filenameBase):
|
if os.path.isfile(filenameBase):
|
||||||
try:
|
try:
|
||||||
os.remove(filenameBase)
|
os.remove(filenameBase)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
if debug:
|
||||||
|
print('EX: saveMediaInFormPOST ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
str(filenameBase))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
|
@ -1017,6 +1029,10 @@ def saveMediaInFormPOST(mediaBytes, debug: bool,
|
||||||
try:
|
try:
|
||||||
os.remove(possibleOtherFormat)
|
os.remove(possibleOtherFormat)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
if debug:
|
||||||
|
print('EX: saveMediaInFormPOST ' +
|
||||||
|
'unable to delete other 2 ' +
|
||||||
|
str(possibleOtherFormat))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# don't allow scripts within svg files
|
# don't allow scripts within svg files
|
||||||
|
|
|
@ -46,6 +46,8 @@ def updateConversation(baseDir: str, nickname: str, domain: str,
|
||||||
fp.write(postId + '\n')
|
fp.write(postId + '\n')
|
||||||
return True
|
return True
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: updateConversation ' +
|
||||||
|
'unable to write to ' + conversationFilename)
|
||||||
pass
|
pass
|
||||||
elif postId + '\n' not in open(conversationFilename).read():
|
elif postId + '\n' not in open(conversationFilename).read():
|
||||||
try:
|
try:
|
||||||
|
@ -53,6 +55,8 @@ def updateConversation(baseDir: str, nickname: str, domain: str,
|
||||||
fp.write(postId + '\n')
|
fp.write(postId + '\n')
|
||||||
return True
|
return True
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: updateConversation 2 ' +
|
||||||
|
'unable to write to ' + conversationFilename)
|
||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -86,4 +90,6 @@ def unmuteConversation(baseDir: str, nickname: str, domain: str,
|
||||||
try:
|
try:
|
||||||
os.remove(conversationFilename + '.muted')
|
os.remove(conversationFilename + '.muted')
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: unmuteConversation unable to delete ' +
|
||||||
|
conversationFilename + '.muted')
|
||||||
pass
|
pass
|
||||||
|
|
96
daemon.py
96
daemon.py
|
@ -541,6 +541,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(cachedPostFilename)
|
os.remove(cachedPostFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _sendReplyToQuestion ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
cachedPostFilename)
|
||||||
pass
|
pass
|
||||||
# remove from memory cache
|
# remove from memory cache
|
||||||
removePostFromCache(postJsonObject,
|
removePostFromCache(postJsonObject,
|
||||||
|
@ -823,6 +826,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
with open(mediaFilename + '.etag', 'r') as etagFile:
|
with open(mediaFilename + '.etag', 'r') as etagFile:
|
||||||
etag = etagFile.read()
|
etag = etagFile.read()
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _set_headers_etag ' +
|
||||||
|
'unable to read ' + mediaFilename + '.etag')
|
||||||
pass
|
pass
|
||||||
if not etag:
|
if not etag:
|
||||||
etag = md5(data).hexdigest() # nosec
|
etag = md5(data).hexdigest() # nosec
|
||||||
|
@ -830,6 +835,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
with open(mediaFilename + '.etag', 'w+') as etagFile:
|
with open(mediaFilename + '.etag', 'w+') as etagFile:
|
||||||
etagFile.write(etag)
|
etagFile.write(etag)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _set_headers_etag ' +
|
||||||
|
'unable to write ' + mediaFilename + '.etag')
|
||||||
pass
|
pass
|
||||||
# if etag:
|
# if etag:
|
||||||
# self.send_header('ETag', '"' + etag + '"')
|
# self.send_header('ETag', '"' + etag + '"')
|
||||||
|
@ -855,6 +862,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
with open(mediaFilename, 'r') as etagFile:
|
with open(mediaFilename, 'r') as etagFile:
|
||||||
currEtag = etagFile.read()
|
currEtag = etagFile.read()
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _etag_exists unable to read ' +
|
||||||
|
str(mediaFilename))
|
||||||
pass
|
pass
|
||||||
if currEtag and oldEtag == currEtag:
|
if currEtag and oldEtag == currEtag:
|
||||||
# The file has not changed
|
# The file has not changed
|
||||||
|
@ -2329,6 +2338,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(newswireBlockedFilename)
|
os.remove(newswireBlockedFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _personOptions unable to delete ' +
|
||||||
|
newswireBlockedFilename)
|
||||||
pass
|
pass
|
||||||
refreshNewswire(self.server.baseDir)
|
refreshNewswire(self.server.baseDir)
|
||||||
else:
|
else:
|
||||||
|
@ -2367,6 +2378,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(featuresBlockedFilename)
|
os.remove(featuresBlockedFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _personOptions unable to delete ' +
|
||||||
|
featuresBlockedFilename)
|
||||||
pass
|
pass
|
||||||
refreshNewswire(self.server.baseDir)
|
refreshNewswire(self.server.baseDir)
|
||||||
else:
|
else:
|
||||||
|
@ -2405,6 +2418,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(newswireModFilename)
|
os.remove(newswireModFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _personOptions unable to delete ' +
|
||||||
|
newswireModFilename)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if os.path.isdir(accountDir):
|
if os.path.isdir(accountDir):
|
||||||
|
@ -3838,6 +3853,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(linksFilename)
|
os.remove(linksFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _linksUpdate unable to delete ' +
|
||||||
|
linksFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
adminNickname = \
|
adminNickname = \
|
||||||
|
@ -3854,6 +3871,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(aboutFilename)
|
os.remove(aboutFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _linksUpdate unable to delete ' +
|
||||||
|
aboutFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if fields.get('editedTOS'):
|
if fields.get('editedTOS'):
|
||||||
|
@ -3867,6 +3886,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(TOSFilename)
|
os.remove(TOSFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _linksUpdate unable to delete ' +
|
||||||
|
TOSFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# redirect back to the default timeline
|
# redirect back to the default timeline
|
||||||
|
@ -3968,6 +3989,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(categoryFilename)
|
os.remove(categoryFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _setHashtagCategory unable to delete ' +
|
||||||
|
categoryFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# redirect back to the default timeline
|
# redirect back to the default timeline
|
||||||
|
@ -4049,6 +4072,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(newswireFilename)
|
os.remove(newswireFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _newswireUpdate unable to delete ' +
|
||||||
|
newswireFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# save filtered words list for the newswire
|
# save filtered words list for the newswire
|
||||||
|
@ -4063,6 +4088,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(filterNewswireFilename)
|
os.remove(filterNewswireFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _newswireUpdate unable to delete ' +
|
||||||
|
filterNewswireFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# save news tagging rules
|
# save news tagging rules
|
||||||
|
@ -4076,6 +4103,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(hashtagRulesFilename)
|
os.remove(hashtagRulesFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _newswireUpdate unable to delete ' +
|
||||||
|
hashtagRulesFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
newswireTrustedFilename = baseDir + '/accounts/newswiretrusted.txt'
|
newswireTrustedFilename = baseDir + '/accounts/newswiretrusted.txt'
|
||||||
|
@ -4090,6 +4119,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(newswireTrustedFilename)
|
os.remove(newswireTrustedFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _newswireUpdate unable to delete ' +
|
||||||
|
newswireTrustedFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# redirect back to the default timeline
|
# redirect back to the default timeline
|
||||||
|
@ -4118,6 +4149,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(citationsFilename)
|
os.remove(citationsFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _citationsUpdate unable to delete ' +
|
||||||
|
citationsFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if newswire and \
|
if newswire and \
|
||||||
|
@ -4423,6 +4456,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(filenameBase)
|
os.remove(filenameBase)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate unable to delete ' +
|
||||||
|
filenameBase)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
filenameBase = \
|
filenameBase = \
|
||||||
|
@ -4458,6 +4493,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(postImageFilename + '.etag')
|
os.remove(postImageFilename + '.etag')
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate unable to delete ' +
|
||||||
|
postImageFilename + '.etag')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
city = getSpoofedCity(self.server.city,
|
city = getSpoofedCity(self.server.city,
|
||||||
|
@ -5493,6 +5530,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
os.remove(baseDir +
|
os.remove(baseDir +
|
||||||
'/fonts/custom.' + ext)
|
'/fonts/custom.' + ext)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
baseDir + '/fonts/custom.' + ext)
|
||||||
pass
|
pass
|
||||||
if os.path.isfile(baseDir +
|
if os.path.isfile(baseDir +
|
||||||
'/fonts/custom.' + ext +
|
'/fonts/custom.' + ext +
|
||||||
|
@ -5502,6 +5542,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'/fonts/custom.' + ext +
|
'/fonts/custom.' + ext +
|
||||||
'.etag')
|
'.etag')
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
baseDir + '/fonts/custom.' +
|
||||||
|
ext + '.etag')
|
||||||
pass
|
pass
|
||||||
currTheme = getTheme(baseDir)
|
currTheme = getTheme(baseDir)
|
||||||
if currTheme:
|
if currTheme:
|
||||||
|
@ -5553,6 +5597,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(followDMsFilename)
|
os.remove(followDMsFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
followDMsFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# remove Twitter retweets
|
# remove Twitter retweets
|
||||||
|
@ -5571,6 +5618,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(removeTwitterFilename)
|
os.remove(removeTwitterFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
removeTwitterFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# hide Like button
|
# hide Like button
|
||||||
|
@ -5591,12 +5641,18 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(notifyLikesFilename)
|
os.remove(notifyLikesFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
notifyLikesFilename)
|
||||||
pass
|
pass
|
||||||
if not hideLikeButtonActive:
|
if not hideLikeButtonActive:
|
||||||
if os.path.isfile(hideLikeButtonFile):
|
if os.path.isfile(hideLikeButtonFile):
|
||||||
try:
|
try:
|
||||||
os.remove(hideLikeButtonFile)
|
os.remove(hideLikeButtonFile)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
hideLikeButtonFile)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# notify about new Likes
|
# notify about new Likes
|
||||||
|
@ -5618,6 +5674,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(notifyLikesFilename)
|
os.remove(notifyLikesFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
notifyLikesFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# this account is a bot
|
# this account is a bot
|
||||||
|
@ -5680,6 +5739,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(filterFilename)
|
os.remove(filterFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
filterFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# word replacements
|
# word replacements
|
||||||
|
@ -5694,6 +5756,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(switchFilename)
|
os.remove(switchFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
switchFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# autogenerated tags
|
# autogenerated tags
|
||||||
|
@ -5708,6 +5773,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(autoTagsFilename)
|
os.remove(autoTagsFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
autoTagsFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# autogenerated content warnings
|
# autogenerated content warnings
|
||||||
|
@ -5722,6 +5790,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(autoCWFilename)
|
os.remove(autoCWFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
autoCWFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# save blocked accounts list
|
# save blocked accounts list
|
||||||
|
@ -5736,6 +5807,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(blockedFilename)
|
os.remove(blockedFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
blockedFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Save DM allowed instances list.
|
# Save DM allowed instances list.
|
||||||
|
@ -5752,6 +5826,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(dmAllowedInstancesFilename)
|
os.remove(dmAllowedInstancesFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
dmAllowedInstancesFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# save allowed instances list
|
# save allowed instances list
|
||||||
|
@ -5767,6 +5844,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(allowedInstancesFilename)
|
os.remove(allowedInstancesFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
allowedInstancesFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if isModerator(self.server.baseDir, nickname):
|
if isModerator(self.server.baseDir, nickname):
|
||||||
|
@ -5830,6 +5910,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(peertubeInstancesFile)
|
os.remove(peertubeInstancesFile)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
peertubeInstancesFile)
|
||||||
pass
|
pass
|
||||||
self.server.peertubeInstances.clear()
|
self.server.peertubeInstances.clear()
|
||||||
|
|
||||||
|
@ -5845,6 +5928,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(gitProjectsFilename)
|
os.remove(gitProjectsFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _profileUpdate ' +
|
||||||
|
'unable to delete ' +
|
||||||
|
gitProjectsFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# save actor json file within accounts
|
# save actor json file within accounts
|
||||||
|
@ -15082,6 +15168,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
with open(mediaTagFilename, 'r') as etagFile:
|
with open(mediaTagFilename, 'r') as etagFile:
|
||||||
etag = etagFile.read()
|
etag = etagFile.read()
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: do_HEAD unable to read ' +
|
||||||
|
mediaTagFilename)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
with open(mediaFilename, 'rb') as avFile:
|
with open(mediaFilename, 'rb') as avFile:
|
||||||
|
@ -15091,6 +15179,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
with open(mediaTagFilename, 'w+') as etagFile:
|
with open(mediaTagFilename, 'w+') as etagFile:
|
||||||
etagFile.write(etag)
|
etagFile.write(etag)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: do_HEAD unable to write ' +
|
||||||
|
mediaTagFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
mediaFileType = mediaFileMimeType(checkPath)
|
mediaFileType = mediaFileMimeType(checkPath)
|
||||||
|
@ -15257,6 +15347,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
with open(lastUsedFilename, 'w+') as lastUsedFile:
|
with open(lastUsedFilename, 'w+') as lastUsedFile:
|
||||||
lastUsedFile.write(str(int(time.time())))
|
lastUsedFile.write(str(int(time.time())))
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _receiveNewPostProcess unable to write ' +
|
||||||
|
lastUsedFilename)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
mentionsStr = ''
|
mentionsStr = ''
|
||||||
|
@ -15420,6 +15512,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(cachedFilename)
|
os.remove(cachedFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _receiveNewPostProcess ' +
|
||||||
|
'unable to delete ' + cachedFilename)
|
||||||
pass
|
pass
|
||||||
# remove from memory cache
|
# remove from memory cache
|
||||||
removePostFromCache(postJsonObject,
|
removePostFromCache(postJsonObject,
|
||||||
|
@ -15843,6 +15937,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
try:
|
try:
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
print('EX: _receiveNewPostProcess ' +
|
||||||
|
'unable to delete ' + filename)
|
||||||
pass
|
pass
|
||||||
self.postToNickname = nickname
|
self.postToNickname = nickname
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in New Issue