|
51 | 51 | # Gramps modules |
52 | 52 | # |
53 | 53 | #------------------------------------------------------------------------ |
54 | | -from gramps.gen.display.place import displayer as _pd |
55 | | -from gramps.gen.lib import EventType, PlaceType, Location |
56 | | -from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback |
57 | | -from gramps.gen.utils.location import get_main_location |
58 | | -from gramps.gen.const import GRAMPS_LOCALE as glocale |
59 | 54 | from gramps.plugins.lib.libsubstkeyword import * |
60 | 55 |
|
61 | 56 | import logging |
@@ -624,67 +619,6 @@ def replace_and_clean(self, lines, event): |
624 | 619 | return new |
625 | 620 |
|
626 | 621 |
|
627 | | -class PlaceFormat(GenericFormat): |
628 | | - """ The place format class. |
629 | | - If no format string, the place is displayed as per preference options |
630 | | - otherwise, parse through a format string and put the place parts in |
631 | | - """ |
632 | | - |
633 | | - def __init__(self, database, _in): |
634 | | - self.database = database |
635 | | - GenericFormat.__init__(self, _in) |
636 | | - self.date = None |
637 | | - |
638 | | - def get_place(self, database, event): |
639 | | - """ A helper method for retrieving a place from an event """ |
640 | | - if event: |
641 | | - bplace_handle = event.get_place_handle() |
642 | | - self.date = event.date |
643 | | - if bplace_handle: |
644 | | - return database.get_place_from_handle(bplace_handle) |
645 | | - return None |
646 | | - |
647 | | - def _default_format(self, place): |
648 | | - return _pd.display(self.database, place, date=self.date) |
649 | | - |
650 | | - def parse_format(self, database, place): |
651 | | - """ Parse the place """ |
652 | | - |
653 | | - if self.is_blank(place): |
654 | | - return |
655 | | - |
656 | | - code = "elcuspn" + "oitxy" |
657 | | - upper = code.upper() |
658 | | - |
659 | | - main_loc = get_main_location(database, place, date=self.date) |
660 | | - location = Location() |
661 | | - location.set_street(main_loc.get(PlaceType.STREET, '')) |
662 | | - location.set_locality(main_loc.get(PlaceType.LOCALITY, '')) |
663 | | - location.set_parish(main_loc.get(PlaceType.PARISH, '')) |
664 | | - location.set_city(main_loc.get(PlaceType.CITY, '')) |
665 | | - location.set_county(main_loc.get(PlaceType.COUNTY, '')) |
666 | | - location.set_state(main_loc.get(PlaceType.STATE, '')) |
667 | | - location.set_postal_code(main_loc.get(PlaceType.STREET, '')) |
668 | | - location.set_country(main_loc.get(PlaceType.COUNTRY, '')) |
669 | | - |
670 | | - function = [location.get_street, |
671 | | - location.get_locality, |
672 | | - location.get_city, |
673 | | - location.get_county, |
674 | | - location.get_state, |
675 | | - place.get_code, |
676 | | - location.get_country, |
677 | | - |
678 | | - location.get_phone, |
679 | | - location.get_parish, |
680 | | - place.get_title, |
681 | | - place.get_longitude, |
682 | | - place.get_latitude |
683 | | - ] |
684 | | - |
685 | | - return self.generic_format(place, code, upper, function) |
686 | | - |
687 | | - |
688 | 622 | # |
689 | 623 | # if __name__ == '__main__': |
690 | 624 | #------------------------------------------------------------------------- |
|
0 commit comments