remove expanduser

svn: r6219
This commit is contained in:
Don Allingham 2006-03-29 04:24:39 +00:00
parent dcec2c11c9
commit 4c3e96b163
6 changed files with 26 additions and 16 deletions

View File

@ -1,4 +1,7 @@
2006-03-28 Don Allingham <don@gramps-project.org> 2006-03-28 Don Allingham <don@gramps-project.org>
* src/ViewManager.py: remove expanduser
* src/Exporter.py: remove expanduser
* src/plugins/BookReport.py: remove expanduser
* src/plugins/Calendar.py: remove expanduser * src/plugins/Calendar.py: remove expanduser
* src/plugins/GrampViz.py: remove expanduser * src/plugins/GrampViz.py: remove expanduser
* src/const.py.in: fix home dir. * src/const.py.in: fix home dir.

View File

@ -308,10 +308,10 @@ class Exporter:
if len(default_dir)<=1: if len(default_dir)<=1:
default_dir = Config.get_last_import_dir() default_dir = Config.get_last_import_dir()
if len(default_dir)<=1: if len(default_dir)<=1:
default_dir = '~/' default_dir = const.user_home
if ext == 'gramps': if ext == 'gramps':
new_filename = os.path.expanduser(default_dir + 'data.gramps') new_filename = os.path.join(default_dir,'data.gramps')
elif ext == 'burn': elif ext == 'burn':
new_filename = os.path.basename(self.dbstate.db.get_save_path()) new_filename = os.path.basename(self.dbstate.db.get_save_path())
else: else:

View File

@ -110,11 +110,11 @@ def loadConfig():
Load preferences on startup. Not much to do, since all the prefs Load preferences on startup. Not much to do, since all the prefs
are in gconf and can be retrieved any time. are in gconf and can be retrieved any time.
""" """
make_path(os.path.expanduser("~/.gramps")) make_path(const.home_dir)
make_path(os.path.expanduser("~/.gramps/filters")) make_path(os.path.join(const.home_dir,"filters"))
make_path(os.path.expanduser("~/.gramps/plugins")) make_path(os.path.join(const.home_dir,"plugins"))
make_path(os.path.expanduser("~/.gramps/templates")) make_path(os.path.join(const.home_dir,"templates"))
make_path(os.path.expanduser("~/.gramps/thumb")) make_path(os.path.join(const.home_dir,"thumb"))
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -1645,14 +1645,21 @@ class TemplateParser(handler.ContentHandler):
# #
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
try: try:
parser = make_parser()
gspath = const.template_dir gspath = const.template_dir
parser.setContentHandler(TemplateParser(_template_map,gspath)) xmlfile = os.path.join(gspath,"templates.xml")
parser.parse("file://" + os.path.join(gspath,"templates.xml"))
parser = make_parser() if os.path.isfile(xmlfile):
parser = make_parser()
parser.setContentHandler(TemplateParser(_template_map,gspath))
parser.parse(xmlfile)
gspath = os.path.join(const.home_dir,"templates") gspath = os.path.join(const.home_dir,"templates")
parser.setContentHandler(TemplateParser(_template_map,gspath)) xmlfile = os.path.join(gspath,"templates.xml")
parser.parse("file://" + os.path.join(gspath,"templates.xml")) if os.path.isfile(xmlfile):
parser = make_parser()
parser.setContentHandler(TemplateParser(_template_map,gspath))
parser.parse(xmlfile)
except (IOError,OSError,SAXParseException): except (IOError,OSError,SAXParseException):
pass pass

View File

@ -273,10 +273,10 @@ class ViewManager:
def do_load_plugins(self): def do_load_plugins(self):
self.uistate.status_text(_('Loading document formats...')) self.uistate.status_text(_('Loading document formats...'))
error = load_plugins(const.docgenDir) error = load_plugins(const.docgenDir)
error |= load_plugins(os.path.expanduser("~/.gramps/docgen")) error |= load_plugins(os.path.join(const.home_dir,"docgen"))
self.uistate.status_text(_('Loading plugins...')) self.uistate.status_text(_('Loading plugins...'))
error |= load_plugins(const.pluginsDir) error |= load_plugins(const.pluginsDir)
error |= load_plugins(os.path.expanduser("~/.gramps/plugins")) error |= load_plugins(os.path.join(const.home_dir,"plugins"))
if Config.get_pop_plugin_status() and error: if Config.get_pop_plugin_status() and error:
Plugins.PluginStatus(self) Plugins.PluginStatus(self)
self.uistate.push_message(_('Ready')) self.uistate.push_message(_('Ready'))

View File

@ -306,7 +306,7 @@ class BookList:
""" """
self.bookmap = {} self.bookmap = {}
self.file = os.path.expanduser("~/.gramps/" + filename) self.file = os.path.join(const.home_dir,filename)
self.parse() self.parse()
def delete_book(self,name): def delete_book(self,name):