tweak init semantics for shell command
This commit is contained in:
parent
3b208904f8
commit
38f796d624
2 changed files with 6 additions and 3 deletions
|
@ -159,10 +159,10 @@ Try '%(name)s help <command>' for more help.""" % self
|
||||||
self.print_help()
|
self.print_help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Basic logging should be established before init()ing.
|
||||||
|
|
||||||
# Use root logger if setting logging flags.
|
# Use root logger if setting logging flags.
|
||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
|
|
||||||
# Basic logging should be established before init()ing.
|
|
||||||
edbob.basic_logging()
|
edbob.basic_logging()
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
log.setLevel(logging.INFO)
|
log.setLevel(logging.INFO)
|
||||||
|
@ -444,7 +444,7 @@ class ShellCommand(Subcommand):
|
||||||
code = ['import edbob']
|
code = ['import edbob']
|
||||||
if edbob.inited:
|
if edbob.inited:
|
||||||
code.append("edbob.init('edbob', %s, shell=True)" %
|
code.append("edbob.init('edbob', %s, shell=True)" %
|
||||||
edbob.config.paths_attempted)
|
edbob.config.paths_loaded)
|
||||||
code.append('from edbob import *')
|
code.append('from edbob import *')
|
||||||
code = '; '.join(code)
|
code = '; '.join(code)
|
||||||
print "edbob v%s launching Python shell...\n" % edbob.__version__
|
print "edbob v%s launching Python shell...\n" % edbob.__version__
|
||||||
|
|
|
@ -229,6 +229,9 @@ class AppConfigParser(ConfigParser.SafeConfigParser):
|
||||||
See :meth:`read()` for more information.
|
See :meth:`read()` for more information.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if path in self.paths_attempted:
|
||||||
|
return
|
||||||
|
|
||||||
self.paths_attempted.append(path)
|
self.paths_attempted.append(path)
|
||||||
log.debug("Reading config file: %s" % path)
|
log.debug("Reading config file: %s" % path)
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue