Permalink
Browse files

update pyjd bootstrap

  • Loading branch information...
1 parent a3e5f04 commit 51efc7bbd5d3ed9e6aab95e3b258020aa47cbe3c C Anthony Risinger committed Sep 3, 2012
Showing with 9 additions and 5 deletions.
  1. +5 −3 pyjd/__init__.py.in
  2. +4 −2 pyjs/runners/__init__.py
View
@@ -1,9 +1,11 @@
import sys
import os
-import pyjd
from pyjs.runners import RunnerManager
+#TODO: very ugly to self-import and setattr(self) ... remove ASAP!
+import pyjd
+
pyjdversion = %r
pyjdinitpth = %r
@@ -16,9 +18,9 @@ for key, value in _manager._conf.iteritems():
_manager.set_runner()
+#TODO: perm delete ASAP unless someone claims use; disable for now
+#sys.path = [os.path.join(pyjdinitpth, 'pygtkweb', 'library')] + sys.path
sys.path += [os.path.join(pyjdinitpth, 'library')]
-#TODO: this looks useless ...
-sys.path = [os.path.join(pyjdinitpth, 'pygtkweb', 'library')] + sys.path
add_setup_callback = _manager.add_setup_listener
View
@@ -5,6 +5,7 @@
logging.getLogger(__name__).setLevel(logging.DEBUG)
logger = logging.getLogger(__name__)
+from pprint import pformat
from os import path
import ConfigParser
@@ -17,6 +18,7 @@ class RunnerManager(object):
}
_conf = {
+ 'home': path.join(path.expanduser('~'), '.pyjd'),
'runner': _platforms.get(sys.platform, _platforms[None]),
'is_desktop': True,
'native_dnd': True,
@@ -30,15 +32,15 @@ def __init__(self):
self._conf = self._conf.copy()
self._listeners = []
- def set_conf(self, rc=path.join(path.expanduser('~'), '.pyjd', 'pyjdrc')):
+ def set_conf(self, rc=path.join(_conf['home'], 'pyjdrc')):
conf = self._conf
cf = ConfigParser.ConfigParser()
cf.read(rc)
if cf.has_section('gui'):
conf.update(dict(cf.items('gui')))
conf.setdefault('engine', conf['runner'])
conf['runner'] = conf['engine']
- logger.info('conf: %s', conf)
+ logger.info('conf:\n%s', pformat(conf.items()))
def set_runner(self, runner=None):
if runner is None:

0 comments on commit 51efc7b

Please sign in to comment.