From 15eff9c683c1c254de10add7cafc45e08b5968a5 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 3 Jan 2002 18:09:32 +0000 Subject: [PATCH] Fixed local flag not being set on image import svn: r677 --- gramps/src/AddMedia.py | 1 + gramps/src/ImageSelect.py | 8 ++++---- gramps/src/MediaView.py | 1 + gramps/src/RelImage.py | 3 --- gramps/src/gramps.py | 3 +-- gramps/src/plugins/DetAncestralReport.py | 2 +- gramps/src/plugins/ReadGedcom.py | 1 - 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/gramps/src/AddMedia.py b/gramps/src/AddMedia.py index 54563c0e1..c238cab76 100644 --- a/gramps/src/AddMedia.py +++ b/gramps/src/AddMedia.py @@ -114,6 +114,7 @@ class AddMediaObject: if external.get_active() == 0: path = self.db.getSavePath() name = RelImage.import_media_object(filename,path,mobj.getId()) + mobj.setLocal(1) else: name = filename mobj.setPath(name) diff --git a/gramps/src/ImageSelect.py b/gramps/src/ImageSelect.py index 91b9f2a3b..f3c51bff6 100644 --- a/gramps/src/ImageSelect.py +++ b/gramps/src/ImageSelect.py @@ -169,11 +169,13 @@ class ImageSelect: if type[0:5] == "image": if self.external.get_active() == 0: name = RelImage.import_media_object(filename,self.path,mobj.getId()) + mobj.setLocal(1) else: if self.external.get_active() == 1: name = filename else: name = RelImage.import_media_object(filename,self.path,mobj.getId()) + mobj.setLocal(1) mobj.setPath(name) utils.modified() @@ -291,9 +293,7 @@ class Gallery(ImageSelect): photo.setDescription(root) self.savephoto(photo) if Config.mediaref == 0: - name = RelImage.import_media_object(name, - self.path, - photo.getId()) + name = RelImage.import_media_object(name,self.path,photo.getId()) photo.setPath(name) photo.setLocal(1) utils.modified() @@ -322,6 +322,7 @@ class Gallery(ImageSelect): try: id = photo.getId() name = RelImage.import_media_object(tfile,self.path,id) + photo.setLocal(1) photo.setPath(name) except: photo.setPath(tfile) @@ -458,7 +459,6 @@ class Gallery(ImageSelect): photo = self.dataobj.getPhotoList()[self.selectedIcon] object = photo.getReference() name = RelImage.import_media_object(object.getPath(),self.path,object.getId()) - object.setPath(name) object.setLocal(1) diff --git a/gramps/src/MediaView.py b/gramps/src/MediaView.py index 2665c0cb1..ac866daa0 100644 --- a/gramps/src/MediaView.py +++ b/gramps/src/MediaView.py @@ -332,6 +332,7 @@ class MediaView: id = photo.getId() path = self.db.getSavePath() name = RelImage.import_media_object(tfile,path,id) + photo.setLocal(1) photo.setPath(name) except: photo.setPath(tfile) diff --git a/gramps/src/RelImage.py b/gramps/src/RelImage.py index 276fdcfda..5eaa71008 100644 --- a/gramps/src/RelImage.py +++ b/gramps/src/RelImage.py @@ -82,7 +82,6 @@ def import_media_object(filename,path,base): try: path = "%s/%s" % (thumb,base) - print "Making",path,"from",filename mk_thumb(filename,path,const.thumbScale) shutil.copy(filename,name) except: @@ -123,8 +122,6 @@ def scale_image(path,size): #------------------------------------------------------------------------- def mk_thumb(source,dest,size): - print "making a thumbnail",source,dest - dir = os.path.dirname(dest) try: if not os.path.exists(dir): diff --git a/gramps/src/gramps.py b/gramps/src/gramps.py index 604a5a8e7..640f9dfd1 100755 --- a/gramps/src/gramps.py +++ b/gramps/src/gramps.py @@ -7,13 +7,12 @@ import gtk import gnome.ui import locale -intl.textdomain("gramps") - if os.environ.has_key("GRAMPSI18N"): loc = os.environ["GRAMPSI18N"] else: loc = "locale" +intl.textdomain("gramps") intl.bindtextdomain("gramps",loc) locale.setlocale(locale.LC_NUMERIC,"C") diff --git a/gramps/src/plugins/DetAncestralReport.py b/gramps/src/plugins/DetAncestralReport.py index 90910526c..f4a11675f 100644 --- a/gramps/src/plugins/DetAncestralReport.py +++ b/gramps/src/plugins/DetAncestralReport.py @@ -561,7 +561,7 @@ def get_xpm_image(): " +........@@@@@@@@@@@@@@@@@@@@@...+ ", " +................................+ ", " +................................+ ", -" +.....@@@@@@@@@@@@@@@@@@@@@@@@...+ ", + " +.....@@@@@@@@@@@@@@@@@@@@@@@@...+ ", " +................................+ ", " +........@@@@@@@@@@@@@@@@@@@@@...+ ", " +................................+ ", diff --git a/gramps/src/plugins/ReadGedcom.py b/gramps/src/plugins/ReadGedcom.py index 7b81e36ad..e3b32f671 100644 --- a/gramps/src/plugins/ReadGedcom.py +++ b/gramps/src/plugins/ReadGedcom.py @@ -70,7 +70,6 @@ for val in const.familyConstantEvents.keys(): lineRE = re.compile(r"\s*(\d+)\s+(\S+)\s*(.*)$") headRE = re.compile(r"\s*(\d+)\s+HEAD") nameRegexp= re.compile(r"/?([^/]*)(/([^/]*)(/([^/]*))?)?") -#nameRegexp = re.compile(r"([\S\s]*\S)?\s*/([^/]+)?/\s*,?\s*([\S]+)?") calRegexp = re.compile(r"\s*@#D([^@]+)@\s*(.*)$") fromtoRegexp = re.compile(r"\s*FROM\s+@#D([^@]+)@\s*(.*)\s+TO\s+@#D([^@]+)@\s*(.*)$")