Changeset 3093 for lliurex-store/trunk/fuentes/lliurex-appstore.install/usr
- Timestamp:
- Dec 16, 2016, 12:47:01 PM (4 years ago)
- Location:
- lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins/debManager.py
r3060 r3093 10 10 self.progress=0 11 11 self.partialProgress=0 12 self.pluginInfo=['install','deb','remove','deb','pkginfo','deb','remove','zmd'] 12 #self.pluginInfo=['install','deb','remove','deb','pkginfo','deb','remove','zmd'] 13 self.pluginInfo=['install','deb','remove','deb','pkginfo','deb'] 13 14 self.count=0 14 15 #def __init__ -
lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/plugins/zmdManager.py
r3060 r3093 14 14 self.dbg=1 15 15 self.zmdPath='/usr/share/zero-center/zmds' 16 self.pluginInfo=['install','zmd','pkginfo','zmd' ]16 self.pluginInfo=['install','zmd','pkginfo','zmd','remove','zmd'] 17 17 self.progress=0 18 18 self.n4dclient='' … … 27 27 def _debug(self,msg=''): 28 28 if self.dbg==1: 29 print ('_debug Zmd: '+ msg)29 print ('_debug Zmd: '+str(msg)) 30 30 #def _debug 31 31 … … 42 42 if action=='install': 43 43 self._install_Zmd(appInfo) 44 if action=='remove': 45 self._remove_Zmd(appInfo) 44 46 if action=='pkginfo': 45 47 self._get_Zmd_Info(appInfo) … … 74 76 if not zmdError: 75 77 # zmdCmd.wait() 76 77 zmdCmd.task_done()78 78 self.result=[{appInfo['name']:" installed succesfully"}] 79 79 else: … … 89 89 else: 90 90 self.result=[{appInfo['name']:" failed to install"}] 91 92 def _remove_Zmd(self,appInfo): 93 zmd=appInfo['installerUrl'] 94 self._debug("Removing "+str(zmd)) 95 os.chdir(self.zmdPath) 96 sw_continue=False 97 try: 98 removePackages=[] 99 f=open(zmd,'r') 100 for line in f: 101 if 'PACKAGE_LIST=' in line: 102 sw_continue=False 103 packagelist=line.split('=')[-1] 104 packagelist=packagelist.replace('"','') 105 packagelist=packagelist[:-1] 106 #We've the file with the packagelist, now it's time to read the list 107 print("Obtaining packages in : "+packagelist) 108 f2=open (packagelist,'r') 109 for line2 in f2: 110 pkg=line2.split(' ')[0] 111 pkg=pkg.split("\t")[0] 112 pkg=pkg.replace('"','') 113 print("Append: "+pkg) 114 removePackages.append(pkg) 115 f2.close() 116 f.close() 117 except Exception as e: 118 print(str(e)) 119 if sw_continue: 120 zeroScript='/tmp/zeroScript' 121 f3=open(zeroScript,'w') 122 f3.write('#!/bin/bash'+"\n") 123 for pkg in removePackages: 124 f3.write('/usr/bin/zero-installer remove '+pkg+"\n") 125 f3.close() 126 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) 127 zmdsudo=['gksudo',zeroScript] 128 try: 129 self._debug("Executing "+str(zmdsudo)) 130 zmdLauncher=os.path.basename(zmd) 131 zmdLauncher=os.path.splitext(zmdLauncher)[0] 132 zmdCmd=subprocess.Popen(zmdsudo,stdout=subprocess.PIPE,stdin=subprocess.PIPE,stderr=subprocess.PIPE) 133 self._debug("Launched") 134 while zmdCmd.poll() is None: 135 self._callback(zmdLauncher) 136 time.sleep(0.2) 137 zmdResult=zmdCmd.stdout.read() 138 zmdError=zmdCmd.stderr.read() 139 except Exception as e: 140 print(str(e)) 141 self._debug("Result: "+str(zmdResult)) 142 self._debug("Error: "+str(zmdError)) 91 143 92 144 def _get_Zmd_Info(self,appInfo): -
lliurex-store/trunk/fuentes/lliurex-appstore.install/usr/bin/storeManager.py
r3078 r3093 33 33 else: 34 34 self.locale=[locale.getlocale()[0],'ca@valencia','ca','es','es_ES','C'] 35 self.dbg= 035 self.dbg=1 36 36 self.threads={} #Dict that stores the functions that must execute each action 37 37 self.threadsProgress={} #"" "" "" the progress for each launched thread
Note: See TracChangeset
for help on using the changeset viewer.