def remove(self, vertexList): ''' Removes build-relevant information associated with vertices in vertexList. Returns 0 upon success, 1 otherwise. ''' import glob project, pgraph = Globals().getProjectAndGraph(self.project.getName()) projectDir = project.getDir() for vertex in vertexList: print >>DEBUGSTREAM, 'removing build system artifacts for ' + vertex.symbol if vertex.kind in ['interface','port', 'enum']: mydir = os.path.join(projectDir,self.locationManager.getPortLoc()[0]) libs = glob.glob(os.path.join(mydir, 'lib', 'lib' + vertex.symbol + 'Port-*.la')) libs += glob.glob(os.path.join(mydir, 'lib', '*', 'lib' + vertex.symbol + 'Port-*.*')) for lib in libs: try: fileManager.rmdir(lib,trash=False,nobackup=True) except: pass elif vertex.kind in ['class','component']: mydir = os.path.join(projectDir,self.locationManager.getComponentLoc()[0]) libs = glob.glob(os.path.join(mydir, 'lib', 'lib' + vertex.symbol + '.*')) for lib in libs: try: fileManager.rm(lib,trash=False,nobackup=True) except: pass else: return 0 if os.path.exists(os.path.join(mydir,vertex.symbol)): try: fileManager.rmdir(os.path.join(mydir,vertex.symbol),trash=True) except: pass return 0
def updateProjectInfo(self): from cct._util import Globals project = Globals().getProject(projectName=self.projectName) if project is not None: self.projectDir = project.getDir() pass