from .common import pp
from .pdns_app import PpPDNSAppError, PpPDNSApplication
+from .pdns_zone import PdnsApiZone
-__version__ = '0.2.0'
+__version__ = '0.2.1'
LOG = logging.getLogger(__name__)
if self.verbose > 2:
LOG.debug("Got a response:\n{}".format(pp(json_response)))
+ zone_list = []
+ len_zone = 10
+
+ for data in json_response:
+ 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 self.verbose > 2:
+ print("{!r}".format(zone))
+ tpl = PdnsApiZone.get_list_template()
+ line = tpl.format(
+ name="Zone", len_zone=len_zone, kind="Type", serial="Serial",
+ dnssec="DNSSEC", account="Account information")
+ print(line)
+ print('-' * len(line))
+
+ for zone in zone_list:
+ print(zone.get_line(len_zone))
# =============================================================================