- Timestamp:
- May 15, 2017, 12:53:26 PM (4 years ago)
- Location:
- lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/infoManager.py
r4394 r4749 3 3 class infomanager: 4 4 def __init__(self): 5 self.dbg= 05 self.dbg=1 6 6 self.pluginInfo={'get_info':'*'} 7 7 self.result={} … … 94 94 if app.get_icon_default(): 95 95 appInfo['icon']=app.get_icon_default().get_name() 96 if appInfo['icon']==None: 97 appInfo['icon']="" 96 98 # if app.get_icon_default(): 97 99 # appInfo['icon']=appInfo['icon']+'/'+app.get_icon_default().get_name() 100 98 101 if app.get_screenshots(): 99 102 thumbnails_list=[] -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/loadStore.py
r4629 r4749 81 81 lliurexApps={} 82 82 for app in applist: 83 #Zomandos get max priority 84 if app.has_category('zomando'): 85 self._debug("Prioritize zmd "+str(app.get_id())) 86 app.set_priority(400) 87 lliurexApps.update({app.get_id_filename():app}) 83 88 #Prioritize Lliurex apps 84 if str(app.get_origin()).find('lliurex')>=0:89 elif app.has_category('Lliurex'): 85 90 self._debug("Prioritize app "+str(app.get_id())) 86 app.set_priority( 100)91 app.set_priority(200) 87 92 lliurexApps.update({app.get_id_filename():app}) 88 elif app.has_category('Lliurex'):93 elif str(app.get_origin()).find('lliurex')>=0: 89 94 self._debug("Prioritize app "+app.get_id()) 90 95 app.set_priority(100) 91 96 lliurexApps.update({app.get_id_filename():app}) 92 97 else: 93 app.set_priority( 10)98 app.set_priority(0) 94 99 if app.get_id_filename() in lliurexApps.keys(): 95 100 # app.set_merge_kind(appstream.AppMergeKind.APPEND) … … 98 103 lliurexApps[app.get_id_filename()].subsume_full(app,appstream.AppSubsumeFlags.BOTH_WAYS) 99 104 store.remove_app(app) 100 # store.remove_app(app)101 105 #Remove apps whitout pkgname 102 106 if not app.get_pkgnames(): -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/plugins/zmdManager.py
r4741 r4749 46 46 def execute_action(self,action,applist): 47 47 self.result['status']={'status':-1,'msg':''} 48 self.result['data']=list(applist) 48 # self.result['data']=list(applist) 49 self.result['data']='' 49 50 if self.disabled: 50 51 self._set_status(9) … … 52 53 count=len(applist) 53 54 try: 55 dataList=[] 54 56 self.n4dclient=self._n4d_connect() 55 57 for appInfo in applist: 56 58 if (action): 57 59 if action=='install': 58 self.result['data'].append(self._install_Zmd(appInfo)) 60 dataList.append(self._install_Zmd(appInfo)) 61 # self.result['data'].append(self._install_Zmd(appInfo)) 59 62 if action=='remove': 60 self.result['data'].append(self._remove_Zmd(appInfo)) 63 dataList.append(self._remove_Zmd(appInfo)) 64 # self.result['data'].append(self._remove_Zmd(appInfo)) 61 65 if action=='pkginfo': 62 self.result['data'].append(self._get_Zmd_Info(appInfo)) 66 dataList.append(self._get_Zmd_Info(appInfo)) 67 # self.result['data'].append(self._get_Zmd_Info(appInfo)) 63 68 except: 64 69 self.disabled=True 65 70 self._set_status(10) 71 self.result['data']=list(dataList) 66 72 self.progress=100 67 73 return(self.result) … … 70 76 def _set_status(self,status,msg=''): 71 77 self.result['status']={'status':status,'msg':msg} 78 # dataList['status']={'status':status,'msg':msg} 72 79 73 80 def _callback(self,zmdLauncher): … … 85 92 zmd=self.zmdPath+'/'+appInfo['package']+'.zmd' 86 93 self._debug("Installing "+str(zmd)) 87 if os.path.exists(zmd): 88 err=0 89 try: 90 zmdsudo=['gksudo',zmd] 91 self._debug("executing "+str(zmdsudo)) 92 zmdCmd=subprocess.Popen(zmdsudo,stdout=subprocess.PIPE,stdin=subprocess.PIPE,stderr=subprocess.PIPE) 93 zmdLauncher=os.path.basename(zmd) 94 zmdLauncher=os.path.splitext(zmdLauncher)[0] 95 while zmdCmd.poll() is None: 96 self._callback(zmdLauncher) 97 time.sleep(0.4) 98 zmdResult=zmdCmd.stdout.read() 99 zmdError=zmdCmd.stderr.read() 100 self._debug("Error: "+str(zmdError)) 101 self._debug("Result: "+str(zmdResult)) 102 appInfo=self._get_Zmd_Info(appInfo) 103 if appInfo['status']!='Installed': 104 err=5 105 except Exception as e: 106 appInfo=self._get_Zmd_Info(appInfo) 107 self._debug(str(e)) 108 if appInfo['status']!='Installed': 109 err=5 94 appInfo=self._get_Zmd_Info(appInfo) 95 if appInfo['state']=='Installed': 96 err=4 110 97 else: 111 err=8 98 if os.path.exists(zmd): 99 err=0 100 try: 101 zmdsudo=['gksudo',zmd] 102 self._debug("executing "+str(zmdsudo)) 103 zmdCmd=subprocess.Popen(zmdsudo,stdout=subprocess.PIPE,stdin=subprocess.PIPE,stderr=subprocess.PIPE) 104 zmdLauncher=os.path.basename(zmd) 105 zmdLauncher=os.path.splitext(zmdLauncher)[0] 106 while zmdCmd.poll() is None: 107 self._callback(zmdLauncher) 108 time.sleep(0.4) 109 zmdResult=zmdCmd.stdout.read() 110 zmdError=zmdCmd.stderr.read() 111 self._debug("Error: "+str(zmdError)) 112 self._debug("Result: "+str(zmdResult)) 113 except Exception as e: 114 self._debug(str(e)) 115 finally: 116 appInfo=self._get_Zmd_Info(appInfo) 117 if appInfo['state']!='Installed': 118 err=5 119 else: 120 err=8 112 121 self._set_status(err) 113 return err122 return(appInfo) 114 123 #def _install_Zmd 115 124 … … 172 181 if appInfo['status']=='Installed': 173 182 err=6 174 self._set_status(err)175 183 os.remove(zeroScript) 176 return err 184 else: 185 err=6 186 self._set_status(err) 187 return(appInfo) 177 188 #def _remove_Zmd 178 189 … … 187 198 if zmd.lower() in key.lower(): 188 199 if n4dvars[key]['state']==1: 189 appInfo['stat us']='Installed'200 appInfo['state']='Installed' 190 201 else: 191 self._set_status( 0)202 self._set_status(2) 192 203 except: 193 204 self._set_status(10) -
lliurex-store/trunk/fuentes/python3-lliurex-store.install/usr/share/lliurexstore/storeManager.py
r4417 r4749 386 386 # result['data']=[] 387 387 #Only search full info if it's required 388 if (fullsearch==False ):388 if (fullsearch==False and package_type=='deb'): 389 389 # result['data'].extend(typeDict[package_type]) 390 390 continue … … 510 510 if package_type in self.registeredPlugins[action]: 511 511 installFunction=self._execute_class_method(action,package_type,action) 512 if package_type=='zmd': 513 #If it's a zmd the zomando must be present in the system 514 zmdAppInfo=[] 515 for zmdPackage in typeDict[package_type]: 516 zmdInfo={} 517 self._debug("Cheking presence of zmd "+ zmdPackage['package']) 518 zmd='/usr/share/zero-center/zmds/'+appInfo['package']+'.zmd' 519 if not os.path.exists(zmd): 520 zmdInfo['package']=zmdPackage['package'] 521 zmdAppInfo.append(zmdInfo) 522 if zmdAppInfo: 523 self._debug("Installing needed packages") 524 installAuxFunction=self._execute_class_method(action,"deb",action) 525 result=installAuxFunction.execute_action(action,zmdAppInfo) 526 512 527 result=installFunction.execute_action(action,typeDict[package_type]) 513 528 self.result[action]=result
Note: See TracChangeset
for help on using the changeset viewer.