From 280db79074eb78cf91eb7cfe4aa3f91616696558 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Mon, 4 Oct 2010 20:41:16 +0000 Subject: [PATCH] Fix get_dbname method when called from CLI and remove redundant code svn: r15953 --- src/cli/grampscli.py | 3 +-- src/gui/viewmanager.py | 12 ------------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/cli/grampscli.py b/src/cli/grampscli.py index edb7b8d99..558530ca9 100644 --- a/src/cli/grampscli.py +++ b/src/cli/grampscli.py @@ -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 diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index f6b36911e..e9bdb26c3 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -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