aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-10-05 22:56:24 +0000
committerDavid Robillard <d@drobilla.net>2010-10-05 22:56:24 +0000
commit9b500a6a4567cf93f051a0b3aad8863531a44f92 (patch)
tree3eeae75c11dce7d0297c7ea59cdd05d98a55ae0f
parent01119626a241ef35f28875fb9aa7f5bdd3a8bc0c (diff)
downloadlv2-9b500a6a4567cf93f051a0b3aad8863531a44f92.tar.xz
Move main functionality into lv2includegen function (so it's usable as a module).
-rwxr-xr-xlv2includegen/lv2includegen.py23
1 files 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()))