2020-02-19 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug with the '%y' metadata wildcard where garbage would
	be returned if a valid year had not been set.
	* Added a 'metadata_wildcard_test' harness.
This commit is contained in:
Fred Gleason
2020-02-19 11:52:40 -05:00
parent 4ccf01f029
commit 1a88bcb999
7 changed files with 157 additions and 2 deletions

View File

@@ -122,7 +122,10 @@ class Update(object):
if isinstance(self.__fields['padUpdate'][stype][sfield],str):
string=string.replace('%'+wildcard,self.escape(self.__fields['padUpdate'][stype][sfield],esc))
else:
string=string.replace('%'+wildcard,str(self.__fields['padUpdate'][stype][sfield]))
if self.__fields['padUpdate'][stype][sfield] is None:
string=string.replace('%'+wildcard,'')
else :
string=string.replace('%'+wildcard,str(self.__fields['padUpdate'][stype][sfield]))
except TypeError:
string=string.replace('%'+wildcard,'')
except KeyError: