diff options
author | Papoteur <papoteur@mageia.org> | 2023-01-20 14:48:22 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2023-01-20 14:48:22 +0100 |
commit | 1a5596b29b497fe0d17a7189a4194ee22ceefc37 (patch) | |
tree | e5d0945e243f7ac5123369d6c3a85ce98f179d5d /qml/mageiawelcome.py | |
parent | 96d5480f886a17567f3c641f50daddf2ec882ffc (diff) | |
download | mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.tar mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.tar.gz mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.tar.bz2 mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.tar.xz mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.zip |
fix installation of applications
this was broken by setting /usr/bin/gurpmi in QML part
now use a specific function to pass package to install and repository
Diffstat (limited to 'qml/mageiawelcome.py')
-rw-r--r-- | qml/mageiawelcome.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py index d831dc5..29d0358 100644 --- a/qml/mageiawelcome.py +++ b/qml/mageiawelcome.py @@ -123,8 +123,21 @@ class Launcher(QObject): cmd = [] for i in range(0,app.property("length").toInt()): cmd.append(app.property(i).toString()) - if cmd[0] == "gurpmi": - repo = cmd[2] + try: + subprocess.Popen(cmd) + except: + print(f"Exception running {cmd[0]}" ) + self.noprogram.emit() + return + + @pyqtSlot(QVariant) + def install(self, app): + if app.isArray(): + cmd = [] + # app should contain package, repository + for i in range(0,app.property("length").toInt()): + cmd.append(app.property(i).toString()) + repo = cmd[1] # Check if repositories are enabled core = False updates = False @@ -173,17 +186,11 @@ class Launcher(QObject): # repo not enabled self.repo.emit() return - proc = subprocess.Popen(['gurpmi',cmd[1]]) + proc = subprocess.Popen(['/usr/bin/gurpmi',cmd[0]]) proc.wait() # Give the signal to reload the applist self.installed.emit() return - try: - subprocess.Popen(cmd) - except: - print(f"Exception running {cmd[0]}" ) - self.noprogram.emit() - return class Norun(QObject): def __init__(self): |