本文整理汇总了Python中markdown.inlinepatterns.Pattern.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Pattern.__init__方法的具体用法?Python Pattern.__init__怎么用?Python Pattern.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类markdown.inlinepatterns.Pattern
的用法示例。
在下文中一共展示了Pattern.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, markdown_instance=None, **kwargs):
MooseMarkdownCommon.__init__(self, **kwargs)
regex = r'^!chart\s+(?P<template>{})(?:$|\s+)(?P<settings>.*)'.format(self.TEMPLATE)
Pattern.__init__(self, regex, markdown_instance)
self._csv = dict() # CSV DataFrame cache
self._count = 0
self._status = None
示例2: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, pattern, wrap, script, md):
"""Initialize."""
self.script = script
self.wrap = wrap[0] + '%s' + wrap[1]
Pattern.__init__(self, pattern)
self.markdown = md
示例3: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, markdown_instance=None, **kwargs):
MooseMarkdownCommon.__init__(self, **kwargs)
Pattern.__init__(self, self.RE, markdown_instance)
# The root/repo settings
self._repo = kwargs.pop('repo')
self._branch = kwargs.pop('branch')
示例4: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__ (self, start_end=None, groups=None):
if start_end is not None:
self.start_end = start_end
if groups is not None:
self.groups = groups
pattern = r'(?<!\\)(%s)(.+?)(?<!\\)(%s)' % (self.start_end)
Pattern.__init__(self, pattern)
示例5: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, markdown_instance=None, **kwargs):
MooseCommonExtension.__init__(self, **kwargs)
Pattern.__init__(self, self.RE, markdown_instance)
# Valid settings for MOOSE specific documentation features
# All other markdown 'attributes' will be treated as HTML
# style settings for the figure tag.
self._settings = {"caption": None}
示例6: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, pattern, md, user, repo, provider, labels):
"""Initialize."""
self.user = user
self.repo = repo
self.labels = labels
self.provider = provider if provider in PROVIDER_INFO else ''
Pattern.__init__(self, pattern, md)
示例7: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, regex, markdown_instance=None, syntax=None, **kwargs):
MooseMarkdownCommon.__init__(self, **kwargs)
Pattern.__init__(self, regex, markdown_instance)
self._syntax = syntax
# Error if the syntax was not supplied
if not isinstance(self._syntax, dict):
LOG.error("A dictionary of MooseApplicationSyntax objects must be supplied.")
示例8: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, root=None, **kwargs):
MooseCommonExtension.__init__(self)
Pattern.__init__(self, self.RE, **kwargs)
self._root = os.path.join(root, 'docs/media')
# Valid settings for MOOS specific documentation features
# All other markdown 'attributes' will be treated as HTML
# style settings
self._settings = {'caption' : None}
示例9: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, markdown_instance=None, **kwargs):
MooseCommonExtension.__init__(self, **kwargs)
Pattern.__init__(self, self.RE, markdown_instance)
# Load the yaml data containing package information
self.package = MooseDocs.yaml_load("packages.yml")
# The default settings
self._settings = {'arch' : None,
'return' : None}
示例10: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, pattern, config):
"""Initialize."""
# Generic setup
self.generic = config.get('generic', False)
wrap = config.get('tex_inline_wrap', ["\\(", "\\)"])
self.wrap = wrap[0] + '%s' + wrap[1]
# Default setup
self.preview = config.get('preview', True)
Pattern.__init__(self, pattern)
示例11: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, regex, markdown_instance=None, yaml=None, syntax=None, **kwargs):
MooseCommonExtension.__init__(self, **kwargs)
Pattern.__init__(self, regex, markdown_instance)
self._yaml = yaml
self._syntax = syntax
# Error if the YAML was not supplied
if not isinstance(self._yaml, utils.MooseYaml):
log.error("The MooseYaml object must be supplied to constructor of MooseObjectClassDescription.")
# Error if the syntax was not supplied
if not isinstance(self._syntax, dict):
log.error("A dictionary of MooseApplicationSyntax objects must be supplied.")
示例12: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, pattern, config, md):
"""Initialize."""
title = config['title']
alt = config['alt']
self._set_index(config["emoji_index"])
self.markdown = md
self.unicode_alt = alt in UNICODE_ALT
self.encoded_alt = alt == UNICODE_ENTITY
self.remove_var_sel = config['remove_variation_selector']
self.title = title if title in VALID_TITLE else NO_TITLE
self.generator = config['emoji_generator']
self.options = config['options']
Pattern.__init__(self, pattern)
示例13: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, regex, config, language=None):
Pattern.__init__(self, regex)
#super(Pattern, self).__init__(regex) # This fails
# Set the language
self._language = language
# The root directory
self._config = config
# The default settings
self._settings = {'strip_header':True,
'repo_link':True,
'label':True,
'overflow-y':'scroll',
'max-height':'500px',
'strip-extra-newlines':False}
示例14: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self, pattern, markdown_instance=None, repo=None, **kwargs):
MooseCommonExtension.__init__(self, **kwargs)
Pattern.__init__(self, pattern, markdown_instance)
# The root/repo settings
self._repo = repo
# The default settings
self._settings = {'strip_header' : True,
'repo_link' : True,
'label' : True,
'method' : True,
'language' : 'text',
'block' : True,
'strip-extra-newlines': False}
# Applying overflow/max-height CSS to <div> and <code> causes multiple scroll bars
# do not let code float, the div will do this for us
self._invalid_css = { 'div' : ['overflow-y', 'overflow-x', 'max-height'], 'code' : ['float'] }
示例15: __init__
# 需要导入模块: from markdown.inlinepatterns import Pattern [as 别名]
# 或者: from markdown.inlinepatterns.Pattern import __init__ [as 别名]
def __init__(self):
Pattern.__init__(self, r'(>{2})(?P<comment_id>\d+)')