~rosco2/ubuntu/wily/gramps/bug-1492304

« back to all changes in this revision

Viewing changes to gramps/plugins/export/exportgedcom.py

  • Committer: Package Import Robot
  • Author(s): Ross Gammon
  • Date: 2015-08-11 23:03:11 UTC
  • mfrom: (1.4.3)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: package-import@ubuntu.com-20150811230311-acjr8gcfe8isx7ij
* New upstream release
* Drop patches applied upstream or cherry-picked from there
* Add version constraints for gtk and pygobject
* Add goocanvas dependency - available soon
* Drop webkit dpendency as HTML view has been removed
* Force removal of upstream packages when installing Debian one
  (LP: #1464845)
* Drop fixperm override as permissions fixed upstream
* Fix spelling error in changelog
* Switch to nose for unit tests
* Add build dependencies for the nose tests
* Update copyright file
* Add uversionmangle to watch file to deal with alpha/beta versions
* Add manual test cases
* Drop FAQ URL from upstream metadata - changes every release
* Add patch to fix transparent windows in Ubuntu.
  Thanks to Lance Orner (LP: #1451259)

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
from gramps.gen.updatecallback import UpdateCallback
55
55
from gramps.gen.utils.file import media_path_full
56
56
from gramps.gen.utils.place import conv_lat_lon
57
 
from gramps.gen.constfunc import cuni
58
57
from gramps.gen.utils.location import get_main_location
59
58
from gramps.gen.display.place import displayer as place_displayer
60
59
 
273
272
            token_level = level
274
273
            for text in textlist:
275
274
                # make it unicode so that breakup below does the right thin.
276
 
                text = cuni(text)
 
275
                text = str(text)
277
276
                if limit:
278
 
                    prefix = cuni("\n%d CONC " % (level + 1))
 
277
                    prefix = "\n%d CONC " % (level + 1)
279
278
                    txt = prefix.join(breakup(text, limit))
280
279
                else:
281
280
                    txt = text
282
 
                self.gedcom_file.write(cuni("%d %s %s\n" % (token_level, token, txt)))
 
281
                self.gedcom_file.write("%d %s %s\n" % (token_level, token, txt))
283
282
                token_level = level + 1
284
283
                token = "CONT"
285
284
        else:
286
 
            self.gedcom_file.write(cuni("%d %s\n" % (level, token)))
 
285
            self.gedcom_file.write("%d %s\n" % (level, token))
287
286
    
288
287
    def _header(self, filename):
289
288
        """
334
333
        self._writeln(1, "FILE", filename, limit=255)
335
334
        self._writeln(1, "COPR", 'Copyright (c) %d %s.' % (year, rname))
336
335
        self._writeln(1, "GEDC")
337
 
        self._writeln(2, "VERS", "5.5")
 
336
        self._writeln(2, "VERS", "5.5.1")
338
337
        self._writeln(2, "FORM", 'LINEAGE-LINKED')
339
338
        self._writeln(1, "CHAR", "UTF-8")
340
339
        
1095
1094
 
1096
1095
        if event.get_place_handle():
1097
1096
            place = self.dbase.get_place_from_handle(event.get_place_handle())
1098
 
            self._place(place, 2)
 
1097
            self._place(place, dateobj, 2)
1099
1098
 
1100
1099
        for attr in event.get_attribute_list():
1101
1100
            attr_type = attr.get_type()
1166
1165
        if lds_ord.get_temple():
1167
1166
            self._writeln(index+1, 'TEMP', lds_ord.get_temple())
1168
1167
        if lds_ord.get_place_handle():
1169
 
            self._place(
1170
 
                self.dbase.get_place_from_handle(lds_ord.get_place_handle()), 2)
 
1168
            place = self.dbase.get_place_from_handle(lds_ord.get_place_handle())
 
1169
            self._place(place, lds_ord.get_date_object(), 2)
1171
1170
        if lds_ord.get_status() != LdsOrd.STATUS_NONE:
1172
1171
            self._writeln(2, 'STAT', LDS_STATUS[lds_ord.get_status()])
1173
1172
        
1371
1370
 
1372
1371
            self._note_references(photo_obj.get_note_list(), level+1)
1373
1372
 
1374
 
    def _place(self, place, level):
 
1373
    def _place(self, place, dateobj, level):
1375
1374
        """
1376
1375
        PLACE_STRUCTURE:=
1377
1376
            n PLAC <PLACE_NAME> {1:1}
1386
1385
            +1 <<NOTE_STRUCTURE>> {0:M} 
1387
1386
        """
1388
1387
        if place is None: return
1389
 
        place_name = place_displayer.display(self.dbase, place)
 
1388
        place_name = place_displayer.display(self.dbase, place, dateobj)
1390
1389
        self._writeln(level, "PLAC", place_name.replace('\r', ' '), limit=120)
1391
1390
        longitude = place.get_longitude()
1392
1391
        latitude = place.get_latitude()