3 from zonemaker.zone import Zone
4 from typing import Sequence
6 def load_module(name, path, write_bytecode = False):
7 import importlib.machinery
8 old_val = sys.dont_write_bytecode
9 sys.dont_write_bytecode = not write_bytecode
10 module = importlib.machinery.SourceFileLoader(name, path).load_module()
11 sys.dont_write_bytecode = old_val
14 def make_zone(filename: str) -> None:
15 zonefile = load_module(os.path.basename(filename), filename)
16 zones = zonefile.__zones__ # type: Sequence[Zone]
18 zone.write(sys.stdout)
20 if __name__ == "__main__":
21 for name in sys.argv[1:]: