def printDirs(): D = read_spr_page.getproject() dirs = D['dirlist'] #print dirs for dir in dirs: print dir procs, subdirs = D[dir] for sub in subdirs: print " " + sub
def printDirs(): D = read_spr_page.getproject() dirs = D['dirlist'] #print dirs for dir in dirs: print dir procs, subdirs = D[dir] for sub in subdirs: print " " + sub
def printAll(): D = read_spr_page.getproject() dirs = D['dirlist'] #print dirs for dir in dirs: print dir procs, subdirs = D[dir] for proc in procs: print " " + proc for sub in subdirs: print " " + sub + "/"
def printAll(): D = read_spr_page.getproject() dirs = D['dirlist'] #Print dirs for dir in dirs: print dir procs, subdirs = D[dir] for proc in procs: print " " + proc for sub in subdirs: print " " + sub + "/"
def __init__(self, target, source=None, dirobj=None, ask=1): # initialize some variables self.write_all = 0 self.quit = 0 self.cwd = os.getcwd() if source == None: source = SpiderBatchDir if not os.path.exists(source): self.displayerror('Error', "UNABLE TO FIND BATCH DIRECTORY " + source) return if dirobj != None: D = dirobj else: D = read_spr_page.getproject() # make the main project directory (target) os.chdir(self.cwd) if os.path.exists(target) != 1: if ask: self.displayerror(message="Directory %s not found." % (target)) askstr = "Create " + target + " and subdirectories? (y/n): " yn = self.askinput(askstr) else: yn = 'y' if yn == 'y' or yn == 'Y': #print "ok" try: os.mkdir(target, 0775) except: self.displayerror(message='Error: Unable to create ' + target) return else: return target = os.path.abspath(target) os.chdir(target) # make the subdirectories and load the batch files dirlist = D['dirlist'] for dir in dirlist: if dir == topleveldir: # the top-level project directory procs, subdirs = D[dir] if len(procs) > 0: self.loadBatch(target, procs, source) if self.quit: return else: if not self.makeDirectory(dir): return procs, subdirs = D[dir] if len(procs) > 0: self.loadBatch(dir, procs, source) if self.quit: return if len(subdirs) > 0: os.chdir(dir) for subdir in subdirs: self.makeDirectory(subdir) if self.quit: return os.chdir(target)
def __init__(self, target, source=None, dirobj=None, ask=1): # Initialize some variables self.write_all = 0 self.quit = 0 self.cwd = os.getcwd() if source == None: source = SpiderBatchDir if not os.path.exists(source): self.displayerror('Error', " UNABLE TO FIND PROCEDURE DIRECTORY " + source) return if dirobj != None: D = dirobj else: D = read_spr_page.getproject() # Make the main project directory (target) os.chdir(self.cwd) if os.path.exists(target) != 1: if ask: self.displayerror(message=" Directory %s not found." % (target)) askstr = "Create " + target + " and subdirectories? (y/n): " yn = self.askinput(askstr) else: yn = 'y' if yn == 'y' or yn == 'Y': #Print "ok" try: os.mkdir(target, 0775) except: self.displayerror(message=' Error: Unable to create: ' + target) return else: return target = os.path.abspath(target) os.chdir(target) # Make the subdirectories and load the batch files dirlist = D['dirlist'] for dir in dirlist: if dir == topleveldir: # The top-level project directory procs, subdirs = D[dir] if len(procs) > 0: self.loadBatch(target, procs, source) if self.quit: return else: if not self.makeDirectory(dir): return procs, subdirs = D[dir] if len(procs) > 0: self.loadBatch(dir, procs, source) if self.quit: return if len(subdirs) > 0: os.chdir(dir) for subdir in subdirs: self.makeDirectory(subdir) if self.quit: return os.chdir(target)