Improvments

This commit is contained in:
YourSandwich 2021-05-01 21:02:46 +02:00
parent 8627f7f688
commit 9c8cff901a
2 changed files with 12 additions and 7 deletions

View File

@ -3,7 +3,6 @@ import os
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
# TODO: Change Bash cut to RegEx and fix the Version sorting # TODO: Change Bash cut to RegEx and fix the Version sorting
# TODO: Scrap the Kernel URL an make sure to match the actual kernel name in the KernelVerList
theurl = "https://archive.archlinux.org/packages/l/linux/" theurl = "https://archive.archlinux.org/packages/l/linux/"
thepage = urllib.request.urlopen(theurl) thepage = urllib.request.urlopen(theurl)
@ -13,10 +12,17 @@ soup = BeautifulSoup(thepage)
project_href = [i['href'] for i in soup.find_all('a', href=True)] project_href = [i['href'] for i in soup.find_all('a', href=True)]
del project_href[0] del project_href[0]
KernelURL = []
KernelVerList = [] KernelVerList = []
for m in project_href[::2]:
KernelURL.append("https://archive.archlinux.org/packages/l/linux/"+m)
## Making complicated stuff to extract only the Kernal Version from the WebScrap ## 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 -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)

View File

@ -1,11 +1,11 @@
from PySide2.QtWidgets import * from PySide2.QtWidgets import *
from PySide2.QtGui import * from PySide2.QtGui import *
from PySide2.QtCore import * from PySide2.QtCore import *
from getKernelInfo import KernelVerList from getKernelInfo import KernelVerList, KernelURL
import sys,os import sys,os
# TODO: Fix the install Process function. # TODO: Fix the install Process function.
# TODO: Implement when ListItem selected and install pressed, to parse the array and download the right Kernel with wget or cURL from the Archive # TODO: Implement when ListItem selected and install pressed, to parse the array and download the right Kernel with wget or curl from the Archive
# TODO: Implement resizible Windows # TODO: Implement resizible Windows
# TODO: Clean the code. # TODO: Clean the code.
# TODO: Import from PySide only the needed functions # TODO: Import from PySide only the needed functions
@ -99,11 +99,10 @@ class List(QListWidget):
## Taking the output from getKernelInfo and put it in the List ## 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)
font = QFont() font = QFont()
font.setPixelSize(16) font.setPixelSize(16)
item.setFont(font) item.setFont(font)
def main(): def main():
global App,window global App,window
App = QApplication(sys.argv) App = QApplication(sys.argv)