]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
added some newlines to extract and jslexer to stay consistent with the rest of the...
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 14 Jun 2008 19:00:35 +0000 (19:00 +0000)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 14 Jun 2008 19:00:35 +0000 (19:00 +0000)
babel/messages/extract.py
babel/messages/jslexer.py

index 4914c172ef57bf50ec5f5fd042d89a5a32cb7dfb..1a1862e1ad3ec4737400a294e1973de0e28b48a9 100644 (file)
@@ -66,6 +66,7 @@ def _strip_comment_tags(comments, tags):
         return line
     comments[:] = map(_strip, comments)
 
+
 def extract_from_dir(dirname=os.getcwd(), method_map=DEFAULT_MAPPING,
                      options_map=None, keywords=DEFAULT_KEYWORDS,
                      comment_tags=(), callback=None, strip_comment_tags=False):
@@ -171,6 +172,7 @@ def extract_from_dir(dirname=os.getcwd(), method_map=DEFAULT_MAPPING,
                         yield filename, lineno, message, comments
                     break
 
+
 def extract_from_file(method, filename, keywords=DEFAULT_KEYWORDS,
                       comment_tags=(), options=None, strip_comment_tags=False):
     """Extract messages from a specific file.
@@ -200,6 +202,7 @@ def extract_from_file(method, filename, keywords=DEFAULT_KEYWORDS,
     finally:
         fileobj.close()
 
+
 def extract(method, fileobj, keywords=DEFAULT_KEYWORDS, comment_tags=(),
             options=None, strip_comment_tags=False):
     """Extract messages from the given file-like object using the specified
@@ -319,12 +322,14 @@ def extract(method, fileobj, keywords=DEFAULT_KEYWORDS, comment_tags=(),
 
         yield lineno, messages, comments
 
+
 def extract_nothing(fileobj, keywords, comment_tags, options):
     """Pseudo extractor that does not actually extract anything, but simply
     returns an empty list.
     """
     return []
 
+
 def extract_python(fileobj, keywords, comment_tags, options):
     """Extract messages from Python source code.
 
@@ -429,6 +434,7 @@ def extract_python(fileobj, keywords, comment_tags, options):
         elif tok == NAME and value in keywords:
             funcname = value
 
+
 def extract_javascript(fileobj, keywords, comment_tags, options):
     """Extract messages from JavaScript source code.
 
index a5f44361730b24314ed4006ecaa941a16a0f1d61..9c666f0bc40c250f612ef45c03783f3972d9a2e3 100644 (file)
@@ -58,6 +58,7 @@ uni_escape_re = re.compile(r'[a-fA-F0-9]{1,4}')
 class TokenError(ValueError):
     """Raised if the tokenizer stumbled upon invalid tokens."""
 
+
 class Token(tuple):
     """Represents a token as returned by `tokenize`."""
     __slots__ = ()
@@ -69,6 +70,7 @@ class Token(tuple):
     value = property(itemgetter(1))
     lineno = property(itemgetter(2))
 
+
 def indicates_division(token):
     """A helper function that helps the tokenizer to decide if the current
     token may be followed by a division operator.
@@ -77,6 +79,7 @@ def indicates_division(token):
         return token.value in (')', ']', '}', '++', '--')
     return token.type in ('name', 'number', 'string', 'regexp')
 
+
 def unquote_string(string):
     """Unquote a string with JavaScript rules.  The string has to start with
     string delimiters (``'`` or ``"``.)
@@ -134,6 +137,7 @@ def unquote_string(string):
 
     return u''.join(result)
 
+
 def tokenize(source):
     """Tokenize a JavaScript source.