diff --git a/getKernelInfo.py b/getKernelInfo.py index 50abd8d..d9dc652 100644 --- a/getKernelInfo.py +++ b/getKernelInfo.py @@ -3,7 +3,6 @@ import os from bs4 import BeautifulSoup # 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/" 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)] del project_href[0] +KernelURL = [] 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 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]: - KernelVerList.append(i) \ No newline at end of file + KernelVerList.append(i) + +print(KernelURL) +print(KernelVerList) \ No newline at end of file diff --git a/main.py b/main.py index 6592ed4..34b4f54 100644 --- a/main.py +++ b/main.py @@ -1,11 +1,11 @@ from PySide2.QtWidgets import * from PySide2.QtGui import * from PySide2.QtCore import * -from getKernelInfo import KernelVerList +from getKernelInfo import KernelVerList, KernelURL import sys,os # 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: Clean the code. # 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 for i in KernelVerList: item = QListWidgetItem(i, self.aList) - font = QFont() font.setPixelSize(16) item.setFont(font) - + def main(): global App,window App = QApplication(sys.argv)