本文整理汇总了Python中pygments.filter.Filter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Filter.__init__方法的具体用法?Python Filter.__init__怎么用?Python Filter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygments.filter.Filter
的用法示例。
在下文中一共展示了Filter.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __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)
示例2: __init__
# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
def __init__(self,
vm,
path_dex2jar="./decompiler/dex2jar/",
bin_dex2jar="dex2jar.sh",
tmp_dir="/tmp/"):
pathtmp = tmp_dir
if not os.path.exists(pathtmp):
os.makedirs(pathtmp)
fd, fdname = tempfile.mkstemp(dir=pathtmp)
with os.fdopen(fd, "w+b") as fd:
fd.write(vm.get_buff())
fd.flush()
compile = Popen([path_dex2jar + bin_dex2jar, fdname],
stdout=PIPE,
stderr=STDOUT)
stdout, stderr = compile.communicate()
os.unlink(fdname)
self.jarfile = fdname + "_dex2jar.jar"
示例3: __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, 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)
示例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
示例5: __init__
# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
def __init__(self, **options):
Filter.__init__(self, **options)
self.prefix = options.get("prefix")
示例6: __init__
# 需要导入模块: from pygments.filter import Filter [as 别名]
# 或者: from pygments.filter.Filter import __init__ [as 别名]
def __init__(self, vm, path_dex2jar="./decompiler/dex2jar/", bin_dex2jar="dex2jar.sh", tmp_dir="/tmp/"):
pathtmp = tmp_dir
if not os.path.exists(pathtmp):
os.makedirs(pathtmp)
fd, fdname = tempfile.mkstemp(dir=pathtmp)
with os.fdopen(fd, "w+b") as fd:
fd.write(vm.get_buff())
fd.flush()
compile = Popen([path_dex2jar + bin_dex2jar, fdname], stdout=PIPE, stderr=STDOUT)
stdout, stderr = compile.communicate()
os.unlink(fdname)
self.jarfile = fdname + "_dex2jar.jar"