本文整理汇总了Python中pygments.lexer.Lexer.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Lexer.__init__方法的具体用法?Python Lexer.__init__怎么用?Python Lexer.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygments.lexer.Lexer
的用法示例。
在下文中一共展示了Lexer.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pygments.lexer import Lexer [as 别名]
# 或者: from pygments.lexer.Lexer import __init__ [as 别名]
def __init__(self, **options):
Formatter.__init__(self, **options)
self.docclass = options.get('docclass', 'article')
self.preamble = options.get('preamble', '')
self.linenos = get_bool_opt(options, 'linenos', False)
self.linenostart = abs(get_int_opt(options, 'linenostart', 1))
self.linenostep = abs(get_int_opt(options, 'linenostep', 1))
self.verboptions = options.get('verboptions', '')
self.nobackground = get_bool_opt(options, 'nobackground', False)
self.commandprefix = options.get('commandprefix', 'PY')
self.texcomments = get_bool_opt(options, 'texcomments', False)
self.mathescape = get_bool_opt(options, 'mathescape', False)
self.escapeinside = options.get('escapeinside', '')
if len(self.escapeinside) == 2:
self.left = self.escapeinside[0]
self.right = self.escapeinside[1]
else:
self.escapeinside = ''
self.envname = options.get('envname', u'Verbatim')
self._create_stylesheet()
示例2: __init__
# 需要导入模块: from pygments.lexer import Lexer [as 别名]
# 或者: from pygments.lexer.Lexer import __init__ [as 别名]
def __init__(self, *args, **kwargs):
QWidget.__init__(self, *args, **kwargs)
self.request = None
self.setLayout(QVBoxLayout())
self.layout().setSpacing(0)
self.layout().setContentsMargins(0, 0, 0, 0)
self.infotable = QTableWidget()
self.infotable.setColumnCount(2)
self.infotable.verticalHeader().hide()
self.infotable.horizontalHeader().hide()
self.infotable.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.infotable.verticalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.infotable.horizontalHeader().setStretchLastSection(True)
self.layout().addWidget(self.infotable)
示例3: __init__
# 需要导入模块: from pygments.lexer import Lexer [as 别名]
# 或者: from pygments.lexer.Lexer import __init__ [as 别名]
def __init__(self, **options):
options['tabsize'] = 2
options['encoding'] = 'UTF-8'
Lexer.__init__(self, **options)
示例4: end_row
# 需要导入模块: from pygments.lexer import Lexer [as 别名]
# 或者: from pygments.lexer.Lexer import __init__ [as 别名]
def end_row(self):
self.__init__(prev_tokenizer=self._tokenizer)
示例5: __init__
# 需要导入模块: from pygments.lexer import Lexer [as 别名]
# 或者: from pygments.lexer.Lexer import __init__ [as 别名]
def __init__(self, **options):
self.compress = get_choice_opt(options, 'compress',
['', 'none', 'gz', 'bz2'], '')
Lexer.__init__(self, **options)