Remove debug

merge-requests/30/head
Bob Mottram 2020-01-13 11:47:01 +00:00
parent f7a0890369
commit a1c5d43689
1 changed files with 1 additions and 11 deletions

View File

@ -30,7 +30,6 @@ def updatePostSchedule(baseDir: str,handle: str,httpd,maxScheduledPosts: int) ->
nickname=handle.split('@')[0] nickname=handle.split('@')[0]
with open(scheduleIndexFilename, 'r') as fp: with open(scheduleIndexFilename, 'r') as fp:
for line in fp: for line in fp:
print('DEBUG: schedule line='+line)
if ' ' not in line: if ' ' not in line:
continue continue
dateStr=line.split(' ')[0] dateStr=line.split(' ')[0]
@ -38,7 +37,6 @@ def updatePostSchedule(baseDir: str,handle: str,httpd,maxScheduledPosts: int) ->
continue continue
postId=line.split(' ',1)[1].replace('\n','') postId=line.split(' ',1)[1].replace('\n','')
postFilename=scheduleDir+postId+'.json' postFilename=scheduleDir+postId+'.json'
print('DEBUG: schedule postFilename '+postFilename)
if deleteSchedulePost: if deleteSchedulePost:
# delete extraneous scheduled posts # delete extraneous scheduled posts
if os.path.isfile(postFilename): if os.path.isfile(postFilename):
@ -47,27 +45,19 @@ def updatePostSchedule(baseDir: str,handle: str,httpd,maxScheduledPosts: int) ->
# create the new index file # create the new index file
indexLines.append(line) indexLines.append(line)
# convert string date to int # convert string date to int
print('DEBUG: schedule date='+dateStr)
postTime= \ postTime= \
datetime.datetime.strptime(dateStr,"%Y-%m-%dT%H:%M:%S%z").replace(tzinfo=None) datetime.datetime.strptime(dateStr,"%Y-%m-%dT%H:%M:%S%z").replace(tzinfo=None)
postDaysSinceEpoch= \ postDaysSinceEpoch= \
(postTime - datetime.datetime(1970,1,1)).days (postTime - datetime.datetime(1970,1,1)).days
print('DEBUG: schedule postTime hour='+str(postTime.time().hour))
print('DEBUG: schedule postTime minute='+str(postTime.time().minute))
print('DEBUG: schedule daysSinceEpoch='+str(daysSinceEpoch))
print('DEBUG: schedule postDaysSinceEpoch='+str(postDaysSinceEpoch))
if daysSinceEpoch < postDaysSinceEpoch: if daysSinceEpoch < postDaysSinceEpoch:
print('DEBUG: schedule not yet date')
continue continue
if daysSinceEpoch == postDaysSinceEpoch: if daysSinceEpoch == postDaysSinceEpoch:
if currTime.time().hour < postTime.time().hour: if currTime.time().hour < postTime.time().hour:
print('DEBUG: schedule not yet hour')
continue continue
if currTime.time().minute < postTime.time().minute: if currTime.time().minute < postTime.time().minute:
print('DEBUG: schedule not yet minute')
continue continue
if not os.path.isfile(postFilename): if not os.path.isfile(postFilename):
print('WARN: schedule postFilename='+postFilename) print('WARN: schedule missing postFilename='+postFilename)
indexLines.remove(line) indexLines.remove(line)
continue continue
# load post # load post