当前位置: 首页>>代码示例>>Python>>正文


Python ABag.name方法代码示例

本文整理汇总了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()
开发者ID:jeffery9,项目名称:reportlab,代码行数:28,代码来源:paraparser.py

示例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()
开发者ID:JustinVicent,项目名称:mangareader-to-ebook,代码行数:28,代码来源:paraparser.py

示例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()
开发者ID:jeffery9,项目名称:reportlab,代码行数:12,代码来源:paraparser.py

示例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()
开发者ID:JustinVicent,项目名称:mangareader-to-ebook,代码行数:15,代码来源:paraparser.py


注:本文中的reportlab.lib.abag.ABag.name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。