コード例 #1
0
ファイル: standalone.py プロジェクト: bartoreebbo/calibre
def create_option_parser():
    parser = opts_to_parser('%prog '+ _(
'''[options] [path to library folder ...]

Start the calibre content server. The calibre content server
exposes your calibre libraries over the internet. You can specify
the path to the library folders as arguments to %prog. If you do
not specify any paths, the library last opened (if any) in the main calibre
program will be used.
'''
    ))
    parser.add_option(
        '-l', '--library', dest='libraries', action='append', default=[],
        help=_('Path to a calibre library folder. Can be specified multiple'
               ' times to serve multiple libraries'))
    parser.add_option(
        '--log', default=None,
        help=_('Path to log file for server log'))
    parser.add_option('--daemonize', default=False, action='store_true',
        help=_('Run process in background as a daemon. No effect on Windows.'))
    parser.add_option('--pidfile', default=None,
        help=_('Write process PID to the specified file'))
    parser.add_option(
        '--auto-reload', default=False, action='store_true',
        help=_('Automatically reload server when source code changes. Useful'
               ' for development. You should also specify a small value for the'
               ' shutdown timeout.'))

    return parser
コード例 #2
0
ファイル: standalone.py プロジェクト: Britlantine/calibre
def create_option_parser():
    parser=opts_to_parser('%prog '+ _(
'''[options] [path to library folder ...]

Start the calibre content server. The calibre content server
exposes your calibre libraries over the internet. You can specify
the path to the library folders as arguments to %prog. If you do
not specify any paths, the library last opened (if any) in the main calibre
program will be used.
'''
    ))
    parser.add_option(
        '--log', default=None,
        help=_('Path to log file for server log. This log contains server information and errors, not access logs. By default it is written to stdout.'))
    parser.add_option(
        '--access-log', default=None,
        help=_('Path to the access log file. This log contains information'
               ' about clients connecting to the server and making requests. By'
               ' default no access logging is done.'))
    parser.add_option('--daemonize', default=False, action='store_true',
        help=_('Run process in background as a daemon. No effect on Windows.'))
    parser.add_option('--pidfile', default=None,
        help=_('Write process PID to the specified file'))
    parser.add_option(
        '--auto-reload', default=False, action='store_true',
        help=_('Automatically reload server when source code changes. Useful'
               ' for development. You should also specify a small value for the'
               ' shutdown timeout.'))
    parser.add_option(
        '--manage-users', default=False, action='store_true',
        help=_('Manage the database of users allowed to connect to this server.'
               ' See also the %s option.') % '--userdb')

    return parser
コード例 #3
0
ファイル: standalone.py プロジェクト: nospy/calibre
def create_option_parser():
    parser = opts_to_parser(
        "%prog "
        + _(
            """[options] [path to library folder ...]

Start the calibre content server. The calibre content server
exposes your calibre libraries over the internet. You can specify
the path to the library folders as arguments to %prog. If you do
not specify any paths, the library last opened (if any) in the main calibre
program will be used.
"""
        )
    )
    parser.add_option("--log", default=None, help=_("Path to log file for server log"))
    parser.add_option(
        "--daemonize",
        default=False,
        action="store_true",
        help=_("Run process in background as a daemon. No effect on Windows."),
    )
    parser.add_option("--pidfile", default=None, help=_("Write process PID to the specified file"))
    parser.add_option(
        "--auto-reload",
        default=False,
        action="store_true",
        help=_(
            "Automatically reload server when source code changes. Useful"
            " for development. You should also specify a small value for the"
            " shutdown timeout."
        ),
    )
    parser.add_option(
        "--manage-users",
        default=False,
        action="store_true",
        help=_("Manage the database of users allowed to connect to this server." " See also the %s option.")
        % "--userdb",
    )

    return parser
