~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to src/calibre/library/catalogs/epub_mobi.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-02-27 07:48:06 UTC
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: package-import@ubuntu.com-20140227074806-64wdebb3ptosxhhx
Tags: upstream-1.25.0+dfsg
ImportĀ upstreamĀ versionĀ 1.25.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
Option = namedtuple('Option', 'option, default, dest, action, help')
23
23
 
24
24
class EPUB_MOBI(CatalogPlugin):
 
25
 
25
26
    'ePub catalog generator'
26
27
 
27
28
    name = 'Catalog_EPUB_MOBI'
122
123
                          "Default: '%default'\n"
123
124
                          "Applies to: AZW3, ePub, MOBI output formats")),
124
125
                   Option('--genre-source-field',
125
 
                          default='Tags',
 
126
                          default=_('Tags'),
126
127
                          dest='genre_source_field',
127
128
                          action=None,
128
129
                          help=_("Source field for Genres section.\n"
149
150
                          default=None,
150
151
                          dest='output_profile',
151
152
                          action=None,
152
 
                          help=_("Specifies the output profile. In some cases, an output profile is required to optimize the catalog for the device.  For example, 'kindle' or 'kindle_dx' creates a structured Table of Contents with Sections and Articles.\n"
 
153
                          help=_("Specifies the output profile. In some cases, an output profile is required to optimize the catalog for the device.  For example, 'kindle' or 'kindle_dx' creates a structured Table of Contents with Sections and Articles.\n"  # noqa
153
154
                          "Default: '%default'\n"
154
155
                          "Applies to: AZW3, ePub, MOBI output formats")),
155
156
                   Option('--prefix-rules',
280
281
        if opts.connected_device['is_device_connected'] and \
281
282
           opts.connected_device['kind'] == 'device':
282
283
            if opts.connected_device['serial']:
283
 
                build_log.append(u" connected_device: '%s' #%s%s " % \
 
284
                build_log.append(u" connected_device: '%s' #%s%s " %
284
285
                    (opts.connected_device['name'],
285
286
                     opts.connected_device['serial'][0:4],
286
287
                     'x' * (len(opts.connected_device['serial']) - 4)))
395
396
 
396
397
        if opts.verbose:
397
398
            log.info(" Begin catalog source generation (%s)" %
398
 
                     str(datetime.timedelta(seconds = int(time.time() - opts.start_time))))
 
399
                     str(datetime.timedelta(seconds=int(time.time() - opts.start_time))))
399
400
 
400
401
        # Launch the Catalog builder
401
402
        catalog = CatalogBuilder(db, opts, self, report_progress=notification)
404
405
            catalog.build_sources()
405
406
            if opts.verbose:
406
407
                log.info(" Completed catalog source generation (%s)\n"  %
407
 
                         str(datetime.timedelta(seconds = int(time.time() - opts.start_time))))
 
408
                         str(datetime.timedelta(seconds=int(time.time() - opts.start_time))))
408
409
        except (AuthorSortMismatchException, EmptyCatalogException), e:
409
410
            log.error(" *** Terminated catalog generation: %s ***" % e)
410
411
        except:
496
497
 
497
498
            if opts.verbose:
498
499
                log.info(" Catalog creation complete (%s)\n" %
499
 
                     str(datetime.timedelta(seconds = int(time.time() - opts.start_time))))
 
500
                     str(datetime.timedelta(seconds=int(time.time() - opts.start_time))))
500
501
 
501
502
        # returns to gui2.actions.catalog:catalog_generated()
502
503
        return catalog.error