예제 #1
0
    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
예제 #2
0
    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')
예제 #3
0
파일: gchart.py 프로젝트: aeslaughter/moose
 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
예제 #4
0
파일: mdx_mathjax.py 프로젝트: nunb/MaTiSSe
 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
0
    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)
예제 #6
0
    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}
예제 #7
0
    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
0
    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
0
  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
0
    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
0
    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)
예제 #12
0
    def __init__(self, pattern, index, generator, remove_var_sel, alt, title,
                 options, md):
        """Initialize."""

        self._set_index(index)
        self.markdown = md
        self.unicode_alt = alt in UNICODE_ALT
        self.encoded_alt = alt == UNICODE_ENTITY
        self.remove_var_sel = remove_var_sel
        self.title = title if title in VALID_TITLE else NO_TITLE
        self.generator = generator
        self.options = options
        Pattern.__init__(self, pattern)
예제 #13
0
    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.")
예제 #14
0
파일: emoji.py 프로젝트: PwnArt1st/dotfiles
    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)
예제 #15
0
    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)
예제 #16
0
    def __init__(self, media_dir=None, root=None, **kwargs):
        MooseCommonExtension.__init__(self)
        Pattern.__init__(self, self.RE, **kwargs)

        self._root = os.path.join(root, media_dir)

        # The default settings
        self._settings = {
            'alt': None,
            'caption': None,
            'width': None,
            'height': None,
            'float': None,
            'align': 'left'
        }
예제 #17
0
    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
        self._settings['repo_link'] = True
        self._settings['label'] = True
        self._settings['language'] = 'text'
        self._settings['strip-extra-newlines'] = False
        self._settings['prefix'] = ''
        self._settings['suffix'] = ''
        self._settings['indent'] = 0
예제 #18
0
    def __init__(self,
                 pattern,
                 md,
                 user,
                 repo,
                 provider,
                 labels,
                 external=False):
        """Initialize."""

        self.user = user
        self.repo = repo
        self.labels = labels
        self.provider = provider
        self.external = external
        Pattern.__init__(self, pattern, md)
예제 #19
0
    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}
예제 #20
0
    def __init__(self, regex, yaml=None, syntax=None, **kwargs):
        MooseCommonExtension.__init__(self)
        Pattern.__init__(self, regex, **kwargs)

        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."
            )
예제 #21
0
  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'] }
예제 #22
0
  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'] }
예제 #23
0
    def __init__(self, pattern, language=None, repo=None, root=None, **kwargs):
        Pattern.__init__(self, pattern, **kwargs)

        # Set the language
        self._language = language

        # The root/repo settings
        self._root = root
        self._repo = repo

        # The default settings
        self._settings = {
            'strip_header': True,
            'repo_link': True,
            'label': True,
            'method': True,
            'block': True,
            'overflow-y': 'scroll',
            'max-height': '500px',
            'strip-extra-newlines': False
        }
예제 #24
0
    def __init__(self, pattern, language=None, repo=None, root=None, **kwargs):
        Pattern.__init__(self, pattern, **kwargs)

        # Set the language
        self._language = language

        # The root/repo settings
        self._root = root
        self._repo = repo

        # The default settings
        self._settings = {
            'strip_header': True,
            'repo_link': True,
            'label': True,
            'method': True,
            'block': True,
            'strip-extra-newlines': False
        }

        # Applying overflow/max-height CSS to <div> and <code> causes multiple scroll bars
        self._invalid_css = {'div': ['overflow-y', 'overflow-x', 'max-height']}
 def __init__(self):
     Pattern.__init__(self, '')
예제 #26
0
 def __init__(self, pattern, project, md=None):
     self.project = project
     Pattern.__init__(self, pattern, md=md)
예제 #27
0
 def __init__(self, markdown_instance=None, database=None, **kwargs):
     MooseMarkdownCommon.__init__(self, **kwargs)
     Pattern.__init__(self, self.RE, markdown_instance)
     self._database = database
예제 #28
0
파일: app_syntax.py 프로젝트: ssatpat/moose
 def __init__(self, regex, markdown_instance=None, syntax=None, **kwargs):
     MooseMarkdownCommon.__init__(self, **kwargs)
     Pattern.__init__(self, regex, markdown_instance)
     self._syntax = syntax
     self.__cache = dict()
예제 #29
0
 def __init__(self, markdown_instance=None, **kwargs):
     MooseCommonExtension.__init__(self, **kwargs)
     Pattern.__init__(self, self.RE, markdown_instance)
예제 #30
0
파일: devel.py 프로젝트: mangerij/moose
    def __init__(self, markdown_instance=None, **kwargs):
        MooseMarkdownCommon.__init__(self, **kwargs)
        Pattern.__init__(self, self.RE, markdown_instance)

        # Load the yaml data containing package information
        self.package = MooseDocs.yaml_load(kwargs.pop('package_file'))
