578
578
takes_args = ['to_root_dir', 'from_archive']
579
579
takes_options = ['verbose']
581
584
def run(self, to_root_dir, from_archive, verbose=False):
582
585
to_root = os.path.realpath(to_root_dir)
583
586
if not os.path.exists(to_root):
588
import_archive(to_root, from_archive, verbose, self.printer)
590
def import_archive(to_root, from_archive, verbose, printer):
588
591
for version in pybaz.Archive(from_archive).iter_versions():
589
592
target = os.path.join(to_root, map_namespace(version))
590
594
os.makedirs(os.path.dirname(target))
591
595
import_version(target, version)