38 Main function to execute the script.
42 Install scripts from predefined SVN repository.
44 __package =
"examples"
45 __delimn =
" "; __url_delimn =
"/"
46 __scripts_package = os.path.join(os.path.dirname(os.path.abspath(__file__)),__package)
47 if not os.path.exists(__scripts_package)
or not os.listdir(__scripts_package):
48 print(
"==================================")
49 print(
"Installing minimum working examples")
50 print(
"==================================")
51 __svn_repo = __url_delimn.join([
"https:",
"",
"svn.dlr.de",
"STM-Routines",
"Tools_Utilities",
"PyXMake",
"trunk",
"minExample"])
52 os.system(__delimn.join([
'svn',
'--non-interactive',
'checkout',
'--depth files', __svn_repo,__scripts_package]))
58 Install scripts from predefined GIT repository.
61 try: sys.path.remove(os.path.dirname(os.path.abspath(__file__)))
65 sys.path.insert(0,os.path.abspath(__file__))
68 __package =
"examples"
69 __delimn =
" "; __url_delimn =
"/"
70 __scripts_package = os.path.join(os.path.dirname(os.path.abspath(__file__)),__package)
72 if not os.path.exists(__scripts_package)
or not os.listdir(__scripts_package):
73 print(
"==================================")
74 print(
"Installing minimum working examples")
75 print(
"==================================")
76 __git_server_access =
"gitlab.dlr.de"
77 __git_repo = __url_delimn.join([
"https:",
"",__git_server_access,
"fa_sw",
"stmlab",
"PyXMake"+
".git"])
78 git.Repo.clone_from(__git_repo, __scripts_package, single_branch=
True, b=
"pyx_examples")
80 __doc_package = os.path.join(os.path.dirname(__scripts_package),
"doc")
81 if not os.path.exists(__doc_package)
or not os.listdir(__doc_package):
82 print(
"==================================")
83 print(
"Installing documentation")
84 print(
"==================================")
85 __git_server_access =
"gitlab.dlr.de"
86 __git_repo = __url_delimn.join([
"https:",
"",__git_server_access,
"fa_sw",
"stmlab",
"PyXMake"+
".git"])
87 git.Repo.clone_from(__git_repo, __doc_package, single_branch=
True, b=
"pyx_docs")
95 currentdir = os.getcwd()
96 os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)),
"examples"))
97 symlinks = [(os.path.join(os.path.dirname(os.path.abspath(__file__)),
"examples",x),
98 os.path.join(os.path.dirname(os.path.abspath(__file__)),x.replace(
"pyx_",
"")))
99 for x
in glob.glob(
'pyx_*.py')]; os.chdir(currentdir)
102 for pair
in symlinks:
103 if not os.path.exists(pair[-1]): os.link(pair[0],pair[1])