コード例 #4
0
ファイル: standalone.py プロジェクト: artbycrunk/calibre
def create_option_parser():
    parser = opts_to_parser(
        '%prog ' + _(
            '''[options] [path to library folder...]

Start the calibre Content server. The calibre Content server exposes your
calibre libraries over the internet. You can specify the path to the library
folders as arguments to %prog. If you do not specify any paths, all the
libraries that the main calibre program knows about will be used.
'''))
    parser.add_option(
        '--log',
        default=None,
        help=_(
            'Path to log file for server log. This log contains server information and errors, not access logs. By default it is written to stdout.'
        ))
    parser.add_option(
        '--access-log',
        default=None,
        help=_(
            'Path to the access log file. This log contains information'
            ' about clients connecting to the server and making requests. By'
            ' default no access logging is done.'))
    parser.add_option(
        '--custom-list-template', help=_(
            'Path to a JSON file containing a template for the custom book list mode.'
            ' The easiest way to create such a template file is to go to Preferences->'
            ' Sharing over the net-> Book list template in calibre, create the'
            ' template and export it.'
    ))
    if not iswindows and not isosx:
        # Does not work on macOS because if we fork() we cannot connect to Core
        # Serives which is needed by the QApplication() constructor, which in
        # turn is needed by ensure_app()
        parser.add_option(
            '--daemonize',
            default=False,
            action='store_true',
            help=_('Run process in background as a daemon (Linux only).'))
    parser.add_option(
        '--pidfile', default=None, help=_('Write process PID to the specified file'))
    parser.add_option(
        '--auto-reload',
        default=False,
        action='store_true',
        help=_(
            'Automatically reload server when source code changes. Useful'
            ' for development. You should also specify a small value for the'
            ' shutdown timeout.'))
    parser.add_option(
        '--manage-users',
        default=False,
        action='store_true',
        help=_(
            'Manage the database of users allowed to connect to this server.'
            ' See also the %s option.') % '--userdb')
    parser.get_option('--userdb').help = _(
        'Path to the user database to use for authentication. The database'
        ' is a SQLite file. To create it use {0}. You can read more'
        ' about managing users at: {1}'
    ).format(
        '--manage-users',
        localize_user_manual_link(
            'https://manual.calibre-ebook.com/server.html#managing-user-accounts-from-the-command-line-only'
        ))

    return parser
コード例 #5
0
ファイル: standalone.py プロジェクト: PERCE-NEIGE/Calibribook
def create_option_parser():
    parser = opts_to_parser('%prog ' +
                            _('''[options] [path to library folder...]

Start the calibre Content server. The calibre Content server exposes your
calibre libraries over the internet. You can specify the path to the library
folders as arguments to %prog. If you do not specify any paths, all the
libraries that the main calibre program knows about will be used.
'''))
    parser.add_option(
        '--log',
        default=None,
        help=
        _('Path to log file for server log. This log contains server information and errors, not access logs. By default it is written to stdout.'
          ))
    parser.add_option(
        '--access-log',
        default=None,
        help=_(
            'Path to the access log file. This log contains information'
            ' about clients connecting to the server and making requests. By'
            ' default no access logging is done.'))
    parser.add_option(
        '--custom-list-template',
        help=
        _('Path to a JSON file containing a template for the custom book list mode.'
          ' The easiest way to create such a template file is to go to Preferences->'
          ' Sharing over the net-> Book list template in calibre, create the'
          ' template and export it.'))
    if not iswindows and not isosx:
        # Does not work on macOS because if we fork() we cannot connect to Core
        # Serives which is needed by the QApplication() constructor, which in
        # turn is needed by ensure_app()
        parser.add_option(
            '--daemonize',
            default=False,
            action='store_true',
            help=_('Run process in background as a daemon (Linux only).'))
    parser.add_option('--pidfile',
                      default=None,
                      help=_('Write process PID to the specified file'))
    parser.add_option(
        '--auto-reload',
        default=False,
        action='store_true',
        help=_(
            'Automatically reload server when source code changes. Useful'
            ' for development. You should also specify a small value for the'
            ' shutdown timeout.'))
    parser.add_option(
        '--manage-users',
        default=False,
        action='store_true',
        help=_(
            'Manage the database of users allowed to connect to this server.'
            ' See also the %s option.') % '--userdb')
    parser.get_option('--userdb').help = _(
        'Path to the user database to use for authentication. The database'
        ' is a SQLite file. To create it use {0}. You can read more'
        ' about managing users at: {1}'
    ).format(
        '--manage-users',
        localize_user_manual_link(
            'https://manual.calibre-ebook.com/server.html#managing-user-accounts-from-the-command-line-only'
        ))

    return parser