Changeset 3669
- Timestamp:
- Feb 20, 2017, 12:01:30 PM (4 years ago)
- Location:
- lliurex-store/trunk/fuentes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-store/trunk/fuentes/lliurex-store-cli/usr/share/lliurex-store/files/blacklist.json
r3661 r3669 1 { 2 "server": [ 3 "epoptes", 4 "lliurex-pmb", 5 "zero-lliurex-pmb-installer", 6 "zero-lliurex-pmb", 7 "opac" 8 ] 9 } -
lliurex-store/trunk/fuentes/lliurex-store-cli/usr/share/lliurex-store/lliurex-store-cli.py
r3663 r3669 33 33 if action=='info': 34 34 try: 35 print(color. BOLD+u'Package'+': '+color.END + data['package'])35 print(color.DARKCYAN+u'Package'+': '+color.END + data['package']) 36 36 print(u'Name'+': '+data['name']) 37 37 print(u'Version'+': '+data['version']) … … 54 54 elif action=='search': 55 55 #Only print name and summary 56 print(color. BOLD+data['package']+color.END+": "+data['summary'])56 print(color.DARKCYAN+data['package']+color.END+": "+data['summary']) 57 57 elif action=='list': 58 58 #Print package, summary and status … … 62 62 else: 63 63 package=data['name'] 64 print(color. BOLD+package+color.END+": "+data['summary']+' ('+','.join(data['categories'])+')'+' ('+data['state']+')')64 print(color.DARKCYAN+package+color.END+": "+data['summary']+' ('+','.join(data['categories'])+')'+' ('+data['state']+')') 65 65 except Exception as e: 66 66 print('Error listing :'+str(e)) -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/loadStore.py
r3663 r3669 5 5 from gi.repository import AppStreamGlib as appstream 6 6 import subprocess 7 import json 7 8 8 9 class loadstore: … … 22 23 def _debug(self,msg=''): 23 24 if self.dbg==1: 24 print ('DEBUG Load: '+ msg)25 print ('DEBUG Load: '+str(msg)) 25 26 #def _debug 26 27 … … 39 40 def get_error(self): 40 41 return (self.error) 42 #def get_error 41 43 42 44 def _load_store(self,store): … … 55 57 #def load_store 56 58 57 def _parse_desktop(self,store): #DEPRECATED 59 def _parse_desktop(self,store): #DEPRECATED. Loads the apps from the available desktop files 58 60 desktopDir='/usr/share/applications' 59 61 return(store) … … 73 75 74 76 def _sanitize_store(self,store): 75 apps_to_remove=[]76 77 applist=store.get_apps() 77 78 for app in applist: … … 79 80 store.remove_app(app) 80 81 #Check the blacklist 81 # flavour=subprocess.check_output(["lliurex-version","-f"]).rstrip() 82 82 try: 83 flavour=subprocess.check_output(["lliurex-version","-f"]).rstrip() 84 flavour=flavour.decode("utf-8") 85 if os.path.isfile('/usr/share/lliurex-store/files/blacklist.json'): 86 blFile=open('/usr/share/lliurex-store/files/blacklist.json').read() 87 blacklist=json.loads(blFile) 88 blApps=blacklist[flavour] 89 for blApp in blApps: 90 self._debug("Blacklisted app: "+blApp) 91 app=store.get_app_by_pkgname(blApp) 92 if app: 93 self._debug("Removed "+str(app)) 94 store.remove_app(app) 95 else: 96 self._debug("App "+blApp+" from blacklist not found in store") 97 else: 98 self._debug('No blacklist to check') 99 except subprocess.CalledProcessError as e: 100 print(u"Running on a non Lliurex host") 101 except Exception as e: 102 self._debug("Error processing blacklist: "+str(e)) 83 103 return (store) 84 104 #def _sanitize_store
Note: See TracChangeset
for help on using the changeset viewer.