Add files via upload
This commit is contained in:
parent
51a0d0cd6f
commit
1a6401e4ce
@ -12,6 +12,7 @@ del project_href[0]
|
|||||||
|
|
||||||
KernelVerList = []
|
KernelVerList = []
|
||||||
|
|
||||||
|
## Making complicated stuff to extract only the Kernal Version from the WebScrap
|
||||||
for t in project_href[::2]:
|
for t in project_href[::2]:
|
||||||
KernelVer = os.popen("echo " + t + " | cut -b 1-14 | cut -d'.' -f1,2,3 | sed 's/.arc//g' | sed 's/.ar//g' | sed 's/h//g' | sort -V")
|
KernelVer = os.popen("echo " + t + " | cut -b 1-14 | cut -d'.' -f1,2,3 | sed 's/.arc//g' | sed 's/.ar//g' | sed 's/h//g' | sort -V")
|
||||||
for i in KernelVer.read().split('\n')[::2]:
|
for i in KernelVer.read().split('\n')[::2]:
|
||||||
|
28
main.py
28
main.py
@ -4,13 +4,10 @@ from PySide2.QtCore import *
|
|||||||
from getKernelInfo import KernelVerList
|
from getKernelInfo import KernelVerList
|
||||||
import sys,os
|
import sys,os
|
||||||
|
|
||||||
Items = []
|
## Creating the MainWindow
|
||||||
#Items.append(KernelVer)
|
|
||||||
|
|
||||||
class Window(QWidget):
|
class Window(QWidget):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self.setWindowTitle("KernelChan")
|
self.setWindowTitle("KernelChan")
|
||||||
self.setFixedSize(600,600)
|
self.setFixedSize(600,600)
|
||||||
|
|
||||||
@ -35,6 +32,10 @@ class Window(QWidget):
|
|||||||
self.install = InstallProcess()
|
self.install = InstallProcess()
|
||||||
self.install.show()
|
self.install.show()
|
||||||
|
|
||||||
|
global InstallOutput
|
||||||
|
InstallOutput = print("lol")
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
@ -43,21 +44,31 @@ class Window(QWidget):
|
|||||||
elif askUser == QMessageBox.No:
|
elif askUser == QMessageBox.No:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
## Window after Install Button was pressed
|
||||||
class InstallProcess(QWidget):
|
class InstallProcess(QWidget):
|
||||||
def __init__(self):
|
def __init__(self, *args):
|
||||||
super().__init__()
|
QWidget.__init__(self, *args)
|
||||||
|
|
||||||
self.setWindowTitle("Kernel Installation")
|
self.setWindowTitle("Kernel Installation")
|
||||||
self.setFixedSize(400,300)
|
self.setFixedSize(400,300)
|
||||||
self.center()
|
self.center()
|
||||||
|
|
||||||
|
# create objects
|
||||||
|
self.te = QTextBrowser()
|
||||||
|
self.te.setHtml("InstallOutput")
|
||||||
|
|
||||||
|
# layout
|
||||||
|
layout = QVBoxLayout(self)
|
||||||
|
layout.addWidget(self.te)
|
||||||
|
self.setLayout(layout)
|
||||||
|
|
||||||
def center(self):
|
def center(self):
|
||||||
qRect = self.frameGeometry()
|
qRect = self.frameGeometry()
|
||||||
centerPoint = QDesktopWidget().availableGeometry().center()
|
centerPoint = QDesktopWidget().availableGeometry().center()
|
||||||
qRect.moveCenter(centerPoint)
|
qRect.moveCenter(centerPoint)
|
||||||
self.move(qRect.topLeft())
|
self.move(qRect.topLeft())
|
||||||
|
|
||||||
|
## Making an Button
|
||||||
class Button(QPushButton):
|
class Button(QPushButton):
|
||||||
def setButton(self, name, x, y,function):
|
def setButton(self, name, x, y,function):
|
||||||
button = QPushButton(name,self)
|
button = QPushButton(name,self)
|
||||||
@ -65,12 +76,14 @@ class Button(QPushButton):
|
|||||||
|
|
||||||
button.clicked.connect(function)
|
button.clicked.connect(function)
|
||||||
|
|
||||||
|
## Making a List
|
||||||
class List(QListWidget):
|
class List(QListWidget):
|
||||||
def setList(self,x,y):
|
def setList(self,x,y):
|
||||||
self.aList = QListWidget(self)
|
self.aList = QListWidget(self)
|
||||||
self.aList.resize(550,500)
|
self.aList.resize(550,500)
|
||||||
self.aList.move(x,y)
|
self.aList.move(x,y)
|
||||||
|
|
||||||
|
## Taking the output from getKernelInfo and put it in the List
|
||||||
for i in KernelVerList:
|
for i in KernelVerList:
|
||||||
item = QListWidgetItem(i, self.aList)
|
item = QListWidgetItem(i, self.aList)
|
||||||
|
|
||||||
@ -78,6 +91,7 @@ class List(QListWidget):
|
|||||||
font.setPixelSize(16)
|
font.setPixelSize(16)
|
||||||
item.setFont(font)
|
item.setFont(font)
|
||||||
|
|
||||||
|
|
||||||
App = QApplication(sys.argv)
|
App = QApplication(sys.argv)
|
||||||
window = Window()
|
window = Window()
|
||||||
window.show()
|
window.show()
|
||||||
|
Loading…
Reference in New Issue
Block a user