update upgrader
This commit is contained in:
parent
623ff11304
commit
2412617ba4
@ -6,7 +6,7 @@
|
|||||||
<param name="tab" type="notebook">
|
<param name="tab" type="notebook">
|
||||||
<page name="tab_settings" gui-text="Upgrade Options">
|
<page name="tab_settings" gui-text="Upgrade Options">
|
||||||
<label appearance="header">Install Updates / Options</label>
|
<label appearance="header">Install Updates / Options</label>
|
||||||
<param name="install_requirements" type="bool" gui-text="Install python requirements" gui-description="Installs all python requirements from requirements.txt. This may take up to 10 minutes or may. There will be no visible console output until finished. Please wait until completed.">false</param>
|
<param name="install_requirements" type="bool" gui-text="Install/upgrade python requirements" gui-description="Installs/upgrades all python requirements from requirements.txt. This may take up to 10 minutes or may. There will be no visible console output until finished. Please wait until completed.">false</param>
|
||||||
|
|
||||||
<param name="convert_to_git" type="bool" gui-text="Convert to .git" gui-description="If you downloaded MightyScape as .zip or .tar.gz you cannot upgrade using this extension. But you can convert your downloaded directory to a .git one by enabling this option">false</param>
|
<param name="convert_to_git" type="bool" gui-text="Convert to .git" gui-description="If you downloaded MightyScape as .zip or .tar.gz you cannot upgrade using this extension. But you can convert your downloaded directory to a .git one by enabling this option">false</param>
|
||||||
<param name="recreate_remotes" type="bool" gui-text="Recreate remotes" gui-description="Update remotes in git config file (useful if you have an older version of MightyScape or if something changes). Warning: might drop passwords/auth tokens!">false</param>
|
<param name="recreate_remotes" type="bool" gui-text="Recreate remotes" gui-description="Update remotes in git config file (useful if you have an older version of MightyScape or if something changes). Warning: might drop passwords/auth tokens!">false</param>
|
||||||
|
@ -36,8 +36,15 @@ class AboutUpgradeMightyScape(inkex.EffectExtension):
|
|||||||
if not os.path.exists(requirements):
|
if not os.path.exists(requirements):
|
||||||
inkex.utils.debug("requirements.txt could not be found.")
|
inkex.utils.debug("requirements.txt could not be found.")
|
||||||
exit(1)
|
exit(1)
|
||||||
command = ["python3 -m pip install --upgrade --quiet --no-cache-dir -r " + requirements]
|
|
||||||
inkex.utils.debug("Executing: {}".format(command))
|
if os.name=="nt":
|
||||||
|
PYTHONBIN = "pythonw.exe"
|
||||||
|
else: #Linux/MacOS
|
||||||
|
PYTHONBIN = "python"
|
||||||
|
|
||||||
|
python_venv = os.path.abspath(os.path.join(os.path.dirname(git.__file__), '../', '../', '../', '../', 'bin', PYTHONBIN))
|
||||||
|
command = ["{} -m pip install --upgrade --quiet --no-cache-dir -r ".format(python_venv) + requirements]
|
||||||
|
inkex.utils.debug("Executing: {}".format(command[0]))
|
||||||
proc = subprocess.Popen(command, shell=True, stdout=PIPE, stderr=PIPE)
|
proc = subprocess.Popen(command, shell=True, stdout=PIPE, stderr=PIPE)
|
||||||
stdout, stderr = proc.communicate()
|
stdout, stderr = proc.communicate()
|
||||||
inkex.utils.debug(stdout.decode('UTF-8'))
|
inkex.utils.debug(stdout.decode('UTF-8'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user