Пример #1
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     tags = get_list_opt(options, 'codetags',
                         ['XXX', 'TODO', 'BUG', 'NOTE'])
     self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([
         re.escape(tag) for tag in tags if tag
     ]))
Пример #2
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     tags = get_list_opt(options, 'codetags',
                         ['XXX', 'TODO', 'BUG', 'NOTE'])
     self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([
         re.escape(tag) for tag in tags if tag
     ]))
Пример #3
0
 def __init__(self, options):
     Filter.__init__(self)
     self.options = options
     self.js_locals = []
     self.vars = []
     self.errors = []
     self.br_count = 0  # count { braces
Пример #4
0
    def __init__(self, **options):
        Filter.__init__(self, **options)

        self.method_name = options["method_name"]
        #self.descriptor = options["descriptor"]

        self.present = False
        self.get_desc = True  #False
Пример #5
0
    def __init__(self, **options):
        Filter.__init__(self, **options)

        self.method_name = options["method_name"]
        #self.descriptor = options["descriptor"]

        self.present = False
        self.get_desc = True  # False
Пример #6
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.names = set(get_list_opt(options, 'names', []))
     tokentype = options.get('tokentype')
     if tokentype:
         self.tokentype = string_to_tokentype(tokentype)
     else:
         self.tokentype = Name.Function
Пример #7
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.names = set(get_list_opt(options, 'names', []))
     tokentype = options.get('tokentype')
     if tokentype:
         self.tokentype = string_to_tokentype(tokentype)
     else:
         self.tokentype = Name.Function
Пример #8
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.exception = options.get('excclass', ErrorToken)
     try:
         # issubclass() will raise TypeError if first argument is not a class
         if not issubclass(self.exception, Exception):
             raise TypeError
     except TypeError:
         raise OptionError('excclass option is not an exception class')
Пример #9
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.exception = options.get('excclass', ErrorToken)
     try:
         # issubclass() will raise TypeError if first argument is not a class
         if not issubclass(self.exception, Exception):
             raise TypeError
     except TypeError:
         raise OptionError('excclass option is not an exception class')
Пример #10
0
    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
Пример #11
0
    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
Пример #12
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     for name, default in {'spaces': u'·', 'tabs': u'»', 'newlines': u'¶'}.items():
         opt = options.get(name, False)
         if isinstance(opt, basestring) 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)
Пример #13
0
 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)
Пример #14
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     for name, default in list({'spaces': '·', 'tabs': '»', 'newlines': '¶'}.items()):
         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)
Пример #15
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     for name, default in list({"spaces": "·", "tabs": "»", "newlines": "¶"}.items()):
         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)
Пример #16
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     for name, default in [('spaces', '·'), ('tabs', '»'),
                           ('newlines', '¶')]:
         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)
 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)
Пример #18
0
    def __init__(self, **options):
        Filter.__init__(self, **options)
        self.annotations = options["annotations"]

        # Make sure the annotations are sorted by line, then char- we then only
        # Need to check the first annotation, not all of them.
        self.annotations.sort(
            key=lambda anno: (anno["line"], anno["range"][0])
            )

        self.escape_html = {
            ord('&'): '&',
            ord('<'): '&lt;',
            ord('>'): '&gt;',
            ord('"'): '&quot;',
            ord("'"): '&#39;',
        }
Пример #19
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.n = get_int_opt(options, 'n', 0)
Пример #20
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     tags = get_list_opt(options, "codetags", ["XXX", "TODO", "BUG", "NOTE"])
     self.tag_re = re.compile(r"\b(%s)\b" % "|".join([re.escape(tag) for tag in tags if tag]))
Пример #21
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     case = get_choice_opt(options, "case", ["lower", "upper", "capitalize"], "lower")
     self.convert = getattr(text_type, case)
Пример #22
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     case = get_choice_opt(options, 'case', ['lower', 'upper', 'capitalize'], 'lower')
     self.convert = getattr(str, case)
Пример #23
0
 def __init__(self, options, filename = 'stdin' ):
     Filter.__init__(self)
     self.filename = filename
     self.options = options
     self.conversions = 0 # counts converted vars
Пример #24
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.n = get_int_opt(options, 'n', 0)
Пример #25
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
Пример #26
0
 def __init__(self, srcdir, depsearchpath):
     self.srcdir = srcdir
     self.dependencypath = depsearchpath
     Filter.__init__(self)
Пример #27
0
 def __init__(self, **options):
   Filter.__init__(self, **options)
   self.tabsize = get_int_opt(options, 'tabsize', 4)
   self.repl = re.compile(r'^\t+')
Пример #28
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     case = get_choice_opt(options, 'case',
                           ['lower', 'upper', 'capitalize'], 'lower')
     self.convert = getattr(str, case)
Пример #29
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     lang = get_choice_opt(options, 'lang', ['isabelle', 'latex'],
                           'isabelle')
     self.symbols = self.lang_map[lang]
Пример #30
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.prefix = options.get("prefix")
Пример #31
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
Пример #32
0
 def __init__(self, srcdir, depsearchpath):
     self.srcdir = srcdir
     self.dependencypath = depsearchpath
     Filter.__init__(self)
Пример #33
0
 def __init__(self, app, **options):
     self.app = app
     Filter.__init__(self, **options)
Пример #34
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.prev_tag1 = None
     self.prev_tag2 = None