Test with appimage

This commit is contained in:
Mauricio Baeza 2020-03-10 22:19:50 -06:00
parent fcef6c4fb0
commit dcf7c0fd18
5 changed files with 52 additions and 20 deletions

View File

@ -1,5 +1,6 @@
v 0.4.0 [22-nov-2019]
v 0.4.0 [10-mar-2020]
- Update easymacro.py
- Fix: in OSx Catalina
v 0.3.0 [12-nov-2019]

View File

@ -4178,7 +4178,26 @@ def get_path_python():
path = join(path, '..', 'Resources', PYTHON)
else:
path = join(path, PYTHON)
return path
cmd = '"{}" -V'.format(path)
if run(cmd, True):
return path
path = PYTHON
cmd = '"{}" -V'.format(path)
result = run(cmd, True)
if 'Python 3' in result:
return path
path = PYTHON + '3'
cmd = '"{}" -V'.format(path)
result = run(cmd, True)
if 'Python 3' in result:
return path
return ''
# ~ Export ok
@ -4542,8 +4561,8 @@ def run(command, wait=False):
stdout=None, stderr=None, close_fds=True)
result, er = p.communicate()
except subprocess.CalledProcessError as e:
msg = ("run [ERROR]: output = %s, error code = %s\n"
% (e.output, e.returncode))
msg = ("%s\nrun [ERROR]: output = %s, error code = %s\n"
% (command, e.output, e.returncode))
error(msg)
return False

Binary file not shown.

View File

@ -32,8 +32,6 @@ class Controllers(object):
def __init__(self, dialog):
self.d = dialog
# ~ self.path_python = app.PYTHON
# ~ if app.IS_WIN:
self.path_python = app.get_path_python()
self._states = {
'list': False,
@ -248,13 +246,11 @@ class Controllers(object):
cmd = '"{}"'.format(self.path_python)
app.open_file(cmd)
else:
if app.DESKTOP == 'gnome':
cmd = 'exec "{}"'
if app.IS_MAC:
cmd = 'open "{}"'
elif app.DESKTOP == 'gnome':
cmd = 'gnome-terminal -- {}'
else:
if app.IS_MAC:
cmd = 'open "{}"'
else:
cmd = 'exec "{}"'
cmd = cmd.format(self.path_python)
app.run(cmd)
@ -282,10 +278,11 @@ class ZAZPip(unohelper.Base, XJobExecutor):
dialog.id_extension = ID_EXTENSION
dialog.events = Controllers(dialog)
lbl_title = '{} {} - {}'.format(app.NAME, app.VERSION, app.OS)
args = {
'Type': 'Label',
'Name': 'lbl_title',
'Label': app.NAME + ' v' + app.VERSION,
'Label': lbl_title,
'Width': 100,
'Height': 15,
'Border': 1,
@ -297,11 +294,7 @@ class ZAZPip(unohelper.Base, XJobExecutor):
dialog.add_control(args)
dialog.center(dialog.lbl_title, y=5)
# ~ path_python = app.PYTHON
# ~ if app.IS_WIN:
path_python = app.get_path_python()
# ~ cmd = app.PYTHON + ' -V'
# ~ if app.IS_WIN:
cmd = '"{}" -V'.format(path_python)
label = app.run(cmd, True)

View File

@ -4178,7 +4178,26 @@ def get_path_python():
path = join(path, '..', 'Resources', PYTHON)
else:
path = join(path, PYTHON)
return path
cmd = '"{}" -V'.format(path)
if run(cmd, True):
return path
path = PYTHON
cmd = '"{}" -V'.format(path)
result = run(cmd, True)
if 'Python 3' in result:
return path
path = PYTHON + '3'
cmd = '"{}" -V'.format(path)
result = run(cmd, True)
if 'Python 3' in result:
return path
return ''
# ~ Export ok
@ -4542,8 +4561,8 @@ def run(command, wait=False):
stdout=None, stderr=None, close_fds=True)
result, er = p.communicate()
except subprocess.CalledProcessError as e:
msg = ("run [ERROR]: output = %s, error code = %s\n"
% (e.output, e.returncode))
msg = ("%s\nrun [ERROR]: output = %s, error code = %s\n"
% (command, e.output, e.returncode))
error(msg)
return False