diff --git a/ChangeLog b/ChangeLog index d7b7ba30..dc287c9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20897,3 +20897,6 @@ 2022-08-15 Fred Gleason * 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-17 Fred Gleason + * Fixed a bug in PyPAD where resolution of datetimes could be + incorrect. diff --git a/apis/pypad/api/pypad.py b/apis/pypad/api/pypad.py index faf1e9aa..120ba4a0 100644 --- a/apis/pypad/api/pypad.py +++ b/apis/pypad/api/pypad.py @@ -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 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 diff --git a/apis/pypad/scripts/pypad_udp.exemplar b/apis/pypad/scripts/pypad_udp.exemplar index 91de1c05..2f39d446 100644 --- a/apis/pypad/scripts/pypad_udp.exemplar +++ b/apis/pypad/scripts/pypad_udp.exemplar @@ -25,6 +25,7 @@ UdpPort=1234 ; file in the Rivendell documentation directory. ; FormatString=NOW: %d(ddd MMM d hh:mm:ss yyyy): %t - %a\nNEXT: %D(ddd MMM d hh:mm:ss yyyy): %T - %A\n +;FormatString=NEXT: %D(ddd MMM d hh:mm:ss yyyy): %T - %A\n ; Encoding. Defines the set of escapes to be applied to the PAD fields. ; The following options are available: