home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_1369 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  2.7 KB  |  44 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __license__ = 'GPL v3'
  5. __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
  6. __docformat__ = 'restructuredtext en'
  7. import os
  8. from calibre.utils.config import Config, StringConfig, config_dir
  9. listen_on = '0.0.0.0'
  10. log_access_file = os.path.join(config_dir, 'server_access_log.txt')
  11. log_error_file = os.path.join(config_dir, 'server_error_log.txt')
  12.  
  13. def server_config(defaults = None):
  14.     desc = _('Settings to control the calibre content server')
  15.     c = None if defaults is None else StringConfig(defaults, desc)
  16.     c.add_opt('port', [
  17.         '-p',
  18.         '--port'], default = 8080, help = _('The port on which to listen. Default is %default'))
  19.     c.add_opt('timeout', [
  20.         '-t',
  21.         '--timeout'], default = 120, help = _('The server timeout in seconds. Default is %default'))
  22.     c.add_opt('thread_pool', [
  23.         '--thread-pool'], default = 30, help = _('The max number of worker threads to use. Default is %default'))
  24.     c.add_opt('password', [
  25.         '--password'], default = None, help = _('Set a password to restrict access. By default access is unrestricted.'))
  26.     c.add_opt('username', [
  27.         '--username'], default = 'calibre', help = _('Username for access. By default, it is: %default'))
  28.     c.add_opt('develop', [
  29.         '--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.")
  30.     c.add_opt('max_cover', [
  31.         '--max-cover'], default = '600x800', help = _('The maximum size for displayed covers. Default is %default.'))
  32.     c.add_opt('max_opds_items', [
  33.         '--max-opds-items'], default = 30, help = _('The maximum number of matches to return per OPDS query. This affects Stanza, WordPlayer, etc. integration.'))
  34.     c.add_opt('max_opds_ungrouped_items', [
  35.         '--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.'))
  36.     return c
  37.  
  38.  
  39. def main():
  40.     main = main
  41.     import calibre.library.server.main
  42.     return main()
  43.  
  44.