Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #16897 -- Fixed some docstrings and help texts for the `makemes…

…sages` management command. Thanks, Simon Meers.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16864 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8f750bf6e57b731a4cc8c710481c16bc95ee1291 1 parent c4cc875
Julien Phalip authored September 21, 2011
21  django/core/management/commands/makemessages.py
@@ -15,16 +15,19 @@
15 15
 
16 16
 def handle_extensions(extensions=('html',)):
17 17
     """
18  
-    organizes multiple extensions that are separated with commas or passed by
19  
-    using --extension/-e multiple times.
  18
+    Organizes multiple extensions that are separated with commas or passed by
  19
+    using --extension/-e multiple times. Note that the .py extension is ignored
  20
+    here because of the way non-*.py files are handled in make_messages() (they
  21
+    are copied to file.ext.py files to trick xgettext to parse them as Python
  22
+    files).
20 23
 
21  
-    for example: running 'django-admin makemessages -e js,txt -e xhtml -a'
22  
-    would result in a extension list: ['.js', '.txt', '.xhtml']
  24
+    For example: running 'django-admin makemessages -e js,txt -e xhtml -a'
  25
+    would result in an extension list: ['.js', '.txt', '.xhtml']
23 26
 
24 27
     >>> handle_extensions(['.html', 'html,js,py,py,py,.py', 'py,.py'])
25  
-    ['.html', '.js']
  28
+    set(['.html', '.js'])
26 29
     >>> handle_extensions(['.html, txt,.tpl'])
27  
-    ['.html', '.tpl', '.txt']
  30
+    set(['.html', '.tpl', '.txt'])
28 31
     """
29 32
     ext_list = []
30 33
     for ext in extensions:
@@ -32,10 +35,6 @@ def handle_extensions(extensions=('html',)):
32 35
     for i, ext in enumerate(ext_list):
33 36
         if not ext.startswith('.'):
34 37
             ext_list[i] = '.%s' % ext_list[i]
35  
-
36  
-    # we don't want *.py files here because of the way non-*.py files
37  
-    # are handled in make_messages() (they are copied to file.ext.py files to
38  
-    # trick xgettext to parse them as Python files)
39 38
     return set([x for x in ext_list if x != '.py'])
40 39
 
41 40
 def _popen(cmd):
@@ -318,7 +317,7 @@ class Command(NoArgsCommand):
318 317
         make_option('--all', '-a', action='store_true', dest='all',
319 318
             default=False, help='Updates the message files for all existing locales.'),
320 319
         make_option('--extension', '-e', dest='extensions',
321  
-            help='The file extension(s) to examine (default: ".html", separate multiple extensions with commas, or use -e multiple times)',
  320
+            help='The file extension(s) to examine (default: "html,txt", or "js" if the domain is "djangojs"). Separate multiple extensions with commas, or use -e multiple times.',
322 321
             action='append'),
323 322
         make_option('--symlinks', '-s', action='store_true', dest='symlinks',
324 323
             default=False, help='Follows symlinks to directories when examining source code and templates for translation strings.'),

0 notes on commit 8f750bf

Please sign in to comment.
Something went wrong with that request. Please try again.