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


Python Filter.__init__方法代码示例

本文整理汇总了Python中pygments.filter.Filter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Filter.__init__方法的具体用法?Python Filter.__init__怎么用?Python Filter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pygments.filter.Filter的用法示例。


在下文中一共展示了Filter.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
 def __init__(self, **options):
     Filter.__init__(self, **options)
     tags = get_list_opt(options, 'codetags',
                         ['XXX', 'TODO', 'BUG', 'NOTE'])
     self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([
         re.escape(tag) for tag in tags if tag
     ]))
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:9,代码来源:__init__.py

示例2: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
 def __init__(self, options):
     Filter.__init__(self)
     self.options = options
     self.js_locals = []
     self.vars = []
     self.errors = []
     self.br_count = 0  # count { braces
开发者ID:thoka,项目名称:check_JS,代码行数:9,代码来源:check_JS.py

示例3: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
    def __init__(self, **options):
        Filter.__init__(self, **options)

        self.method_name = options["method_name"]
        #self.descriptor = options["descriptor"]

        self.present = False
        self.get_desc = True  #False
开发者ID:4nh51rk,项目名称:androguard,代码行数:10,代码来源:decompiler.py

示例4: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
    def __init__(self, **options):
        """
        Filter Method Code from a whole class

        :param options:
        """
        Filter.__init__(self, **options)

        self.method_name = options["method_name"]
        # self.descriptor = options["descriptor"]

        self.present = False
        self.get_desc = True  # False
开发者ID:chubbymaggie,项目名称:androguard,代码行数:15,代码来源:decompiler.py

示例5: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
 def __init__(self, **options):
     Filter.__init__(self, **options)
     for name, default in list({"spaces": "·", "tabs": "»", "newlines": "¶"}.items()):
         opt = options.get(name, False)
         if isinstance(opt, str) and len(opt) == 1:
             setattr(self, name, opt)
         else:
             setattr(self, name, (opt and default or ""))
     tabsize = get_int_opt(options, "tabsize", 8)
     if self.tabs:
         self.tabs += " " * (tabsize - 1)
     if self.newlines:
         self.newlines += "\n"
     self.wstt = get_bool_opt(options, "wstokentype", True)
开发者ID:testmana2,项目名称:eric,代码行数:16,代码来源:__init__.py

示例6: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
 def __init__(self, **options):
     Filter.__init__(self, **options)
     for name, default in [("spaces", u"·"), ("tabs", u"»"), ("newlines", u"¶")]:
         opt = options.get(name, False)
         if isinstance(opt, string_types) and len(opt) == 1:
             setattr(self, name, opt)
         else:
             setattr(self, name, (opt and default or ""))
     tabsize = get_int_opt(options, "tabsize", 8)
     if self.tabs:
         self.tabs += " " * (tabsize - 1)
     if self.newlines:
         self.newlines += "\n"
     self.wstt = get_bool_opt(options, "wstokentype", True)
开发者ID:AlexStef,项目名称:stef-sublime-conf,代码行数:16,代码来源:__init__.py

示例7: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
 def __init__(self, **options):
     Filter.__init__(self, **options)
     for name, default in [('spaces',   u'·'),
                           ('tabs',     u'»'),
                           ('newlines', u'¶')]:
         opt = options.get(name, False)
         if isinstance(opt, string_types) and len(opt) == 1:
             setattr(self, name, opt)
         else:
             setattr(self, name, (opt and default or ''))
     tabsize = get_int_opt(options, 'tabsize', 8)
     if self.tabs:
         self.tabs += ' ' * (tabsize - 1)
     if self.newlines:
         self.newlines += '\n'
     self.wstt = get_bool_opt(options, 'wstokentype', True)
开发者ID:2015E8014661092,项目名称:jinjaysnow.github.io,代码行数:18,代码来源:__init__.py

示例8: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
    def __init__(self, **options):
        Filter.__init__(self, **options)
        self.annotations = options["annotations"]

        # Make sure the annotations are sorted by line, then char- we then only
        # Need to check the first annotation, not all of them.
        self.annotations.sort(
            key=lambda anno: (anno["line"], anno["range"][0])
            )

        self.escape_html = {
            ord('&'): '&',
            ord('<'): '&lt;',
            ord('>'): '&gt;',
            ord('"'): '&quot;',
            ord("'"): '&#39;',
        }
开发者ID:litonico,项目名称:pyg_annotate,代码行数:19,代码来源:annotation_filter.py

示例9: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
 def __init__(self, srcdir, depsearchpath):
     self.srcdir = srcdir
     self.dependencypath = depsearchpath
     Filter.__init__(self)
开发者ID:Pranav1210,项目名称:tctoolkit,代码行数:6,代码来源:depfilter.py

示例10: __init__

# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
 def __init__(self, **options):
   Filter.__init__(self, **options)
   self.tabsize = get_int_opt(options, 'tabsize', 4)
   self.repl = re.compile(r'^\t+')
开发者ID:CatTail,项目名称:Vinergy,代码行数:6,代码来源:filter.py


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