summaryrefslogtreecommitdiffstats
path: root/qml
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2023-01-20 14:50:32 +0100
committerPapoteur <papoteur@mageia.org>2023-01-20 14:50:32 +0100
commit0e8dadef2d95c7cd9eb86345c5dcfa7399bc896b (patch)
tree37db5896ebe11efe60dce90eb7c9a78510b362ff /qml
parenta55188c573fb24f237f7e595ba2b3a515ad906b6 (diff)
downloadmageiawelcome-0e8dadef2d95c7cd9eb86345c5dcfa7399bc896b.tar
mageiawelcome-0e8dadef2d95c7cd9eb86345c5dcfa7399bc896b.tar.gz
mageiawelcome-0e8dadef2d95c7cd9eb86345c5dcfa7399bc896b.tar.bz2
mageiawelcome-0e8dadef2d95c7cd9eb86345c5dcfa7399bc896b.tar.xz
mageiawelcome-0e8dadef2d95c7cd9eb86345c5dcfa7399bc896b.zip
format code
Diffstat (limited to 'qml')
-rw-r--r--qml/mageiawelcome.py114
1 files changed, 57 insertions, 57 deletions
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):