From 9b500a6a4567cf93f051a0b3aad8863531a44f92 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 5 Oct 2010 22:56:24 +0000 Subject: Move main functionality into lv2includegen function (so it's usable as a module). --- lv2includegen/lv2includegen.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lv2includegen/lv2includegen.py b/lv2includegen/lv2includegen.py index 333bff2..80c0509 100755 --- a/lv2includegen/lv2includegen.py +++ b/lv2includegen/lv2includegen.py @@ -57,16 +57,8 @@ def mkdir_p(path): else: raise -if __name__ == "__main__": - args = sys.argv[1:] - if len(args) != 1: - usage() - exit(1) - - outdir = args[0] - print "Building LV2 include tree at", outdir - - for bundle in lv2_bundles(lv2_path()): +def lv2includegen(bundles): + for bundle in bundles: # Load manifest into model manifest = RDF.Model() parser = RDF.Parser(name="guess") @@ -83,3 +75,14 @@ if __name__ == "__main__": # Make symlink to bundle directory mkdir_p(ext_parent_dir) os.symlink(bundle, os.path.join(ext_parent_dir, ext_dir)) + +if __name__ == "__main__": + args = sys.argv[1:] + if len(args) != 1: + usage() + exit(1) + + outdir = args[0] + print "Building LV2 include tree at", outdir + + lv2includegen(lv2_bundles(lv2_path())) -- cgit v1.2.1