Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Wedel
wfm_stitching
Commits
7a705ecc
Commit
7a705ecc
authored
Jul 13, 2018
by
Owen Arnold
Browse files
Print command attempted
This will help diagnosing issues on user machines
parent
34c8e0c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
install_wfm_stitching.py
View file @
7a705ecc
...
...
@@ -25,13 +25,17 @@ import os
import
sys
import
re
def
extract_upload_url
(
python
,
required_version
=
None
):
def
_run_subprocess
(
cmd
):
print
(
'attempting to run {0}'
.
format
(
' '
.
join
(
cmd
)))
subprocess
.
check_call
(
cmd
)
def
_extract_upload_url
(
python
,
required_version
=
None
):
""" From gitlab project releases fetch the download url for the release matching the tag
"""
try
:
import
gitlab
except
ImportError
:
subprocess
.
check_call
([
python
,
'-m'
,
'pip'
,
'install'
,
'--upgrade'
,
'--user'
,
'python-gitlab'
])
_run_
subprocess
([
python
,
'-m'
,
'pip'
,
'install'
,
'--upgrade'
,
'--user'
,
'python-gitlab'
])
import
gitlab
gl
=
gitlab
.
Gitlab
(
'https://git.esss.dk'
)
...
...
@@ -49,14 +53,14 @@ def extract_upload_url(python, required_version=None):
return
upload_url
def
do_wfm_stitching_install
(
python
,
required_version
):
url
=
extract_upload_url
(
python
,
required_version
)
subprocess
.
check_call
([
python
,
'-m'
,
'pip'
,
'install'
,
'--user'
,
'--upgrade'
,
url
])
def
_
do_wfm_stitching_install
(
python
,
required_version
):
url
=
_
extract_upload_url
(
python
,
required_version
)
_run_
subprocess
([
python
,
'-m'
,
'pip'
,
'install'
,
'--user'
,
'--upgrade'
,
url
])
def
do_wfm_stitching_uninstall
(
python
):
def
_
do_wfm_stitching_uninstall
(
python
):
"""Convenience function to allow the removal of the wfm-stitching package"""
subprocess
.
check_call
([
python
,
'-m'
,
'pip'
,
'uninstall'
,
'-y'
,
'wfm_stitching'
])
subprocess
.
check_call
([
python
,
'-m'
,
'pip'
,
'uninstall'
,
'-y'
,
'python-gitlab'
])
_run_
subprocess
([
python
,
'-m'
,
'pip'
,
'uninstall'
,
'-y'
,
'wfm_stitching'
])
_run_
subprocess
([
python
,
'-m'
,
'pip'
,
'uninstall'
,
'-y'
,
'python-gitlab'
])
if
__name__
==
"__main__"
:
parser
=
ArgumentParser
(
description
=
'Install WFM package http://git.esss.dk/wedel/wfm_sitching'
)
...
...
@@ -69,6 +73,6 @@ if __name__ == "__main__":
if
args
.
uninstall
:
if
args
.
version
:
print
(
'Warning: version argument is ignored during uninstall'
)
do_wfm_stitching_uninstall
(
interpreter
)
_
do_wfm_stitching_uninstall
(
interpreter
)
else
:
do_wfm_stitching_install
(
interpreter
,
required_version
=
args
.
version
)
_
do_wfm_stitching_install
(
interpreter
,
required_version
=
args
.
version
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment