本文整理匯總了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)