コード例 #1
0
 def _config(cls):
     name = cls._config_base_name()
     c = Config('device_drivers_%s' % name, _('settings for device drivers'))
     c.add_opt('format_map', default=cls.FORMATS,
             help=_('Ordered list of formats the device will accept'))
     c.add_opt('use_subdirs', default=cls.SUPPORTS_SUB_DIRS_DEFAULT,
             help=_('Place files in sub-directories if the device supports them'))
     c.add_opt('read_metadata', default=True,
             help=_('Read metadata from files on device'))
     c.add_opt('use_author_sort', default=False,
             help=_('Use author sort instead of author'))
     c.add_opt('save_template', default=cls._default_save_template(),
             help=_('Template to control how books are saved'))
     c.add_opt('extra_customization',
             default=cls.EXTRA_CUSTOMIZATION_DEFAULT,
             help=_('Extra customization'))
     return c
コード例 #2
0
ファイル: __init__.py プロジェクト: 089git/calibre
def server_config(defaults=None):
    desc=_('Settings to control the calibre content server')
    c = Config('server', desc) if defaults is None else StringConfig(defaults, desc)

    c.add_opt('port', ['-p', '--port'], default=8080,
              help=_('The port on which to listen. Default is %default'))
    c.add_opt('timeout', ['-t', '--timeout'], default=120,
              help=_('The server timeout in seconds. Default is %default'))
    c.add_opt('thread_pool', ['--thread-pool'], default=30,
              help=_('The max number of worker threads to use. Default is %default'))
    c.add_opt('password', ['--password'], default=None,
              help=_('Set a password to restrict access. By default access is unrestricted.'))
    c.add_opt('username', ['--username'], default='calibre',
              help=_('Username for access. By default, it is: %default'))
    c.add_opt('develop', ['--develop'], default=False,
              help='Development mode. Server automatically restarts on file changes and serves code files (html, css, js) from the file system instead of calibre\'s resource system.')
    c.add_opt('max_cover', ['--max-cover'], default='600x800',
              help=_('The maximum size for displayed covers. Default is %default.'))
    c.add_opt('max_opds_items', ['--max-opds-items'], default=30,
            help=_('The maximum number of matches to return per OPDS query. '
            'This affects Stanza, WordPlayer, etc. integration.'))
    c.add_opt('max_opds_ungrouped_items', ['--max-opds-ungrouped-items'],
            default=100,
            help=_('Group items in categories such as author/tags '
                'by first letter when there are more than this number '
                'of items. Default: %default. Set to a large number '
                'to disable grouping.'))
    c.add_opt('url_prefix', ['--url-prefix'], default='',
              help=_('Prefix to prepend to all URLs. Useful for reverse'
                  'proxying to this server from Apache/nginx/etc.'))

    return c
コード例 #3
0
ファイル: __init__.py プロジェクト: siebert/calibre
def server_config(defaults=None):
    desc = _('Settings to control the calibre content server')
    c = Config('server', desc) if defaults is None else StringConfig(
        defaults, desc)

    c.add_opt('port', ['-p', '--port'],
              default=8080,
              help=_('The port on which to listen. Default is %default'))
    c.add_opt('timeout', ['-t', '--timeout'],
              default=120,
              help=_('The server timeout in seconds. Default is %default'))
    c.add_opt(
        'thread_pool', ['--thread-pool'],
        default=30,
        help=_('The max number of worker threads to use. Default is %default'))
    c.add_opt(
        'password', ['--password'],
        default=None,
        help=
        _('Set a password to restrict access. By default access is unrestricted.'
          ))
    c.add_opt('username', ['--username'],
              default='calibre',
              help=_('Username for access. By default, it is: %default'))
    c.add_opt(
        'develop', ['--develop'],
        default=False,
        help=
        'Development mode. Server automatically restarts on file changes and serves code files (html, css, js) from the file system instead of calibre\'s resource system.'
    )
    c.add_opt(
        'max_cover', ['--max-cover'],
        default='600x800',
        help=_('The maximum size for displayed covers. Default is %default.'))
    c.add_opt('max_opds_items', ['--max-opds-items'],
              default=30,
              help=_('The maximum number of matches to return per OPDS query. '
                     'This affects Stanza, WordPlayer, etc. integration.'))
    c.add_opt('max_opds_ungrouped_items', ['--max-opds-ungrouped-items'],
              default=100,
              help=_('Group items in categories such as author/tags '
                     'by first letter when there are more than this number '
                     'of items. Default: %default. Set to a large number '
                     'to disable grouping.'))
    c.add_opt('url_prefix', ['--url-prefix'],
              default='',
              help=_('Prefix to prepend to all URLs. Useful for reverse'
                     'proxying to this server from Apache/nginx/etc.'))

    return c
