Ticket #1182: make-messages-exclude-apps.diff
File make-messages-exclude-apps.diff, 1.6 KB (added by , 19 years ago) |
---|
-
django_src/django/bin/make-messages.py
24 24 print "you want to enable i18n for your project or application." 25 25 sys.exit(1) 26 26 27 (opts, args) = getopt.getopt(sys.argv[1:], 'l:d:va ')27 (opts, args) = getopt.getopt(sys.argv[1:], 'l:d:vap') 28 28 29 29 lang = None 30 30 domain = 'django' 31 31 verbose = False 32 32 all = False 33 include_apps = False 33 34 34 35 for o, v in opts: 35 36 if o == '-l': … … 40 41 verbose = True 41 42 elif o == '-a': 42 43 all = True 44 elif o == '-p': 45 include_apps = True 43 46 44 47 if domain not in ('django', 'djangojs'): 45 48 print "currently make-messages.py only supports domains 'django' and 'djangojs'" 46 49 sys.exit(1) 47 50 if (lang is None and not all) or domain is None: 48 print "usage: make-messages.py -l <language>" 49 print " or: make-messages.py -a" 51 print "usage: make-messages.py -l <language> [-d <domain>] [-v] [-p]" 52 print " or: make-messages.py -a [-d <domain>] [-v] [-p]" 53 print "-v enables verbose output" 54 print "-p includes the ./apps tree (excluded by default)" 50 55 sys.exit(1) 51 56 52 57 languages = [] … … 117 122 if thefile != file: 118 123 os.unlink(os.path.join(dirpath, thefile)) 119 124 125 if not include_apps and dirpath == '.': 126 try: dirnames.remove('apps') 127 except ValueError: pass 128 120 129 if os.path.exists(potfile): 121 130 (stdin, stdout, stderr) = os.popen3('msguniq %s' % potfile, 'b') 122 131 msgs = stdout.read()