import re
from PyQt5.QtGui import QStandardItemModel,QStandardItem
+debug=False #True
+
class d_Category:
def __init__(self):
self.Name=''
continue
def s_doSearch(self,options):
- AVERS='Avail¬¬<overlayver>¬¬{isminuskeyword}-K{}{isminusunstable}-{}{isminusasterisk}-*{}{isprofilemasked}[P]{}{ismasked}[m]{}{isunstable}~{}{ismissingkeyword}**{}¬¬<version>¬¬<use>{!last}\n{}'
- IVERS='Instd¬¬<overlayver>¬¬{isminuskeyword}-K{}{isminusunstable}-{}{isminusasterisk}-*{}{isprofilemasked}[P]{}{ismasked}[m]{}{isunstable}~{}{ismissingkeyword}**{}¬¬<version>¬¬<use*>{!last}\n{}'
+ AVERS='Avail¬¬<overlayname><overlayver>¬¬{isminuskeyword}-K{}{isminusunstable}-{}{isminusasterisk}-*{}{isprofilemasked}[P]{}{ismasked}[m]{}{isunstable}~{}{ismissingkeyword}**{}¬¬<version>¬¬<use>{!last}\n{}'
+ IVERS='Instd¬¬<overlayname><overlayver>¬¬{isminuskeyword}-K{}{isminusunstable}-{}{isminusasterisk}-*{}{isprofilemasked}[P]{}{ismasked}[m]{}{isunstable}~{}{ismissingkeyword}**{}¬¬<version>¬¬<use*>{!last}\n{}'
format='Categ¬¬<category>\nPacka¬¬<name>¬¬<description>¬¬<homepage>\n<availableversions:AVERS>\n<installedversions:IVERS>\n'
ENV={'AVERS':AVERS,'IVERS':IVERS,'HOME':'$HOME'}
options.append('--format')
options.append(format)
self.s_pbar.setValue(0)
self.redraw_window()
+ if debug:print(options)
process=Popen(options,encoding='utf-8',stdout=PIPE,env=ENV)
data,excd=process.communicate()
if excd is not None or len(data)<17:
results=data.split('\n')
self.s_pbar.setMaximum(len(results))
try:
- self.s_lcd_results.display(results[len(results)-2].split(' ')[1])
+ self.s_lcd_results.display(int(results[len(results)-2].split(' ')[1]))
except IndexError:
self.s_lcd_results.display(1)
+ except ValueError:
+ self.s_lcd_results.display(1)
dataset=[]
cats=[]
uid=count=puid=ppuid=1
for result in results:
+ if debug:print(result)
if result[0:7]=='Categ¬¬':
cat_name=result.split('¬¬')[1]
if cat_name not in cats:
puid=cats.index(cat_name)+1
elif result[0:7]=='Packa¬¬':
data=result.split('¬¬')
+ #if debug:print(data)
if data[1]=='secret-service':data[3]='https://www.secretservice.gov'
dataset.append({'UID':uid,'PUID':puid,'Cat':cats[puid-1],'Nam':data[1],'Des':data[2],'Hom':data[3]})
ppuid=uid
uid+=1
elif result[0:7]=='Avail¬¬':
+ if debug:print(data)
data=result.split('¬¬')
- dataset.append({'UID':uid,'PUID':ppuid,'Cat':'','Nam':'Available ->','Des':''.join(data[1:4]),'Hom':data[4]})
+ dataset.append({'UID':uid,'PUID':ppuid,'Cat':data[1],'Nam':'Available ->','Des':''.join(data[2:4]),'Hom':data[4]})
uid+=1
elif result[0:7]=='Instd¬¬':
+ if debug:print(data)
data=result.split('¬¬')
- dataset.append({'UID':uid,'PUID':ppuid,'Cat':'','Nam':'Installed ->','Des':''.join(data[1:4]),'Hom':data[4]})
+ dataset.append({'UID':uid,'PUID':ppuid,'Cat':data[1],'Nam':'Installed ->','Des':''.join(data[2:4]),'Hom':data[4]})
uid+=1
elif re.match('^\[[0-9]*?\] "',result):
if 'Overlays' not in cats:
def s_createResultsModel(self):
model=QStandardItemModel()
- model.setHorizontalHeaderLabels(['Category','Name','Description','Homepage' ])
+ model.setHorizontalHeaderLabels(['Category|Overlay','Name|Version Type','Description|Version','Homepage|Use Flags' ])
return model
def s_addResults(self,results):