コード例 #4
0
ファイル: deviceconfig.py プロジェクト: AEliu/calibre
 def _config(cls):
     name = cls._config_base_name()
     c = Config('device_drivers_%s' % name, _('settings for device drivers'))
     c.add_opt('format_map', default=cls.FORMATS,
             help=_('Ordered list of formats the device will accept'))
     c.add_opt('use_subdirs', default=cls.SUPPORTS_SUB_DIRS_DEFAULT,
             help=_('Place files in sub-directories if the device supports them'))
     c.add_opt('read_metadata', default=True,
             help=_('Read metadata from files on device'))
     c.add_opt('use_author_sort', default=False,
             help=_('Use author sort instead of author'))
     c.add_opt('save_template', default=cls._default_save_template(),
             help=_('Template to control how books are saved'))
     c.add_opt('extra_customization',
             default=cls.EXTRA_CUSTOMIZATION_DEFAULT,
             help=_('Extra customization'))
     return c
コード例 #5
0
ファイル: deviceconfig.py プロジェクト: Cykooz/calibre
 def _config(cls):
     name = cls._config_base_name()
     c = Config('device_drivers_%s' % name, _('settings for device drivers'))
     c.add_opt('format_map', default=cls.FORMATS,
             help=_('Ordered list of formats the device will accept'))
     c.add_opt('use_subdirs', default=cls.SUPPORTS_SUB_DIRS_DEFAULT,
             help=_('Place files in sub directories if the device supports them'))
     c.add_opt('asciiize', default=True,
             help=_('Normally, calibre will convert all non English characters into English equivalents '
                    'for the file names. '
                    'WARNING: If you turn this off, you may experience errors when '
                    'saving, depending on how well the filesystem you are saving '
                    'to supports unicode.'))
     c.add_opt('read_metadata', default=True,
             help=_('Read metadata from files on device'))
     c.add_opt('use_author_sort', default=False,
             help=_('Use author sort instead of author'))
     c.add_opt('save_template', default=cls._default_save_template(),
             help=_('Template to control how books are saved'))
     c.add_opt('extra_customization',
             default=cls.EXTRA_CUSTOMIZATION_DEFAULT,
             help=_('Extra customization'))
     return c
コード例 #6
0
ファイル: deviceconfig.py プロジェクト: Cykooz/calibre
 def _config(cls):
     name = cls._config_base_name()
     c = Config('device_drivers_%s' % name,
                _('settings for device drivers'))
     c.add_opt('format_map',
               default=cls.FORMATS,
               help=_('Ordered list of formats the device will accept'))
     c.add_opt(
         'use_subdirs',
         default=cls.SUPPORTS_SUB_DIRS_DEFAULT,
         help=_(
             'Place files in sub directories if the device supports them'))
     c.add_opt(
         'asciiize',
         default=True,
         help=
         _('Normally, calibre will convert all non English characters into English equivalents '
           'for the file names. '
           'WARNING: If you turn this off, you may experience errors when '
           'saving, depending on how well the filesystem you are saving '
           'to supports unicode.'))
     c.add_opt('read_metadata',
               default=True,
               help=_('Read metadata from files on device'))
     c.add_opt('use_author_sort',
               default=False,
               help=_('Use author sort instead of author'))
     c.add_opt('save_template',
               default=cls._default_save_template(),
               help=_('Template to control how books are saved'))
     c.add_opt('extra_customization',
               default=cls.EXTRA_CUSTOMIZATION_DEFAULT,
               help=_('Extra customization'))
     return c