Example #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
     ]))
Example #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
     ]))
Example #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
Example #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
Example #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
Example #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
Example #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
Example #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')
Example #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')
Example #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
Example #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
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
    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;',
        }
Example #19
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.n = get_int_opt(options, 'n', 0)
Example #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]))
Example #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)
Example #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)
Example #23
0
 def __init__(self, options, filename = 'stdin' ):
     Filter.__init__(self)
     self.filename = filename
     self.options = options
     self.conversions = 0 # counts converted vars
Example #24
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.n = get_int_opt(options, 'n', 0)
Example #25
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
Example #26
0
 def __init__(self, srcdir, depsearchpath):
     self.srcdir = srcdir
     self.dependencypath = depsearchpath
     Filter.__init__(self)
Example #27
0
 def __init__(self, **options):
   Filter.__init__(self, **options)
   self.tabsize = get_int_opt(options, 'tabsize', 4)
   self.repl = re.compile(r'^\t+')
Example #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)
Example #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]
Example #30
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.prefix = options.get("prefix")
Example #31
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
Example #32
0
 def __init__(self, srcdir, depsearchpath):
     self.srcdir = srcdir
     self.dependencypath = depsearchpath
     Filter.__init__(self)
Example #33
0
 def __init__(self, app, **options):
     self.app = app
     Filter.__init__(self, **options)
Example #34
0
 def __init__(self, **options):
     Filter.__init__(self, **options)
     self.prev_tag1 = None
     self.prev_tag2 = None