tweak init semantics for shell command

This commit is contained in:
Lance Edgar 2012-07-09 05:40:55 -05:00
parent 3b208904f8
commit 38f796d624
2 changed files with 6 additions and 3 deletions

View file

@ -159,10 +159,10 @@ Try '%(name)s help <command>' for more help.""" % self
self.print_help()
return
# Basic logging should be established before init()ing.
# Use root logger if setting logging flags.
log = logging.getLogger()
# Basic logging should be established before init()ing.
edbob.basic_logging()
if args.verbose:
log.setLevel(logging.INFO)
@ -444,7 +444,7 @@ class ShellCommand(Subcommand):
code = ['import edbob']
if edbob.inited:
code.append("edbob.init('edbob', %s, shell=True)" %
edbob.config.paths_attempted)
edbob.config.paths_loaded)
code.append('from edbob import *')
code = '; '.join(code)
print "edbob v%s launching Python shell...\n" % edbob.__version__

View file

@ -229,6 +229,9 @@ class AppConfigParser(ConfigParser.SafeConfigParser):
See :meth:`read()` for more information.
"""
if path in self.paths_attempted:
return
self.paths_attempted.append(path)
log.debug("Reading config file: %s" % path)
if not os.path.exists(path):