Commits

Anonymous committed 4504c4b

[svn] Make check.

Comments (0)

Files changed (10)

 
 check:
 	@$(PYTHON) scripts/check_sources.py -i apidocs -i pygments/lexers/_mapping.py \
-		   -i docs/build
+		   -i docs/build -i pygments/formatters/_mapping.py
 
 clean: clean-pyc
 	rm -f codetags.html

pygments/cmdline.py

         info = []
         for cls in get_all_formatters():
             doc = docstring_headline(cls)
-            tup = (', '.join(cls.aliases) + ':', doc,
-                   cls.filenames and '(filenames ' + ', '.join(cls.filenames) + ')' or '')
+            tup = (', '.join(cls.aliases) + ':', doc, cls.filenames and
+                   '(filenames ' + ', '.join(cls.filenames) + ')' or '')
             info.append(tup)
         info.sort()
         for i in info:
         print
         print "Styles:"
         print "~~~~~~~"
-        
+
         for name in get_all_styles():
             cls = get_style_by_name(name)
             print "* " + name + ':'
-            print "    %s" % docstring_headline(cls) 
+            print "    %s" % docstring_headline(cls)
 
 
 def main(args):
     Main command line entry point.
     """
     # pylint: disable-msg=R0911,R0912,R0915
-    
+
     usage = USAGE % ((args[0],) * 5)
 
     try:

pygments/formatters/__init__.py

 
 __all__ = ['get_formatter_by_name', 'get_formatter_for_filename',
            'get_all_formatters'] + [cls.__name__ for cls in FORMATTERS]
-           
+
 
 _formatter_alias_cache = {}
 _formatter_filename_cache = []

pygments/formatters/html.py

 
     **Subclassing the HTML formatter**
 
-    *New in Pygments 0.7.* 
+    *New in Pygments 0.7.*
 
     The HTML formatter is now built in a way that allows easy subclassing, thus
     customizing the output HTML code. The `format()` method calls
                     print >>sys.stderr, 'Note: Cannot determine output file name, ' \
                           'using current directory as base for the CSS file name'
                     cssfilename = self.cssfile
-            # write CSS file 
+            # write CSS file
             try:
                 cf = open(cssfilename, "w")
                 cf.write(CSSFILE_TEMPLATE %
             if t:
                 lncount += 1
             dummyoutfile.write(line)
-        
+
         fl = self.linenostart
         mw = len(str(lncount + fl - 1))
         sp = self.linenospecial
                 line = cspan + parts[-1]
                 lspan = cspan
             # else we neither have to open a new span nor set lspan
-                
+
         if line:
             yield 1, line + (lspan and '</span>') + lsep
 

pygments/formatters/other.py

     name = 'Text only'
     aliases = ['text', 'null']
     filenames = ['*.txt']
-    
+
     def format(self, tokensource, outfile):
         enc = self.encoding
         for ttype, value in tokensource:

pygments/lexers/compiled.py

 
     *New in Pygments 0.7.*
     """
-    
+
     name = 'OCaml'
     aliases = ['ocaml']
     filenames = ['*.ml', '*.mli']
             (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),
 
             (r"[^\W\d][\w']*", Name),
-            
+
             (r'\d[\d_]*', Number.Integer),
             (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex),
             (r'0[oO][0-7][0-7_]*', Number.Oct),
             (r'0[bB][01][01_]*', Number),
             (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float),
-            
+
             (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'",
              String.Char),
             (r"'.'", String.Char),
             (r"'", Keyword), # a stray quote is another syntax element
-            
+
             (r'"', String.Double, 'string'),
 
             (r'[~?][a-z][\w\']*:', Name.Variable),

tests/test_basic_api.py

             tokens = list(lx.get_tokens(text))
             roundtext = ''.join([t[1] for t in tokens])
             self.assertEquals(roundtext, text,
-                              "lexer roundtrip with %s filter failed" % x) 
+                              "lexer roundtrip with %s filter failed" % x)
 
 
 class FormattersTest(unittest.TestCase):

tests/test_cmdline.py

         c, o, e = run_cmdline("-L")
         self.assertEquals(c, 0)
         self.assert_("Lexers" in o and "Formatters" in o and
-                     "Filters" in o and "Styles" in o) 
+                     "Filters" in o and "Styles" in o)
         c, o, e = run_cmdline("-L", "lexer")
         self.assertEquals(c, 0)
-        self.assert_("Lexers" in o and not "Formatters" in o)
+        self.assert_("Lexers" in o and "Formatters" not in o)
         c, o, e = run_cmdline("-L", "lexers")
         self.assertEquals(c, 0)
 

tests/test_html_formatter.py

 from pygments.formatters import HtmlFormatter, NullFormatter
 from pygments.formatters.html import escape_html
 
-tokensource = list(PythonLexer().get_tokens(file(os.path.join(testdir, testfile)).read()))
+tokensource = list(PythonLexer().get_tokens(file(
+    os.path.join(testdir, testfile)).read()))
 
 class HtmlFormatterTest(unittest.TestCase):
     def test_correct_output(self):
                         dict(linenos=True),
                         dict(linenos=True, full=True),
                         dict(linenos=True, full=True, noclasses=True)]:
-        
+
             outfile = StringIO.StringIO()
             fmt = HtmlFormatter(**optdict)
             fmt.format(tokensource, outfile)

tests/test_latex_formatter.py

 class LatexFormatterTest(unittest.TestCase):
 
     def test_valid_output(self):
-        tokensource = list(PythonLexer().get_tokens(file(os.path.join(testdir, testfile)).read()))
+        tokensource = list(PythonLexer().get_tokens(file(
+            os.path.join(testdir, testfile)).read()))
         fmt = LatexFormatter(full=True)
 
         handle, pathname = tempfile.mkstemp('.tex')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.