mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-21 16:38:54 +02:00
2018-12-10 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'PyPAD.Update::resolvePadFields()' that caused incorrect rendering of 'dddd' placeholders when processing '%d(<dt>)' wildcards.
This commit is contained in:
parent
387cbad1b0
commit
b693555c87
@ -18150,3 +18150,7 @@
|
||||
* Added a 'cutNumber' field to the JSON PAD 'now' and 'next' objects.
|
||||
* Added a 'PyPAD.FIELD_CUT_NUMBER' define.
|
||||
* Added 'api/PyPAD/examples/pypad_test.py'.
|
||||
2018-12-10 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a bug in 'PyPAD.Update::resolvePadFields()' that caused
|
||||
incorrect rendering of 'dddd' placeholders when processing '%d(<dt>)'
|
||||
wildcards.
|
||||
|
@ -165,19 +165,9 @@ class Update(object):
|
||||
dt_pattern=pattern[3:-1]
|
||||
|
||||
try:
|
||||
dt_pattern=dt_pattern.replace('dddd',dt.strftime('%A'))
|
||||
dt_pattern=dt_pattern.replace('ddd',dt.strftime('%a'))
|
||||
dt_pattern=dt_pattern.replace('dd',dt.strftime('%d'))
|
||||
dt_pattern=dt_pattern.replace('d',str(dt.day))
|
||||
|
||||
dt_pattern=dt_pattern.replace('MMMM',dt.strftime('%B'))
|
||||
dt_pattern=dt_pattern.replace('MMM',dt.strftime('%b'))
|
||||
dt_pattern=dt_pattern.replace('MM',dt.strftime('%m'))
|
||||
dt_pattern=dt_pattern.replace('M',str(dt.month))
|
||||
|
||||
dt_pattern=dt_pattern.replace('yyyy',dt.strftime('%Y'))
|
||||
dt_pattern=dt_pattern.replace('yy',dt.strftime('%y'))
|
||||
|
||||
#
|
||||
# Process Times
|
||||
#
|
||||
miltime=(dt_pattern.find('ap')<0)and(dt_pattern.find('AP')<0)
|
||||
if not miltime:
|
||||
if dt.hour<13:
|
||||
@ -201,6 +191,23 @@ class Update(object):
|
||||
|
||||
dt_pattern=dt_pattern.replace('ss',dt.strftime('%S'))
|
||||
dt_pattern=dt_pattern.replace('s',str(dt.second))
|
||||
|
||||
#
|
||||
# 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('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('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'))
|
||||
|
||||
except AttributeError:
|
||||
string=string.replace(pattern,'')
|
||||
return string
|
||||
|
Loading…
x
Reference in New Issue
Block a user