home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_1491 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  2.0 KB  |  41 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 sys
  8. import os
  9. from calibre import prints as prints_, preferred_encoding, isbytestring
  10. from calibre.utils.config import Config, ConfigProxy, JSONConfig
  11. from calibre.utils.ipc.launch import Worker
  12. from calibre.constants import __appname__, __version__, iswindows
  13. from calibre.gui2 import error_dialog
  14. POLL_TIMEOUT = 0.01
  15. (preferred_encoding, isbytestring, __appname__, __version__, error_dialog, iswindows)
  16.  
  17. def console_config():
  18.     desc = 'Settings to control the calibre console'
  19.     c = Config('console', desc)
  20.     c.add_opt('theme', default = 'native', help = 'The color theme')
  21.     c.add_opt('scrollback', default = 10000, help = 'Max number of lines to keep in the scrollback buffer')
  22.     return c
  23.  
  24. prefs = ConfigProxy(console_config())
  25. dynamic = JSONConfig('console')
  26.  
  27. def prints(*args, **kwargs):
  28.     kwargs['file'] = sys.__stdout__
  29.     prints_(*args, **kwargs)
  30.  
  31.  
  32. class Process(Worker):
  33.     
  34.     def env(self):
  35.         env = dict(os.environ)
  36.         env.update(self._env)
  37.         return env
  38.  
  39.     env = property(env)
  40.  
  41.