From: Frank Brehm Date: Wed, 8 Nov 2017 12:09:46 +0000 (+0100) Subject: Sorting list of domains by unicode names. X-Git-Tag: 0.1.2~108 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=37ac2f0bbee08ef26b25a7bccdaab0ce98310ad2;p=pixelpark%2Fadmin-tools.git Sorting list of domains by unicode names. --- diff --git a/pp_lib/pdns_list_zones.py b/pp_lib/pdns_list_zones.py index be34b31..aa7521a 100644 --- a/pp_lib/pdns_list_zones.py +++ b/pp_lib/pdns_list_zones.py @@ -22,7 +22,7 @@ from .common import pp, compare_fqdn from .pdns_app import PpPDNSAppError, PpPDNSApplication from .pdns_zone import PdnsApiZone -__version__ = '0.2.2' +__version__ = '0.2.3' LOG = logging.getLogger(__name__) @@ -68,8 +68,8 @@ class PpPDNSListZonesApp(PpPDNSApplication): zone = PdnsApiZone.init_from_dict( data, appname=self.appname, verbose=self.verbose, base_dir=self.base_dir) zone_list.append(zone) - if len(zone.name) > len_zone: - len_zone = len(zone.name) + if len(zone.name_unicode) > len_zone: + len_zone = len(zone.name_unicode) if self.verbose > 2: print("{!r}".format(zone)) tpl = PdnsApiZone.get_list_template() @@ -79,7 +79,7 @@ class PpPDNSListZonesApp(PpPDNSApplication): print(line) print('-' * len(line)) - for zone in sorted(zone_list, key=lambda x: cmp_to_key(compare_fqdn)(x.name)): + for zone in sorted(zone_list, key=lambda x: cmp_to_key(compare_fqdn)(x.name_unicode)): print(zone.get_line(len_zone)) # =============================================================================