mirror of
https://github.com/peridotbuild/pv2.git
synced 2024-11-21 20:51:26 +00:00
add module example script
This commit is contained in:
parent
7e4c13657b
commit
bc47743933
28
examples/import_module.py
Normal file
28
examples/import_module.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import pv2.importer as importutil
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description="Importer")
|
||||||
|
|
||||||
|
parser.add_argument('--module', type=str, required=True)
|
||||||
|
parser.add_argument('--source-giturl', type=str, required=True)
|
||||||
|
parser.add_argument('--source-gitorg', type=str, required=True)
|
||||||
|
parser.add_argument('--branch', type=str, required=True)
|
||||||
|
parser.add_argument('--giturl', type=str, required=True)
|
||||||
|
parser.add_argument('--gitorg', type=str, required=False, default='modules')
|
||||||
|
parser.add_argument('--dest-branch', type=str, required=False, default='')
|
||||||
|
parser.add_argument('--release', type=str, required=False, default='')
|
||||||
|
results = parser.parse_args()
|
||||||
|
classy = importutil.ModuleImport(
|
||||||
|
results.module,
|
||||||
|
source_git_url_path=results.source_giturl,
|
||||||
|
source_git_org_path=results.source_gitorg,
|
||||||
|
git_url_path=results.giturl,
|
||||||
|
org=results.gitorg,
|
||||||
|
release=results.release,
|
||||||
|
branch=results.branch,
|
||||||
|
dest_branch=results.dest_branch,
|
||||||
|
)
|
||||||
|
|
||||||
|
classy.module_import()
|
Loading…
Reference in New Issue
Block a user