GEP 18: fix bug in List reference determination
svn: r22614
This commit is contained in:
parent
6cde88e22d
commit
ee3350e9d5
@ -69,8 +69,8 @@ class SrcAttributeBase(AttributeRootBase):
|
|||||||
templ = val
|
templ = val
|
||||||
else:
|
else:
|
||||||
# a template not in the predefined list. convert to unknown
|
# a template not in the predefined list. convert to unknown
|
||||||
print ('Unknown Template: Keyerror "', val,
|
print ('Unknown Template: Keyerror:', val,
|
||||||
'"for now UNKNOWN taken.\nDownload required template style!')
|
'For now UNKNOWN is used.\nDownload required template style!')
|
||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
retval = (templ, SrcTemplate.template_description(templ))
|
retval = (templ, SrcTemplate.template_description(templ))
|
||||||
|
@ -431,13 +431,11 @@ class SrcTemplate(object):
|
|||||||
else:
|
else:
|
||||||
#field only present in citation.
|
#field only present in citation.
|
||||||
if lower:
|
if lower:
|
||||||
#store also in normal already value of short, keep None
|
#store also in normal already value of short, keep empty
|
||||||
#for source fields
|
#string for source fields
|
||||||
self.attrmap[key] = (None,
|
self.attrmap[key] = ('', attr.get_value(), attr.get_value())
|
||||||
attr.get_value(), attr.get_value())
|
|
||||||
else:
|
else:
|
||||||
self.attrmap[key] = (None,
|
self.attrmap[key] = ('', attr.get_value(), None)
|
||||||
attr.get_value(), None)
|
|
||||||
if self.date_citation:
|
if self.date_citation:
|
||||||
#we store the date of the citation in attrmap
|
#we store the date of the citation in attrmap
|
||||||
key = SrcAttributeType.DATE
|
key = SrcAttributeType.DATE
|
||||||
@ -455,25 +453,25 @@ class SrcTemplate(object):
|
|||||||
self.refL = self._reference(REF_TYPE_L)
|
self.refL = self._reference(REF_TYPE_L)
|
||||||
return self.refL
|
return self.refL
|
||||||
|
|
||||||
def reference_S(self, attr_list=None):
|
def reference_S(self, attr_list=None, attr_list_citation=None, date_citation=None):
|
||||||
"""
|
"""
|
||||||
Return the short reference based on the passed source attribute list
|
Return the short reference based on the passed source attribute list
|
||||||
If attr_list is None, same list as before is used.
|
If attr_list is None, same list as before is used.
|
||||||
"""
|
"""
|
||||||
if attr_list:
|
if attr_list or attr_list_citation or date_citation:
|
||||||
self.set_attr_list(attr_list)
|
self.set_attr_list(attr_list, attr_list_citation, date_citation)
|
||||||
if self.refS is not None:
|
if self.refS is not None:
|
||||||
return self.refS
|
return self.refS
|
||||||
self.refS = self._reference(REF_TYPE_S)
|
self.refS = self._reference(REF_TYPE_S)
|
||||||
return self.refS
|
return self.refS
|
||||||
|
|
||||||
def reference_F(self, attr_list=None):
|
def reference_F(self, attr_list=None, attr_list_citation=None, date_citation=None):
|
||||||
"""
|
"""
|
||||||
Return the full reference based on the passed source attribute list
|
Return the full reference based on the passed source attribute list
|
||||||
If attr_list is None, same list as before is used.
|
If attr_list is None, same list as before is used.
|
||||||
"""
|
"""
|
||||||
if attr_list:
|
if attr_list or attr_list_citation or date_citation:
|
||||||
self.set_attr_list(attr_list)
|
self.set_attr_list(attr_list, attr_list_citation, date_citation)
|
||||||
if self.refF is not None:
|
if self.refF is not None:
|
||||||
return self.refF
|
return self.refF
|
||||||
self.refF = self._reference(REF_TYPE_F)
|
self.refF = self._reference(REF_TYPE_F)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user