diff --git a/ChangeLog b/ChangeLog index d6de6ca5f..aaaef688b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-03-28 Don Allingham + * src/plugins/Calendar.py: remove expanduser + * src/plugins/GrampViz.py: remove expanduser + * src/const.py.in: fix home dir. + * src/PluginsUtils.py: remove expanduser + * src/RecentFiles.py: remove expanduser + 2006-03-28 Brian Matherly * src/PluginUtils/_Options.py: Use filename instead of URI for XML parser * src/PluginUtils/_Report.py: Use filename instead of URI for XML parser diff --git a/src/PluginUtils/_Report.py b/src/PluginUtils/_Report.py index 11623654f..17eac0c0d 100644 --- a/src/PluginUtils/_Report.py +++ b/src/PluginUtils/_Report.py @@ -1648,11 +1648,11 @@ try: parser = make_parser() gspath = const.template_dir parser.setContentHandler(TemplateParser(_template_map,gspath)) - parser.parse("%s/templates.xml" % gspath) + parser.parse("file://" + os.path.join(gspath,"templates.xml")) parser = make_parser() - gspath = os.path.expanduser("~/.gramps/templates") + gspath = os.path.join(const.home_dir,"templates") parser.setContentHandler(TemplateParser(_template_map,gspath)) - parser.parse("%s/templates.xml" % gspath) + parser.parse("file://" + os.path.join(gspath,"templates.xml")) except (IOError,OSError,SAXParseException): pass @@ -1766,7 +1766,7 @@ class CommandLineReport: "Any string -- may use keyword substitutions") self.option_class.handler.output = self.options_dict['of'] - self.options_help['of'].append(os.path.expanduser("~/whatever_name")) + self.options_help['of'].append(os.path.join(const.user_home,"whatever_name")) if self.category == CATEGORY_TEXT: for item in _PluginMgr.textdoc_list: @@ -1811,7 +1811,7 @@ class CommandLineReport: self.options_help['papero'].append(False) self.template_name = self.options_dict['template'] - self.options_help['template'].append(os.path.expanduser("~/whatever_name")) + self.options_help['template'].append(os.path.join(const.user_home,"whatever_name")) if self.category in (CATEGORY_TEXT,CATEGORY_DRAW): default_style = BaseDoc.StyleSheet() diff --git a/src/RecentFiles.py b/src/RecentFiles.py index 5f957bae4..d62f3892a 100644 --- a/src/RecentFiles.py +++ b/src/RecentFiles.py @@ -37,16 +37,17 @@ try: except: use_lock = False +import const #------------------------------------------------------------------------- # # Constants # #------------------------------------------------------------------------- -GNOME_FILENAME = "~/.recently-used" +GNOME_FILENAME = os.path.join(const.user_home,".recently-used") MAX_GNOME_ITEMS = 500 -GRAMPS_FILENAME = "~/.gramps/recent-files.xml" +GRAMPS_FILENAME = os.path.join(const.home_dir,"recent-files.xml") MAX_GRAMPS_ITEMS = 10 #------------------------------------------------------------------------- diff --git a/src/const.py.in b/src/const.py.in index ba6382b29..91a1d1493 100644 --- a/src/const.py.in +++ b/src/const.py.in @@ -79,9 +79,11 @@ no_gconf = False # #------------------------------------------------------------------------- if os.environ.has_key('HOME'): - home_dir = os.path.join(os.environ['HOME'],'.gramps') + user_home = os.environ['HOME'] + home_dir = os.path.join(user_home,'.gramps') else: - home_dir = os.path.join(os.environ['USERPROFILE'],'gramps') + user_home = os.environ['USERPROFILE'] + home_dir = os.path.join(user_home,'gramps') #------------------------------------------------------------------------- # diff --git a/src/plugins/Calendar.py b/src/plugins/Calendar.py index d4fdee216..102af603c 100644 --- a/src/plugins/Calendar.py +++ b/src/plugins/Calendar.py @@ -159,7 +159,7 @@ class Calendar(Report.Report): def get_holidays(self, year, country = "US"): """ Looks in multiple places for holidays.xml files """ locations = [const.pluginsDir, - os.path.expanduser("~/.gramps/plugins")] + os.path.join(const.home_dir,"plugins")] holiday_file = 'holidays.xml' for dir in locations: holiday_full_path = os.path.join(dir, holiday_file) diff --git a/src/plugins/GraphViz.py b/src/plugins/GraphViz.py index 89b2e0df4..1fb03db4c 100644 --- a/src/plugins/GraphViz.py +++ b/src/plugins/GraphViz.py @@ -923,7 +923,7 @@ class GraphVizGraphics(Report.Report): self.doc = options_class.get_document() self.user_output = options_class.get_output() - self.junk_output = os.path.expanduser("~/.gramps/junk") + self.junk_output = os.path.join(const.home_dir,"junk") self.the_format = self.options_class.handler.options_dict['gvof'] self.the_font = self.options_class.handler.options_dict['font']