Changeset 3170
- Timestamp:
- Dec 28, 2016, 2:36:01 PM (4 years ago)
- Location:
- lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins/debManager.py
r3105 r3170 49 49 self._log("Dependencies to remove"+str(appInfo['depends'])) 50 50 self._remove_App(app) 51 # if action=='pkginfo' and self.count==1:52 51 if action=='pkginfo': 53 52 self._get_App_Dependencies(appInfo,app) 54 # if action=='pkginfo':55 # self._get_App_Info(appInfo,app,count)56 53 self.progress=self.progress+(self.partialProgress/self.count) 57 54 self._debug("Progress: "+str(self.progress)) 58 55 self.progress=100 59 56 return(self.result) 57 #def execute_action 60 58 61 59 def _callback(self,status,typ,data=None): … … 63 61 self.progress=self.partialProgress/self.count 64 62 self._debug("Progress"+str(self.partialProgress)) 65 66 def initialize_list(self): 67 self.pkgList=[] 68 #def initialize_list 63 #def _callback 69 64 70 65 def _install_App(self,app): … … 105 100 # return(dependsList) 106 101 return(appInfo) 102 #def _get_App_Dependencies 107 103 108 104 def _get_App_Info(self,appInfo,app,appsCount=0): … … 117 113 self.result.append(appInfo) 118 114 return(appInfo) 115 #def _get_App_Info 119 116 120 117 def _resolve_App(self,appName,filters=False): -
lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins/loadStore.py
r3151 r3170 30 30 self.store=appstream.Store() 31 31 if action=='load': 32 self. load_store(self.store)32 self._load_store(self.store) 33 33 self.progress=100 34 34 return (self.store) 35 35 #def execute_action 36 36 37 def load_store(self,store):37 def _load_store(self,store): 38 38 iconPath='/usr/share/icons/hicolor/128x128' 39 flags=[appstream.StoreLoadFlags.APP_INFO_SYSTEM,appstream.StoreLoadFlags.APP_INSTALL,appstream.StoreLoadFlags.APP_INFO_USER,appstream.StoreLoadFlags.DESKTOP ]39 flags=[appstream.StoreLoadFlags.APP_INFO_SYSTEM,appstream.StoreLoadFlags.APP_INSTALL,appstream.StoreLoadFlags.APP_INFO_USER,appstream.StoreLoadFlags.DESKTOP,appstream.StoreLoadFlags.APPDATA,appstream.StoreLoadFlags.ALLOW_VETO] 40 40 for flag in flags: 41 41 try: 42 self._debug("Loading "+str(flag)) 42 43 store.load(flag) 43 44 except: 44 45 print ("Failed to load"+str(flag)) 45 46 pass 46 lliurex_dir="/usr/share/app-info/xmls2" 47 store.set_origin('lliurex') 48 if os.path.exists(lliurex_dir): 49 for lliurex in os.listdir(lliurex_dir): 50 # if lliurex.endswith('.yml'): 51 if lliurex.endswith('.xml') or lliurex.endswith('.yml'): 52 storePath=Gio.File.new_for_path(lliurex_dir+'/'+lliurex) 53 self._debug("Adding file "+lliurex_dir+'/'+lliurex) 54 try: 55 store.from_file(storePath,iconPath,None) 56 except Exception as e: 57 self._debug("Couldn't add file "+lliurex+" to store") 58 self._debug("Reason: "+str(e)) 59 pass 47 # store.load(appstream.StoreLoadFlags.APPDATA) 48 # store.load(appstream.StoreLoadFlags.APP_INFO_SYSTEM) 49 # store.load(appstream.StoreLoadFlags.APP_INSTALL) 50 # store.load(appstream.StoreLoadFlags.APP_INFO_USER) 51 # store.load(appstream.StoreLoadFlags.DESKTOP) 52 # store.load(appstream.StoreLoadFlags.ALLOW_VETO) 53 # 54 # store.load(appstream.StoreLoadFlags.APP_INFO_SYSTEM|appstream.StoreLoadFlags.APP_INSTALL|appstream.StoreLoadFlags.APP_INFO_USER|appstream.StoreLoadFlags.DESKTOP|appstream.StoreLoadFlags.APPDATA|appstream.StoreLoadFlags.ALLOW_VETO) 55 # try: 56 # store.load_path("/var/lib/apt/lists/",None) 57 # except e as Exception: 58 # print (e.message) 59 # lliurex_dir="/usr/share/app-info/xmls2" 60 # store.set_origin('lliurex') 61 # if os.path.exists(lliurex_dir): 62 # for lliurex in os.listdir(lliurex_dir): 63 # # if lliurex.endswith('.yml'): 64 # if lliurex.endswith('.xml') or lliurex.endswith('.yml'): 65 # storePath=Gio.File.new_for_path(lliurex_dir+'/'+lliurex) 66 # self._debug("Adding file "+lliurex_dir+'/'+lliurex) 67 # try: 68 # store.from_file(storePath,iconPath,None) 69 # except Exception as e: 70 # self._debug("Couldn't add file "+lliurex+" to store") 71 # self._debug("Reason: "+str(e)) 72 # pass 60 73 store=self._sanitize_store(store) 61 74 self.store=store -
lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins/searchManager.py
r3169 r3170 115 115 app=self.store.get_app_by_id(appName) 116 116 if not app: 117 #2.- Try with exact match with oorg.lliurex 118 app=self.store.get_app_by_id("org.lliurex."+appName) 119 if not app: 117 120 #2.- Try with exact match with .desktop 118 app=self.store.get_app_by_id(appName+".desktop")121 app=self.store.get_app_by_id(appName+".desktop") 119 122 return(app) 120 123 -
lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins/shManager.py
r3099 r3170 26 26 def register(self): 27 27 return(self.pluginInfo) 28 #def register 28 29 29 def install_App(self,appUrl): 30 def execute_action(self,action,applist): 31 count=len(applist) 32 if (action): 33 if action=='install': 34 self._install_App(appInfo) 35 self.progress=100 36 return(self.result) 37 #def execute_action 38 39 def _install_App(self,appInfo): 30 40 return_msg=False 41 appUrl=appinfo['installerUrl'] 31 42 self.debug("Checking availabilty for "+appUrl) 32 43 tmpDir=tempfile.mkdtemp(None,None,'/tmp') 33 44 fileName=appUrl.split('/')[-1] 34 45 dest_path=tmpDir+'/'+fileName 35 if self. download_App(appUrl,dest_path):46 if self._download_App(appUrl,dest_path): 36 47 os.chdir(tmpDir) 37 48 os.chmod(dest_path, stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR) 38 #def install_ Standalone_App49 #def install_App 39 50 40 def download_App(self,appUrl,dest_path=None):51 def _download_App(self,appUrl,dest_path=None): 41 52 appUrl.strip() 42 53 if not dest_path: … … 51 62 return_msg=False 52 63 return return_msg 53 #def download_App64 #def _download_App -
lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins/zmdManager.py
r3169 r3170 32 32 def register(self): 33 33 return(self.pluginInfo) 34 #def register 34 35 35 36 def execute_action(self,action,applist): … … 48 49 self.progress=100 49 50 return(self.result) 51 #def execute_action 50 52 51 53 def _callback(self,zmdLauncher): … … 58 60 inc=round(margin/limit,3) 59 61 self.progress=self.progress+inc 62 #def _callback 60 63 61 64 def _install_Zmd(self,appInfo): … … 76 79 self._debug("Result: "+str(zmdResult)) 77 80 appInfo=self._get_Zmd_Info(appInfo) 78 appInfo=self._get_Zmd_Info(appInfo)79 81 if appInfo['status']=='Installed': 80 82 self.result=[{appInfo['name']:" installed succesfully"}] … … 88 90 else: 89 91 self.result=[{appInfo['name']:" failed to install"}] 92 #def _install_Zmd 90 93 91 94 def _remove_Zmd(self,appInfo): … … 99 102 for line in f: 100 103 if 'PACKAGE_LIST=' in line: 101 sw_continue= False104 sw_continue=True 102 105 packagelist=line.split('=')[-1] 103 106 packagelist=packagelist.replace('"','') … … 122 125 for pkg in removePackages: 123 126 f3.write('/usr/bin/zero-installer remove '+pkg+"\n") 127 f3.write ("zero-center set-non-configured "+appInfo['package']+"\n") 124 128 f3.close() 125 129 os.chmod(zeroScript,stat.S_IEXEC|stat.S_IREAD|stat.S_IWRITE|stat.S_IROTH|stat.S_IWOTH|stat.S_IXOTH|stat.S_IRGRP|stat.S_IWGRP|stat.S_IXGRP) … … 140 144 self._debug("Result: "+str(zmdResult)) 141 145 self._debug("Error: "+str(zmdError)) 146 appInfo=self._get_Zmd_Info(appInfo) 147 if appInfo['status']=='Installed': 148 self.result=[{appInfo['name']:" failed to remove"}] 149 else: 150 self.result=[{appInfo['name']:" removed succesfully"}] 151 os.remove(zeroScript) 152 #def _remove_Zmd 142 153 143 154 def _get_Zmd_Info(self,appInfo): … … 151 162 self.result.append(appInfo) 152 163 return(appInfo) 153 164 #def _get_Zmd_Info 165 154 166 def _n4d_connect(self): 155 167 #Setup SSL … … 157 169 n4dclient = n4d.ServerProxy("https://localhost:9779",context=context) 158 170 return(n4dclient) 171 #def _n4d_connect
Note: See TracChangeset
for help on using the changeset viewer.