本文整理汇总了Python中reportlab.lib.abag.ABag.name方法的典型用法代码示例。如果您正苦于以下问题:Python ABag.name方法的具体用法?Python ABag.name怎么用?Python ABag.name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reportlab.lib.abag.ABag
的用法示例。
在下文中一共展示了ABag.name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start_index
# 需要导入模块: from reportlab.lib.abag import ABag [as 别名]
# 或者: from reportlab.lib.abag.ABag import name [as 别名]
def start_index(self,attr):
attr=self.getAttributes(attr,_indexAttrMap)
defn = ABag()
if 'item' in attr:
label = attr['item']
else:
self._syntax_error('<index> needs at least an item attribute')
if 'name' in attr:
name = attr['name']
else:
name = DEFAULT_INDEX_NAME
format = attr.get('format',None)
if format is not None and format not in ('123','I','i','ABC','abc'):
raise ValueError('index tag format is %r not valid 123 I i ABC or abc' % offset)
offset = attr.get('offset',None)
if offset is not None:
try:
offset = int(offset)
except:
raise ValueError('index tag offset is %r not an int' % offset)
defn.label = encode_label([label,format,offset])
defn.name = name
defn.kind='index'
self._push(cbDefn=defn)
self.handle_data('')
self._pop()
示例2: start_index
# 需要导入模块: from reportlab.lib.abag import ABag [as 别名]
# 或者: from reportlab.lib.abag.ABag import name [as 别名]
def start_index(self, attr):
attr = self.getAttributes(attr, _indexAttrMap)
defn = ABag()
if "item" in attr:
label = attr["item"]
else:
self._syntax_error("<index> needs at least an item attribute")
if "name" in attr:
name = attr["name"]
else:
name = DEFAULT_INDEX_NAME
format = attr.get("format", None)
if format is not None and format not in ("123", "I", "i", "ABC", "abc"):
raise ValueError("index tag format is %r not valid 123 I i ABC or abc" % offset)
offset = attr.get("offset", None)
if offset is not None:
try:
offset = int(offset)
except:
raise ValueError("index tag offset is %r not an int" % offset)
defn.label = base64.encodestring(pickle.dumps((label, format, offset))).strip()
defn.name = name
defn.kind = "index"
self._push(cbDefn=defn)
self.handle_data("")
self._pop()
示例3: start_onDraw
# 需要导入模块: from reportlab.lib.abag import ABag [as 别名]
# 或者: from reportlab.lib.abag.ABag import name [as 别名]
def start_onDraw(self,attr):
defn = ABag()
if 'name' in attr: defn.name = attr['name']
else: self._syntax_error('<onDraw> needs at least a name attribute')
if 'label' in attr: defn.label = attr['label']
defn.kind='onDraw'
self._push(cbDefn=defn)
self.handle_data('')
self._pop()
示例4: start_onDraw
# 需要导入模块: from reportlab.lib.abag import ABag [as 别名]
# 或者: from reportlab.lib.abag.ABag import name [as 别名]
def start_onDraw(self, attr):
defn = ABag()
if "name" in attr:
defn.name = attr["name"]
else:
self._syntax_error("<onDraw> needs at least a name attribute")
if "label" in attr:
defn.label = attr["label"]
defn.kind = "onDraw"
self._push(cbDefn=defn)
self.handle_data("")
self._pop()