2022-08-18 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in PyPAD where resolution of datetimes could be
	incorrect.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2022-08-18 16:28:20 -04:00
parent 97ff4614b1
commit 4071607711
2 changed files with 12 additions and 7 deletions

View File

@@ -23236,3 +23236,6 @@
message when processing a 202 response.
* Added explicit processing for 201, 230, 401, 402, 403, 409, 431,
432, 433, 434, 501, 502, 503 and 530 returns in the CDDB parser.
2022-08-18 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in PyPAD where resolution of datetimes could be
incorrect.

View File

@@ -2,7 +2,7 @@
#
# PAD processor for Rivendell
#
# (C) Copyright 2018-2021 Fred Gleason <fredg@paravelsystems.com>
# (C) Copyright 2018-2022 Fred Gleason <fredg@paravelsystems.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -188,18 +188,22 @@ class Update(object):
#
# Process Dates
#
dt_pattern=dt_pattern.replace('MMMM',dt.strftime('%B'))
dt_pattern=dt_pattern.replace('MMM',dt.strftime('%b'))
dt_pattern=dt_pattern.replace('MMMM',dt.strftime('%B').upper())
dt_pattern=dt_pattern.replace('MMM',dt.strftime('%b').upper())
dt_pattern=dt_pattern.replace('MM',dt.strftime('%m'))
dt_pattern=dt_pattern.replace('M',str(dt.month))
dt_pattern=dt_pattern.replace('dddd',dt.strftime('%A'))
dt_pattern=dt_pattern.replace('ddd',dt.strftime('%a'))
dt_pattern=dt_pattern.replace('dddd',dt.strftime('%A').upper())
dt_pattern=dt_pattern.replace('ddd',dt.strftime('%a').upper())
dt_pattern=dt_pattern.replace('dd',dt.strftime('%d'))
dt_pattern=dt_pattern.replace('d',str(dt.day))
dt_pattern=dt_pattern.replace('yyyy',dt.strftime('%Y'))
dt_pattern=dt_pattern.replace('yy',dt.strftime('%y'))
pat=''
for s in dt_pattern.split(" "):
pat+=s.capitalize()+' '
dt_pattern=pat[:-1]
except AttributeError:
string=string.replace(pattern,'')
@@ -751,8 +755,6 @@ class Update(object):
result=result and False
else:
result=result and False
#print('machine(): '+str(self.machine()))
#print('result: '+str(result))
return result