From 4efbaaa16c57a527a479ea97a82b7e67005a5fa1 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 3 Mar 2006 00:17:58 +0000 Subject: [PATCH] update new installation paths svn: r6046 --- ChangeLog | 11 ++++++ src/Assistant.py | 5 ++- src/GrampsDb/_GedcomInfo.py | 2 +- src/ImgManip.py | 2 +- src/ObjectSelector/_FamilyPreviewFrame.py | 8 ++-- src/ObjectSelector/_ObjectSelectorWindow.py | 4 +- src/ObjectSelector/_PersonPreviewFrame.py | 6 +-- src/const.py.in | 41 +++++++++++---------- src/gramps_main.py | 2 +- src/plugins/NavWebPage.py | 4 +- 10 files changed, 49 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11423e8a7..1ca93676f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-03-02 Don Allingham + * src/GrampsDb/_GedcomInfo.py: update to new data path + * src/const.py.in: new data, image path defintions + * src/gramps_main.py: update to new install paths + * src/Assistant.py: update to new install paths + * src/ImgManip.py: update to new install paths + * src/ObjectSelector/_FamilyPreviewFrame.py: update to new install paths + * src/ObjectSelector/_OjbectSelectorWindow.py: update to new install paths + * src/ObjectSelector/_PersonPreviewFrame.py: update to new install paths + * src/plugins/NavWebPage.py: update to new install paths + 2006-03-02 Alex Roitman * src/Config/__init__.py: Add new package. * src/GrampsGconfKeys.py, src/GrampsIniKeys.py, src/GrampsKeys.py: diff --git a/src/Assistant.py b/src/Assistant.py index 771be3aff..d81523d7d 100644 --- a/src/Assistant.py +++ b/src/Assistant.py @@ -26,6 +26,7 @@ # #------------------------------------------------------------------------- from gettext import gettext as _ +import os #------------------------------------------------------------------------- # @@ -48,8 +49,8 @@ import const # Constants # #------------------------------------------------------------------------- -_gramps_png = "%s/images/gramps.png" % const.rootDir -_splash_jpg = "%s/images/splash.jpg" % const.rootDir +_gramps_png = os.path.join(const.image_dir,"gramps.png") +_splash_jpg = os.path.join(const.image_dir,"splash.jpg") _format = '%s' #------------------------------------------------------------------------- diff --git a/src/GrampsDb/_GedcomInfo.py b/src/GrampsDb/_GedcomInfo.py index a06dc9883..9b39f782b 100644 --- a/src/GrampsDb/_GedcomInfo.py +++ b/src/GrampsDb/_GedcomInfo.py @@ -152,7 +152,7 @@ class GedcomInfoDB: self.standard.set_dest("GEDCOM 5.5") try: - filepath = "%s/gedcom.xml" % const.dataDir + filepath = os.path.join(const.data_dir,"gedcom.xml") f = open(filepath.encode('iso8859-1'),"r") except: return diff --git a/src/ImgManip.py b/src/ImgManip.py index a13091d35..930b03a63 100644 --- a/src/ImgManip.py +++ b/src/ImgManip.py @@ -156,7 +156,7 @@ def get_thumbnail_image(path,mtype=None): return GrampsMime.find_mime_type_pixbuf(mtype) else: return gtk.gdk.pixbuf_new_from_file(os.path.join( - const.dataDir,"images/document.png")) + const.data_dir,"document.png")) def get_thumbnail_path(path,mtype=None): filename = _build_thumb_path(path) diff --git a/src/ObjectSelector/_FamilyPreviewFrame.py b/src/ObjectSelector/_FamilyPreviewFrame.py index 2d54d4c42..0ff90840b 100644 --- a/src/ObjectSelector/_FamilyPreviewFrame.py +++ b/src/ObjectSelector/_FamilyPreviewFrame.py @@ -105,16 +105,16 @@ class FamilyPreviewFrame(PreviewFrameBase): image[image_no].set_from_pixbuf(pixbuf) image_no += 1 else: - self._image_l.set_from_file(os.path.join(const.rootDir,"person.svg")) - self._image_r.set_from_file(os.path.join(const.rootDir,"person.svg")) + self._image_l.set_from_file(os.path.join(const.image_dir,"person.svg")) + self._image_r.set_from_file(os.path.join(const.image_dir,"person.svg")) except: log.warn("Failed to generate preview for family", exc_info=True) self.clear_object() def clear_object(self): - self._image_l.set_from_file(os.path.join(const.rootDir,"person.svg")) - self._image_r.set_from_file(os.path.join(const.rootDir,"person.svg")) + self._image_l.set_from_file(os.path.join(const.image_dir,"person.svg")) + self._image_r.set_from_file(os.path.join(const.image_dir,"person.svg")) if gtk.pygtk_version < (2,8,0): diff --git a/src/ObjectSelector/_ObjectSelectorWindow.py b/src/ObjectSelector/_ObjectSelectorWindow.py index d59bbf521..0e812a831 100644 --- a/src/ObjectSelector/_ObjectSelectorWindow.py +++ b/src/ObjectSelector/_ObjectSelectorWindow.py @@ -156,8 +156,8 @@ class ObjectSelectorWindow(gtk.Window,ManagedWindow): self.__class__.__default_border_width) - person_pixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(const.rootDir,"person.svg")) - flist_pixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(const.rootDir,"flist.svg")) + person_pixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(const.image_dir,"person.svg")) + flist_pixbuf = gtk.gdk.pixbuf_new_from_file(os.path.join(const.image_dir,"flist.svg")) self._tool_list = gtk.ListStore(gtk.gdk.Pixbuf, str,int) diff --git a/src/ObjectSelector/_PersonPreviewFrame.py b/src/ObjectSelector/_PersonPreviewFrame.py index 94f37e7e3..10ecc63c3 100644 --- a/src/ObjectSelector/_PersonPreviewFrame.py +++ b/src/ObjectSelector/_PersonPreviewFrame.py @@ -62,7 +62,7 @@ class PersonPreviewFrame(PreviewFrameBase): self._image = gtk.Image() # test image - self._image.set_from_file(os.path.join(const.rootDir,"person.svg")) + self._image.set_from_file(os.path.join(const.image_dir,"person.svg")) # Text label = gtk.Label() @@ -142,7 +142,7 @@ class PersonPreviewFrame(PreviewFrameBase): pixbuf = ImgManip.get_thumbnail_image(mobj.get_path()) self._image.set_from_pixbuf(pixbuf) else: - self._image.set_from_file(os.path.join(const.rootDir,"person.svg")) + self._image.set_from_file(os.path.join(const.image_dir,"person.svg")) self._label.set_markup(self._get_text_preview(person)) @@ -157,7 +157,7 @@ class PersonPreviewFrame(PreviewFrameBase): def clear_object(self): - self._image.set_from_file(os.path.join(const.rootDir,"person.svg")) + self._image.set_from_file(os.path.join(const.image_dir,"person.svg")) self._label.set_markup("") diff --git a/src/const.py.in b/src/const.py.in index 7c20b2600..4cd0c9058 100644 --- a/src/const.py.in +++ b/src/const.py.in @@ -89,32 +89,33 @@ no_gconf = False # #------------------------------------------------------------------------- -rootDir = os.path.abspath(os.path.dirname(__file__)) +root_dir = os.path.abspath(os.path.dirname(__file__)) +image_dir = os.path.join(root_dir,"images") -system_filters = os.path.join(rootDir,"system_filters.xml") +system_filters = os.path.join(root_dir,"system_filters.xml") custom_filters = "~/.gramps/custom_filters.xml" report_options = "~/.gramps/report_options.xml" tool_options = "~/.gramps/tool_options.xml" bsddbenv_dir = "~/.gramps/bsddbenv" -icon = os.path.join(rootDir,"images/gramps.png") -logo = os.path.join(rootDir,"images/logo.png") -splash = os.path.join(rootDir,"images/splash.jpg") -license = os.path.join(rootDir,"COPYING") -gladeFile = os.path.join(rootDir,"gramps.glade") -editPersonFile = os.path.join(rootDir,"edit_person.glade") -pluginsFile = os.path.join(rootDir,"plugins.glade") -mergeFile = os.path.join(rootDir,"mergedata.glade") -merge2File = os.path.join(rootDir,"merge.glade") -filterFile = os.path.join(rootDir,"rule.glade") +icon = os.path.join(root_dir,"images","gramps.png") +logo = os.path.join(root_dir,"images","logo.png") +splash = os.path.join(root_dir,"images","splash.jpg") +license = os.path.join(root_dir,"COPYING") +gladeFile = os.path.join(root_dir,"gramps.glade") +editPersonFile = os.path.join(root_dir,"edit_person.glade") +pluginsFile = os.path.join(root_dir,"plugins.glade") +mergeFile = os.path.join(root_dir,"mergedata.glade") +merge2File = os.path.join(root_dir,"merge.glade") +filterFile = os.path.join(root_dir,"rule.glade") -pluginsDir = os.path.join(rootDir,"plugins") -datesDir = os.path.join(rootDir,"dates") -docgenDir = os.path.join(rootDir,"docgen") -dataDir = os.path.join(rootDir,"data") -template_dir = os.path.join(dataDir,"templates") -papersize = "file:%s/papersize.xml" % dataDir -tipdata = os.path.join(dataDir,"tips.xml") -fdl = os.path.join(dataDir,"fdl.txt") +pluginsDir = os.path.join(root_dir,"plugins") +datesDir = os.path.join(root_dir,"dates") +docgenDir = os.path.join(root_dir,"docgen") +data_dir = os.path.join(root_dir,"data") +template_dir = os.path.join(data_dir,"templates") +papersize = "file:%s/papersize.xml" % data_dir +tipdata = os.path.join(data_dir,"tips.xml") +fdl = os.path.join(data_dir,"fdl.txt") startup = 1 dnd_images = 1 diff --git a/src/gramps_main.py b/src/gramps_main.py index 3dc2c4bdb..66256ba28 100644 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -60,7 +60,7 @@ import TipOfDay from GrampsMime import mime_type_is_defined from QuestionDialog import ErrorDialog -iconpaths = [".",const.rootDir] +iconpaths = [".",const.image_dir] def register_stock_icons (): import os diff --git a/src/plugins/NavWebPage.py b/src/plugins/NavWebPage.py index 58a14b5cf..68c9b868d 100644 --- a/src/plugins/NavWebPage.py +++ b/src/plugins/NavWebPage.py @@ -895,9 +895,9 @@ class MediaPage(BasePage): if photo.get_mime_type(): from_path = ImgManip.get_thumbnail_path(photo.get_path(),photo.get_mime_type()) if not os.path.isfile(from_path): - from_path = os.path.join(const.dataDir,"document.png") + from_path = os.path.join(const.data_dir,"document.png") else: - from_path = os.path.join(const.dataDir,"document.png") + from_path = os.path.join(const.data_dir,"document.png") if self.archive: self.archive.add(from_path,to_path)