2019-07-02 Fred Gleason <fredg@paravelsystems.com>

* Implemented the '%v'/'%V' metadata wildcards for PyPAD.
This commit is contained in:
Fred Gleason 2019-07-02 15:13:55 -04:00
parent 48aeabead0
commit 2dcae708ef
3 changed files with 14 additions and 1 deletions

View File

@ -18852,3 +18852,5 @@
* Fixed a bug that caused the 'Overview' section of the
'Managing the Rivendell Database with RDDbConfig' chapter to be
omitted from the HTML version of the Operations Guide.
2019-07-02 Fred Gleason <fredg@paravelsystems.com>
* Implemented the '%v'/'%V' metadata wildcards for PyPAD.

View File

@ -410,7 +410,16 @@ class Update(object):
string=self.__replaceWildcardPair('s','songId',string,esc)
string=self.__replaceWildcardPair('t','title',string,esc)
string=self.__replaceWildcardPair('u','userDefined',string,esc)
#string=self.__replaceWildcardPair('v',sfield,string,esc) # Length, rounded down
secs=self.__replaceWildcard('v','length','now','%v',ESCAPE_NONE) # Length, rounded down
if(secs==''):
string=string.replace('%v','0')
else:
string=string.replace('%v',str(int(secs)//1000))
secs=self.__replaceWildcard('V','length','next','%V',ESCAPE_NONE)
if(secs==''):
string=string.replace('%V','0')
else:
string=string.replace('%V',str(int(secs)//1000))
#string=self.__replaceWildcardPair('w',sfield,string,esc) # Unassigned
string=self.__replaceWildcardPair('x','lineId',string,esc) # Log Line ID
string=self.__replaceWildcardPair('y','year',string,esc)

View File

@ -65,6 +65,7 @@ def ProcessPad(update):
print(' cartNumber(): %u / ' % update.padField(pypad.TYPE_NOW,pypad.FIELD_CART_NUMBER)+update.resolvePadFields("%n",pypad.ESCAPE_NONE))
print(' cutNumber(): %u / ' % update.padField(pypad.TYPE_NOW,pypad.FIELD_CUT_NUMBER)+update.resolvePadFields("%j",pypad.ESCAPE_NONE))
print(' length(): %u / ' % update.padField(pypad.TYPE_NOW,pypad.FIELD_LENGTH)+update.resolvePadFields("%h",pypad.ESCAPE_NONE))
print(' length()[secs]: N/A / '+update.resolvePadFields("%v",pypad.ESCAPE_NONE))
try:
print(' year(): %u / ' % update.padField(pypad.TYPE_NOW,pypad.FIELD_YEAR)+update.resolvePadFields("%y",pypad.ESCAPE_NONE))
except TypeError:
@ -104,6 +105,7 @@ def ProcessPad(update):
print(' cartNumber(): %u / ' % update.padField(pypad.TYPE_NEXT,pypad.FIELD_CART_NUMBER)+update.resolvePadFields("%N",pypad.ESCAPE_NONE))
print(' cutNumber(): %u / ' % update.padField(pypad.TYPE_NEXT,pypad.FIELD_CUT_NUMBER)+update.resolvePadFields("%J",pypad.ESCAPE_NONE))
print(' length(): %u / ' % update.padField(pypad.TYPE_NEXT,pypad.FIELD_LENGTH)+update.resolvePadFields("%H",pypad.ESCAPE_NONE))
print(' length()[secs]: N/A / '+update.resolvePadFields("%V",pypad.ESCAPE_NONE))
try:
print(' year(): %u / ' % update.padField(pypad.TYPE_NEXT,pypad.FIELD_YEAR)+update.resolvePadFields("%Y",pypad.ESCAPE_NONE))
except TypeError: