remove expanduser

svn: r6218
This commit is contained in:
Don Allingham 2006-03-29 04:11:17 +00:00
parent e2100245d4
commit b2ea3cfaec
6 changed files with 21 additions and 11 deletions

View File

@ -1,3 +1,10 @@
2006-03-28 Don Allingham <don@gramps-project.org>
* 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 <pez4brian@users.sourceforge.net> 2006-03-28 Brian Matherly <pez4brian@users.sourceforge.net>
* src/PluginUtils/_Options.py: Use filename instead of URI for XML parser * src/PluginUtils/_Options.py: Use filename instead of URI for XML parser
* src/PluginUtils/_Report.py: Use filename instead of URI for XML parser * src/PluginUtils/_Report.py: Use filename instead of URI for XML parser

View File

@ -1648,11 +1648,11 @@ try:
parser = make_parser() parser = make_parser()
gspath = const.template_dir gspath = const.template_dir
parser.setContentHandler(TemplateParser(_template_map,gspath)) parser.setContentHandler(TemplateParser(_template_map,gspath))
parser.parse("%s/templates.xml" % gspath) parser.parse("file://" + os.path.join(gspath,"templates.xml"))
parser = make_parser() parser = make_parser()
gspath = os.path.expanduser("~/.gramps/templates") gspath = os.path.join(const.home_dir,"templates")
parser.setContentHandler(TemplateParser(_template_map,gspath)) 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): except (IOError,OSError,SAXParseException):
pass pass
@ -1766,7 +1766,7 @@ class CommandLineReport:
"Any string -- may use keyword substitutions") "Any string -- may use keyword substitutions")
self.option_class.handler.output = self.options_dict['of'] 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: if self.category == CATEGORY_TEXT:
for item in _PluginMgr.textdoc_list: for item in _PluginMgr.textdoc_list:
@ -1811,7 +1811,7 @@ class CommandLineReport:
self.options_help['papero'].append(False) self.options_help['papero'].append(False)
self.template_name = self.options_dict['template'] 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): if self.category in (CATEGORY_TEXT,CATEGORY_DRAW):
default_style = BaseDoc.StyleSheet() default_style = BaseDoc.StyleSheet()

View File

@ -37,16 +37,17 @@ try:
except: except:
use_lock = False use_lock = False
import const
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Constants # Constants
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
GNOME_FILENAME = "~/.recently-used" GNOME_FILENAME = os.path.join(const.user_home,".recently-used")
MAX_GNOME_ITEMS = 500 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 MAX_GRAMPS_ITEMS = 10
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -79,9 +79,11 @@ no_gconf = False
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
if os.environ.has_key('HOME'): 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: else:
home_dir = os.path.join(os.environ['USERPROFILE'],'gramps') user_home = os.environ['USERPROFILE']
home_dir = os.path.join(user_home,'gramps')
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -159,7 +159,7 @@ class Calendar(Report.Report):
def get_holidays(self, year, country = "US"): def get_holidays(self, year, country = "US"):
""" Looks in multiple places for holidays.xml files """ """ Looks in multiple places for holidays.xml files """
locations = [const.pluginsDir, locations = [const.pluginsDir,
os.path.expanduser("~/.gramps/plugins")] os.path.join(const.home_dir,"plugins")]
holiday_file = 'holidays.xml' holiday_file = 'holidays.xml'
for dir in locations: for dir in locations:
holiday_full_path = os.path.join(dir, holiday_file) holiday_full_path = os.path.join(dir, holiday_file)

View File

@ -923,7 +923,7 @@ class GraphVizGraphics(Report.Report):
self.doc = options_class.get_document() self.doc = options_class.get_document()
self.user_output = options_class.get_output() 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_format = self.options_class.handler.options_dict['gvof']
self.the_font = self.options_class.handler.options_dict['font'] self.the_font = self.options_class.handler.options_dict['font']