~udienz/blankon/lang-o-matic

« back to all changes in this revision

Viewing changes to import

  • Committer: Martin Pitt
  • Date: 2010-08-18 11:25:49 UTC
  • Revision ID: martin.pitt@canonical.com-20100818112549-m7wjmt4kp9hkhvwv
import: add --no-classes mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    optparser.add_option('-s', '--no-static', action='store_false',
49
49
            dest='static', default=True, 
50
50
            help='Disable inclusion of static translations (GNOME help)')
 
51
    optparser.add_option('--no-classes', action='store_false',
 
52
            dest='classes', default=True, 
 
53
            help='Disable splitting by classes (GNOME/KDE/common)')
51
54
 
52
55
    (opts, args) = optparser.parse_args()
53
56
 
152
155
    locales. (LP #422760, #335307)
153
156
    '''
154
157
    try:
155
 
        if domain:
 
158
        if domain and classifier:
156
159
            cls = classifier.classify_domain(domain)
157
160
        else:
158
161
            cls = ''
391
394
    map_file = os.path.join(content_dir, 'mapping.txt')
392
395
    if not os.path.exists(map_file):
393
396
        raise Exception, 'Archive does not contain a domain map file (mapping.txt)'
394
 
    classifier = pkg_classify.PackageClassificator(release, map_file,
395
 
            options.mirror)
 
397
    if options.classes:
 
398
        classifier = pkg_classify.PackageClassificator(release, map_file,
 
399
                options.mirror)
 
400
    else:
 
401
        classifier = None
396
402
    os.unlink(map_file)
397
403
 
398
404
    # Process every .po file