예제 #31
0
    def __init__(self, pattern, md):
        """Initialize."""

        Pattern.__init__(self, pattern)
        self.markdown = md
        self.get_hl_settings = False
예제 #32
0
파일: refs.py 프로젝트: zachmprince/moose
 def __init__(self, markdown_instance=None, **kwargs):
     MooseMarkdownCommon.__init__(self, **kwargs)
     Pattern.__init__(self, self.RE, markdown_instance)
예제 #33
0
 def __init__(self, pattern, configs):
     Pattern.__init__(self, pattern)
예제 #34
0
 def __init__(self, pattern, markdown_instance=None, oembed_consumer=None):
     Pattern.__init__(self, pattern, markdown_instance)
     self.consumer = oembed_consumer
 def __init__(self):
     Pattern.__init__(self, r'(%{2})(?P<contents>.+?)\2')
예제 #36
0
 def __init__(self):
     Pattern.__init__(self, r'(?P<word>\S{81,})')
 def __init__(self):
     Pattern.__init__(self, r'(>{2})(?P<comment_id>\d+)')
예제 #38
0
 def __init__(self):
     Pattern.__init__(self, r'(?<!\w)\@(?P<u>[a-zA-Z0-9\-]+)')
예제 #39
0
 def __init__(self, pattern, md):
     Pattern.__init__(self, pattern)
     self.md = md
예제 #40
0
 def __init__(self):
     Pattern.__init__(self, ur'(?<!\w|\/)\u0005?#(?P<p>[a-zA-Z]+)(?:[/.](?P<c>\d+))?')
예제 #41
0
    def __init__(self, pattern, md):
        """Initialize."""

        Pattern.__init__(self, pattern)
        self.markdown = md
예제 #42
0
파일: mdx_gist.py 프로젝트: AN6U5/nikola
 def __init__(self, pattern, configs):
     Pattern.__init__(self, pattern)
예제 #43
0
파일: app_syntax.py 프로젝트: ssatpat/moose
 def __init__(self, markdown_instance=None, syntax=None, **kwargs):
     MooseMarkdownCommon.__init__(self, **kwargs)
     Pattern.__init__(self, self.RE, markdown_instance)
     self._syntax = syntax
     self._install = kwargs.get('install')
예제 #44
0
 def __init__(self, pattern, tag: str = "canvas", attrs={}, text=""):
     Pattern.__init__(self, pattern)
     self.tag = tag
     self.attrs = attrs
     self.text = text
예제 #45
0
 def __init__(self):
     Pattern.__init__(self, ur'(?<![-\w]|/)\u0005?(?<=\()?/(?P<c>\d+)(?=[.,;:?!)]|(?:\s|$))')
예제 #46
0
 def __init__(self, markdown_instance=None, repo=None, **kwargs):
     MooseMarkdownCommon.__init__(self, **kwargs)
     Pattern.__init__(self, self.RE, markdown_instance)
     self._repo = repo
예제 #47
0
    def __init__(self, **kwargs):
        MooseCommonExtension.__init__(self)
        Pattern.__init__(self, self.RE, **kwargs)

        # We have a strict width set that can not be disturbed
        self._invalid_css = {'div': ['width']}
예제 #48
0
 def __init__(self):
     Pattern.__init__(self, ur'(?P<url>(?P<proto>\w+)://(?:[\w\.\-%\:]*\@)?(?P<host>[\w\.\-%]+)(?::(?P<port>\d+))?(?P<path>(?:/[^\s\?\u0002\u0003]*)*)(?P<qs>\?[^#\s\u0002\u0003]*)?(?:#(?P<hash>\S+))?)')
예제 #49
0
 def __init__(self, pattern, configs):
     """Initialize the pattern."""
     Pattern.__init__(self, pattern)
 def __init__(self, pattern, markdown_instance=None, oembed_consumer=None):
     Pattern.__init__(self, pattern, markdown_instance)
     self.consumer = oembed_consumer
예제 #51
0
파일: refs.py 프로젝트: zachmprince/moose
 def __init__(self, *args, **kwargs): #pylint: disable=unused-argument
     Pattern.__init__(self, self.RE, *args)
예제 #52
0
 def __init__(self, pattern, configs):
     """Initialize pattern."""
     Pattern.__init__(self, pattern)
예제 #53
0
 def __init__(self, pattern, tag, attrs):
     Pattern.__init__(self, pattern)
     self.tag = tag
     self.attrs = attrs
예제 #54
0
    def __init__(self, pattern):
        """Intialize."""

        Pattern.__init__(self, pattern)