Commit 2ef79576 by Szeberényi Imre

--notray-icon fix

parent 2251f4d6
......@@ -26,11 +26,12 @@ loghandler.setFormatter(logformatter)
logger.addHandler(loghandler)
def remina_password(pw):
args = ["remmina", "--encrypt-password", "--no-tray-icon"]
args = ["remmina", "--encrypt-password"]
process = subprocess.run(args, input=pw, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, encoding="utf-8", timeout=5)
b = process.stdout.find("Encrypted password:")
process.stdout[b::].split()
return process.stdout[198::].split()[2]
if b >= 0:
return process.stdout[b::].split()[2]
logger.error("Cannot run remmina: %s" % process.stdout)
def connect(vm):
"""
......@@ -56,7 +57,7 @@ def connect(vm):
elif vm.protocol in ("NX", "RDP"):
password = remina_password(vm.password)
if vm.protocol == "RDP":
command = ("remmina --no-tray-icon"
command = ("remmina"
" -c rdp://%(user)s:%(password)s@%(host)s:%(port)s" % {
'user': vm.user,
'password': password,
......@@ -64,7 +65,7 @@ def connect(vm):
'port': vm.port,
})
else:
command = ("remmina --no-tray-icon"
command = ("remmina"
" -c rdp://%(user)s:%(password)s@%(host)s:%(port)s" % {
'user': vm.user,
'password': password,
......@@ -72,7 +73,7 @@ def connect(vm):
'port': vm.port,
})
logger.debug("Running: s", command)
subprocess.call(command, shell=True)
subprocess.call(command.split())
class Struct:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment