Fix get_dbname method when called from CLI and remove redundant code
svn: r15953
This commit is contained in:
parent
b733d9e306
commit
280db79074
@ -187,7 +187,6 @@ class CLIManager(object):
|
|||||||
"""
|
"""
|
||||||
def __init__(self, dbstate, setloader):
|
def __init__(self, dbstate, setloader):
|
||||||
self.dbstate = dbstate
|
self.dbstate = dbstate
|
||||||
self.db_name = None
|
|
||||||
if setloader:
|
if setloader:
|
||||||
self.db_loader = CLIDbLoader(self.dbstate)
|
self.db_loader = CLIDbLoader(self.dbstate)
|
||||||
else:
|
else:
|
||||||
@ -250,7 +249,7 @@ class CLIManager(object):
|
|||||||
if filename[-1] == os.path.sep:
|
if filename[-1] == os.path.sep:
|
||||||
filename = filename[:-1]
|
filename = filename[:-1]
|
||||||
name = os.path.basename(filename)
|
name = os.path.basename(filename)
|
||||||
self.db_name = title
|
self.dbstate.db.db_name = title
|
||||||
if title:
|
if title:
|
||||||
name = title
|
name = title
|
||||||
|
|
||||||
|
@ -844,17 +844,6 @@ class ViewManager(CLIManager):
|
|||||||
if not self.dbstate.db.is_open() and show_manager:
|
if not self.dbstate.db.is_open() and show_manager:
|
||||||
self.__open_activate(None)
|
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):
|
def do_load_plugins(self):
|
||||||
"""
|
"""
|
||||||
Loads the plugins at initialization time. The plugin status window is
|
Loads the plugins at initialization time. The plugin status window is
|
||||||
@ -1251,7 +1240,6 @@ class ViewManager(CLIManager):
|
|||||||
if filename[-1] == os.path.sep:
|
if filename[-1] == os.path.sep:
|
||||||
filename = filename[:-1]
|
filename = filename[:-1]
|
||||||
name = os.path.basename(filename)
|
name = os.path.basename(filename)
|
||||||
self.dbstate.db.db_name = title
|
|
||||||
if title:
|
if title:
|
||||||
name = title
|
name = title
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user