From 0e8dadef2d95c7cd9eb86345c5dcfa7399bc896b Mon Sep 17 00:00:00 2001 From: Papoteur Date: Fri, 20 Jan 2023 14:50:32 +0100 Subject: format code --- qml/mageiawelcome.py | 114 +++++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) (limited to 'qml') diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py index 29d0358..f768df3 100644 --- a/qml/mageiawelcome.py +++ b/qml/mageiawelcome.py @@ -133,64 +133,64 @@ class Launcher(QObject): @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 - tainted = False - t_updates = False - nonfree = False - nf_updates = False - core32 = False - core32_updates = False - try: - active = subprocess.run(['urpmq','--list-media','active'], capture_output=True, text=True) - active.check_returncode() - except subprocess.CalledProcessError: - print("Error with urpmq") - return - for line in active.stdout.splitlines(): - if line.startswith('Core Release'): - core = True - if line.startswith('Core Updates'): - updates = True - if line.startswith('Tainted Release'): - tainted = True - if line.startswith('Tainted Updates'): - t_updates = True - if line.startswith('Nonfree Release'): - nonfree = True - if line.startswith('Nonfree Updates'): - nf_updates = True - if line.startswith('Core 32bit Release'): - core32 = True - if line.startswith('Core 32bit Updates'): - core32_updates = True - if repo == 'tainted' and not (tainted and t_updates) : - # repo tainted not enabled - self.needed.emit(repo) - return - if repo == 'non-free' and not (nonfree and nf_updates) : - # repo nonfree not enabled - self.needed.emit(repo) - return - if repo == 'steam' and not (core32 and core32_updates and nonfree and nf_updates) : - # repo not enabled - self.needed.emit(repo) - return - if repo == '' and not (core and updates) : - # repo not enabled - self.repo.emit() - return - proc = subprocess.Popen(['/usr/bin/gurpmi',cmd[0]]) - proc.wait() - # Give the signal to reload the applist - self.installed.emit() + 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 + tainted = False + t_updates = False + nonfree = False + nf_updates = False + core32 = False + core32_updates = False + try: + active = subprocess.run(['urpmq','--list-media','active'], capture_output=True, text=True) + active.check_returncode() + except subprocess.CalledProcessError: + print("Error with urpmq") + return + for line in active.stdout.splitlines(): + if line.startswith('Core Release'): + core = True + if line.startswith('Core Updates'): + updates = True + if line.startswith('Tainted Release'): + tainted = True + if line.startswith('Tainted Updates'): + t_updates = True + if line.startswith('Nonfree Release'): + nonfree = True + if line.startswith('Nonfree Updates'): + nf_updates = True + if line.startswith('Core 32bit Release'): + core32 = True + if line.startswith('Core 32bit Updates'): + core32_updates = True + if repo == 'tainted' and not (tainted and t_updates) : + # repo tainted not enabled + self.needed.emit(repo) + return + if repo == 'non-free' and not (nonfree and nf_updates) : + # repo nonfree not enabled + self.needed.emit(repo) + return + if repo == 'steam' and not (core32 and core32_updates and nonfree and nf_updates) : + # repo not enabled + self.needed.emit(repo) + return + if repo == '' and not (core and updates) : + # repo not enabled + self.repo.emit() return + proc = subprocess.Popen(['/usr/bin/gurpmi',cmd[0]]) + proc.wait() + # Give the signal to reload the applist + self.installed.emit() + return class Norun(QObject): def __init__(self): -- cgit v1.2.1