3 from zonemaker.zone import Zone
6 def load_module(name, path, write_bytecode = False):
7 old_val = sys.dont_write_bytecode
8 sys.dont_write_bytecode = not write_bytecode
11 from importlib.machinery import SourceFileLoader
12 module = SourceFileLoader(name, path).load_module()
15 module = imp.load_source(name, path)
17 sys.dont_write_bytecode = old_val
20 def make_zone(filename: str) -> None:
21 zonefile = load_module(os.path.basename(filename), filename)
22 zone = zonefile.__zone__ # type: Zone
25 if __name__ == "__main__":
26 for name in sys.argv[1:]: