Fix get_dbname method when called from CLI and remove redundant code

svn: r15953
This commit is contained in:
Nick Hall 2010-10-04 20:41:16 +00:00
parent b733d9e306
commit 280db79074
2 changed files with 1 additions and 14 deletions

View File

@ -187,7 +187,6 @@ class CLIManager(object):
"""
def __init__(self, dbstate, setloader):
self.dbstate = dbstate
self.db_name = None
if setloader:
self.db_loader = CLIDbLoader(self.dbstate)
else:
@ -250,7 +249,7 @@ class CLIManager(object):
if filename[-1] == os.path.sep:
filename = filename[:-1]
name = os.path.basename(filename)
self.db_name = title
self.dbstate.db.db_name = title
if title:
name = title

View File

@ -844,17 +844,6 @@ class ViewManager(CLIManager):
if not self.dbstate.db.is_open() and show_manager:
self.__open_activate(None)
def post_load_newdb(self, filename, filetype):
# Attempt to figure out the database title
path = os.path.join(filename, "name.txt")
try:
ifile = open(path)
title = ifile.readline().strip()
ifile.close()
except:
title = filename
self._post_load_newdb(filename, filetype, title)
def do_load_plugins(self):
"""
Loads the plugins at initialization time. The plugin status window is
@ -1251,7 +1240,6 @@ class ViewManager(CLIManager):
if filename[-1] == os.path.sep:
filename = filename[:-1]
name = os.path.basename(filename)
self.dbstate.db.db_name = title
if title:
name = title