42
42
from gramps .gen .lib import date
43
43
import gramps .gen .datehandler
44
44
from gramps .gen .const import USER_HOME , USER_PLUGINS
45
+ from gramps .gen .config import config
45
46
from gramps .gui .display import display_url
46
47
from gramps .gui .dialog import ErrorDialog
47
48
from gramps .plugins .lib .libhtml import Html , xml_lang
@@ -366,6 +367,8 @@ def ParseXML(self, tree, filename):
366
367
367
368
surname_tag = etree .SubElement (root , NAMESPACE + 'surname' )
368
369
pname_tag = etree .SubElement (root , NAMESPACE + 'pname' )
370
+ private_surname = config .get ('preferences.private-surname-text' )
371
+ private_record = config .get ('preferences.private-record-text' )
369
372
370
373
# variable
371
374
@@ -409,6 +412,13 @@ def ParseXML(self, tree, filename):
409
412
else :
410
413
mediapath = ''
411
414
415
+ # privacy
416
+
417
+ if two .get ('priv' ): # XML: optional
418
+ text = private_record
419
+ else :
420
+ text = ""
421
+
412
422
# search ptitle and time log
413
423
414
424
for three in two .iter ():
@@ -422,11 +432,13 @@ def ParseXML(self, tree, filename):
422
432
(tag , items ) = three .tag , three .items ()
423
433
424
434
if three .tag == NAMESPACE + 'ptitle' :
425
- text = str (three .text )
435
+ if text != private_record :
436
+ text = str (three .text )
426
437
if text not in places :
427
438
places .append (text ) # temp display
428
439
if three .tag == NAMESPACE + 'pname' :
429
- text = str (three .attrib .get ('value' ))
440
+ if text != private_record :
441
+ text = str (three .attrib .get ('value' ))
430
442
translation = str (three .attrib .get ('lang' ))
431
443
if translation == 'None' :
432
444
translation = xml_lang ()[0 :2 ]
@@ -450,7 +462,10 @@ def ParseXML(self, tree, filename):
450
462
# with namespace ...
451
463
452
464
if four .tag == NAMESPACE + 'surname' and four .text != None :
453
- surnames .append (four .text )
465
+ if text != private_record :
466
+ surnames .append (four .text )
467
+ else :
468
+ surnames .append (private_surname )
454
469
455
470
LOG .info ('end of loops' )
456
471
0 commit comments