last for today

This commit is contained in:
YourSandwich 2021-05-01 22:02:52 +02:00
parent c92dda69d8
commit ac6dc2fcef
2 changed files with 36 additions and 30 deletions

View File

@ -22,7 +22,4 @@ for m in project_href[::2]:
for t in project_href[::2]: for t in project_href[::2]:
KernelVer = os.popen("echo " + t + " | cut -d'.' -f1,2,3 | sed 's/.arc//g' | sed 's/-x86_64//g' | sed 's/.ar//g' | sed 's/h//g'") KernelVer = os.popen("echo " + t + " | cut -d'.' -f1,2,3 | sed 's/.arc//g' | sed 's/-x86_64//g' | sed 's/.ar//g' | sed 's/h//g'")
for i in KernelVer.read().split('\n')[::2]: for i in KernelVer.read().split('\n')[::2]:
KernelVerList.append(i) KernelVerList.append(i)
print(KernelURL)
print(KernelVerList)

61
main.py
View File

@ -33,12 +33,10 @@ class Window(QWidget):
appIcon = QIcon('icon.png') appIcon = QIcon('icon.png')
self.setWindowIcon(appIcon) self.setWindowIcon(appIcon)
def installKernel(self): def installKernel(self):
self.install = InstallProcess() self.install = InstallProcess()
self.install.show() self.install.show()
## Application Quit Popup ## Application Quit Popup
def exitApp(self): def exitApp(self):
askUser = QMessageBox.question(self, "Quit", "Are you Sure?", QMessageBox.Yes | QMessageBox.No) askUser = QMessageBox.question(self, "Quit", "Are you Sure?", QMessageBox.Yes | QMessageBox.No)
@ -48,7 +46,33 @@ class Window(QWidget):
elif askUser == QMessageBox.No: elif askUser == QMessageBox.No:
pass pass
## Window after Install Button was pressed ## Making an Button
class Button(QPushButton):
def setButton(self, name, x, y,function):
button = QPushButton(name,self)
button.move(x,y)
button.clicked.connect(function)
## Making a List
class List(QListWidget):
def setList(self,x,y):
global aList
self.aList = QListWidget(self)
self.aList.resize(550,500)
self.aList.move(x,y)
aList = self.aList
## Taking the output from getKernelInfo and put it in the List
def addItem(self):
for i in KernelVerList:
self.item = QListWidgetItem(i, aList)
font = QFont()
font.setPixelSize(16)
self.item.setFont(font)
class InstallProcess(QWidget): class InstallProcess(QWidget):
def __init__(self, *args): def __init__(self, *args):
QWidget.__init__(self, *args) QWidget.__init__(self, *args)
@ -57,6 +81,10 @@ class InstallProcess(QWidget):
self.setFixedSize(400,300) self.setFixedSize(400,300)
self.center() self.center()
def Installation():
DeList = List()
print(DeList.item)
#!!! WARNING this function is wrong it waits for the Terminal to finish then it display the output. #!!! WARNING this function is wrong it waits for the Terminal to finish then it display the output.
#!!! If you put yes in it, the Program will freeze, there needs to be a better way to implement this. #!!! If you put yes in it, the Program will freeze, there needs to be a better way to implement this.
# Output into InstallProcess Windows -> QTextBrowser # Output into InstallProcess Windows -> QTextBrowser
@ -81,33 +109,14 @@ class InstallProcess(QWidget):
qRect.moveCenter(centerPoint) qRect.moveCenter(centerPoint)
self.move(qRect.topLeft()) self.move(qRect.topLeft())
## Making an Button
class Button(QPushButton):
def setButton(self, name, x, y,function):
button = QPushButton(name,self)
button.move(x,y)
button.clicked.connect(function)
## Making a List
class List(QListWidget):
def setList(self,x,y):
self.aList = QListWidget(self)
self.aList.resize(550,500)
self.aList.move(x,y)
## Taking the output from getKernelInfo and put it in the List
for i in KernelVerList:
item = QListWidgetItem(i, self.aList)
font = QFont()
font.setPixelSize(16)
item.setFont(font)
def main(): def main():
global App,window global App,window,DeList
App = QApplication(sys.argv) App = QApplication(sys.argv)
window = Window() window = Window()
DeList = List()
window.show() window.show()
DeList.addItem()
App.exec_() App.exec_()
sys.exit(0) sys.exit(0)