bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def priority13(): # rat ortholog (symbol) print 'processing priority 13...%s' % mgi_utils.date() cmd = 'select o.*, label = m.symbol, labelTypeName = s.commonName + " ortholog symbol" ' + \ 'from #orthology2 o, MRK_Marker m, MGI_Organism s ' + \ 'where o.m2 = m._Marker_key ' + \ 'and o._OrthologOrganism_key = s._Org...
def priority13(): # rat ortholog (symbol) print 'processing priority 13...%s' % mgi_utils.date() cmd = 'select o.*, label = m.symbol, labelTypeName = s.commonName + " ortholog symbol" ' + \ 'from #orthology2 o, MRK_Marker m, MGI_Organism s ' + \ 'where o.m2 = m._Marker_key ' + \ 'and o._OrthologOrganism_key = s._Org...
30,400
def priority10(): # mouse synonyms (similar, broad, narrow) print 'processing priority 10...%s' % mgi_utils.date() cmd = 'select _Marker_key = s._Object_key, st._Organism_key, _OrthologOrganism_key = NULL, label = s.synonym ' + \ 'from MGI_SynonymType st, MGI_Synonym s ' + \ 'where st._MGIType_key = 2 ' + \ 'and st....
def priority10(): # mouse synonyms (similar, broad, narrow) print 'processing priority 10...%s' % mgi_utils.date() cmd = 'select distinct _Marker_key = s._Object_key, st._Organism_key, _OrthologOrganism_key = NULL, label = s.synonym ' + \ 'from MGI_SynonymType st, MGI_Synonym s ' + \ 'where st._MGIType_key = 2 ' + \...
30,401
def priority10(): # mouse synonyms (similar, broad, narrow) print 'processing priority 10...%s' % mgi_utils.date() cmd = 'select _Marker_key = s._Object_key, s._Organism_key, _OrthologOrganism_key = NULL, label = s.synonym ' + \ 'from MGI_SynonymType st, MGI_Synonym s ' + \ 'where st._MGIType_key = 2 ' + \ 'and st._...
def priority10(): # mouse synonyms (similar, broad, narrow) print 'processing priority 10...%s' % mgi_utils.date() cmd = 'select _Marker_key = s._Object_key, st._Organism_key, _OrthologOrganism_key = NULL, label = s.synonym ' + \ 'from MGI_SynonymType st, MGI_Synonym s ' + \ 'where st._MGIType_key = 2 ' + \ 'and st....
30,402
def makeWallpapersList(path): """ Do a wallpaper list: from directory, file with list and from image. """ walFormats = ['image/jpeg', 'image/png'] if os.path.isdir(path): fileList = [] for root, dirs, files in os.walk(path): for fileName in files: fileList.append(os.path.join(root, fileName)) return fileList if gues...
def makeWallpapersList(path): """ Do a wallpaper list: from directory, file with list and from image. """ walFormats = ['image/jpeg', 'image/png'] if os.path.isdir(path): fileList = [] for root, dirs, files in os.walk(path): for fileName in files: if guess_type(os.path.join(root,fileName))[0] in walFormats: fileList....
30,403
def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specifie...
def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specifie...
30,404
def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specifie...
def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specifie...
30,405
def doAction(options, config): """ Do specified in options action and return modified config """ try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specified tool in database' if options.export: for wal in config['wa...
def doAction(options, config): """ Do specified in options action and return modified config """ try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specified tool in database' if options.export: for wal in config['wa...
30,406
def doAction(options, config): """ Do specified in options action and return modified config """ try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specified tool in database' if options.export: for wal in config['wa...
def doAction(options, config): """ Do specified in options action and return modified config """ try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specified tool in database' if options.export: for wal in config['wa...
30,407
def createConfiguration(): """ Create empty configuration. """ tools = ['hsetroot -fill FILENAME', 'habak -i FILENAME -S', 'Esetroot FILENAME'] try: defTool = [tool.split()[0] for tool in tools if not \ os.system('which %s &>/dev/null' % tool.split()[0])][0] except: raise ParseError, 'Cannot find any usable tool to s...
def createConfiguration(): """ Create empty configuration. """ tools = ['hsetroot -fill FILENAME', 'habak -hi FILENAME -mS', 'Esetroot FILENAME'] try: defTool = [tool.split()[0] for tool in tools if not \ os.system('which %s &>/dev/null' % tool.split()[0])][0] except: raise ParseError, 'Cannot find any usable tool to...
30,408
def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specifie...
def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specifie...
30,409
def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specifie...
def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specifie...
30,410
def __init__(self): """ """ self.__label = "Un moment..." self.startSignal = Signal() self.refreshSignal = Signal() self.finishSignal = Signal()
defself.NbrJobsSignal = Signal() __init__(self):self.NbrJobsSignal = Signal() """self.NbrJobsSignal = Signal() """self.NbrJobsSignal = Signal() self.__labelself.NbrJobsSignal = Signal() =self.NbrJobsSignal = Signal() "Unself.NbrJobsSignal = Signal() moment..."self.NbrJobsSignal = Signal() self.startSignalself.NbrJobsSi...
30,411
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, max(1,len(List)))
defelse: if os.path.splitext(File)[1] in config.Extensions: AlsoProcess+=1 start(self,List):else: if os.path.splitext(File)[1] in config.Extensions: AlsoProcess+=1 """else: if os.path.splitext(File)[1] in config.Extensions: AlsoProcess+=1 Lanceelse: if os.path.splitext(File)[1] in config.Extensions: AlsoProcess+=1 ...
30,412
def __init__(self): """ """ self.__label = "Rangement photo" self.startSignal = Signal() self.refreshSignal = Signal() self.finishSignal = Signal()
defself.NbrJobsSignal = Signal() __init__(self):self.NbrJobsSignal = Signal() """self.NbrJobsSignal = Signal() """self.NbrJobsSignal = Signal() self.__labelself.NbrJobsSignal = Signal() =self.NbrJobsSignal = Signal() "Rangementself.NbrJobsSignal = Signal() photo"self.NbrJobsSignal = Signal() self.startSignalsel...
30,413
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,414
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,415
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,416
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,417
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,418
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,419
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
defstart(self,List):"""Lancelescalculs"""self.startSignal.emit(self.__label,len(List))
30,420
def updateProgressBar(self,h,filename): """ Mise jour de la progressbar Dans le cas d'un toolkit, c'est ici qu'il faudra appeler le traitement des vnements. set the progress-bar to the given value with the given name @param h: current number of the file @type val: integer or float @param name: name of the current elem...
def updateProgressBar(self,h,filename): """ Mise jour de la progressbar Dans le cas d'un toolkit, c'est ici qu'il faudra appeler le traitement des vnements. set the progress-bar to the given value with the given name @param h: current number of the file @type val: integer or float @param name: name of the current elem...
30,421
def ScaleImage(filename): """common processing for one image : create a subfolder "scaled" and "thumb" : """ print "Gnration des vignettes pour %s "%filename config=Config() rootdir=os.path.dirname(filename) scaledir=os.path.join(rootdir,config.ScaledImages["Suffix"]) thumbdir=os.path.join(rootdir,config.Thumbnails["Su...
def ScaleImage(filename): """common processing for one image : create a subfolder "scaled" and "thumb" : """ config=Config() rootdir=os.path.dirname(filename) scaledir=os.path.join(rootdir,config.ScaledImages["Suffix"]) thumbdir=os.path.join(rootdir,config.Thumbnails["Suffix"]) if not os.path.isdir(scaledir) : mkdir(s...
30,422
def SplitIntoPages(pathday) """Split a directory (pathday) into pages of 20 images""" files=[] for i in os.listdir(pathday): if os.path.splitext(i)[1] in config.Extensions:files.append(i) files.sort() if len(files)>config.NbrPerPage: pages=1+(len(files)-1)/config.NbrPerPage for i in range(1, pages+1): folder=os.path....
def SplitIntoPages(pathday): """Split a directory (pathday) into pages of 20 images""" files=[] for i in os.listdir(pathday): if os.path.splitext(i)[1] in config.Extensions:files.append(i) files.sort() if len(files)>config.NbrPerPage: pages=1+(len(files)-1)/config.NbrPerPage for i in range(1, pages+1): folder=os.path...
30,423
def SplitIntoPages(pathday) """Split a directory (pathday) into pages of 20 images""" files=[] for i in os.listdir(pathday): if os.path.splitext(i)[1] in config.Extensions:files.append(i) files.sort() if len(files)>config.NbrPerPage: pages=1+(len(files)-1)/config.NbrPerPage for i in range(1, pages+1): folder=os.path....
def SplitIntoPages(pathday) """Split a directory (pathday) into pages of 20 images""" files=[] for i in os.listdir(pathday): if os.path.splitext(i)[1] in config.Extensions:files.append(i) files.sort() if len(files)>config.NbrPerPage: pages=1+(len(files)-1)/config.NbrPerPage for i in range(1, pages+1): folder=os.path....
30,424
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,425
def larg(self): """width-height of a jpeg file""" x,y=self.taille() return x-y
def larg(self): """width-height of a jpeg file""" x,y=self.taille() return x-y
30,426
def taille(self): """width and height of a jpeg file""" self.LoadPIL() self.x,self.y=self.f.size return self.x,self.y
def taille(self): """width and height of a jpeg file""" self.LoadPIL() self.x,self.y=self.f.size return self.x,self.y
30,427
def Trash(self): """Send the file to the trash folder""" config=Config() Trashdir=os.path.join(config.DefaultRepository,config.TrashDirectory) td=os.path.dirname(os.path.join(Trashdir,self.filename)) tf=os.path.join(Trashdir,self.filename) if not os.path.isdir(td): makedir(td) shutil.move(self.fn,os.path.join(Trashdir,...
def Trash(self): """Send the file to the trash folder""" Trashdir=os.path.join(self.config.DefaultRepository,self.config.TrashDirectory) td=os.path.dirname(os.path.join(Trashdir,self.filename)) tf=os.path.join(Trashdir,self.filename) if not os.path.isdir(td): makedir(td) shutil.move(self.fn,os.path.join(Trashdir,self.f...
30,428
def exif(self): """return exif data + title from the photo""" clef={ 'Image Make': 'Marque', 'Image Model': 'Modele', 'Image DateTime': 'Heure', 'EXIF Flash':'Flash', 'EXIF FocalLength': 'Focale', 'EXIF FNumber': 'Ouverture', 'EXIF ExposureTime' :'Vitesse', 'EXIF ISOSpeedRatings': 'Iso', 'EXIF ExposureBiasValue': 'Bias...
def exif(self): """return exif data + title from the photo""" clef={ 'Image Make': 'Marque', 'Image Model': 'Modele', 'Image DateTime': 'Heure', 'EXIF Flash':'Flash', 'EXIF FocalLength': 'Focale', 'EXIF FNumber': 'Ouverture', 'EXIF ExposureTime' :'Vitesse', 'EXIF ISOSpeedRatings': 'Iso', 'EXIF ExposureBiasValue': 'Bias...
30,429
def show(self,Xsize=600,Ysize=600): """return a pixbuf to shows the image in a Gtk window""" self.x,self.y=self.taille() pixbuf = gtk.gdk.pixbuf_new_from_file(self.fn) if self.x>Xsize: RX=1.0*Xsize/self.x else : RX=1 if self.y>Ysize: RY=1.0*Ysize/self.y else : RY=1 R=min(RY,RX) if R<1: nx=int(R*self.x) ny=int(R*self.y)...
def show(self,Xsize=600,Ysize=600): """return a pixbuf to shows the image in a Gtk window""" self.taille() pixbuf = gtk.gdk.pixbuf_new_from_file(self.fn) if self.x>Xsize: RX=1.0*Xsize/self.x else : RX=1 if self.y>Ysize: RY=1.0*Ysize/self.y else : RY=1 R=min(RY,RX) if R<1: nx=int(R*self.x) ny=int(R*self.y) scaled_buf=pi...
30,430
def show(self,Xsize=600,Ysize=600): """return a pixbuf to shows the image in a Gtk window""" self.x,self.y=self.taille() pixbuf = gtk.gdk.pixbuf_new_from_file(self.fn) if self.x>Xsize: RX=1.0*Xsize/self.x else : RX=1 if self.y>Ysize: RY=1.0*Ysize/self.y else : RY=1 R=min(RY,RX) if R<1: nx=int(R*self.x) ny=int(R*self.y)...
def show(self,Xsize=600,Ysize=600): """return a pixbuf to shows the image in a Gtk window""" self.x,self.y=self.taille() pixbuf = gtk.gdk.pixbuf_new_from_file(self.fn) R=min(float(Xsize)/self.x,float(Ysize)/self.y) if R<1: nx=int(R*self.x) ny=int(R*self.y) scaled_buf=pixbuf.scale_simple(nx,ny,gtkInterpolation[self.con...
30,431
def ContrastMask(self,outfile): """Ceci est un filtre de debouchage de photographies, aussi appel masque de contraste, il permet de rattrapper une photo trop contrast, un contre jour, ... crit par Jrme Kieffer, avec l'aide de la liste python@aful, en particulier A. Fayolles et F. Mantegazza avril 2006 necessite numarra...
def ContrastMask(self,outfile): """Ceci est un filtre de debouchage de photographies, aussi appel masque de contraste, il permet de rattrapper une photo trop contrast, un contre jour, ... crit par Jrme Kieffer, avec l'aide de la liste python@aful, en particulier A. Fayolles et F. Mantegazza avril 2006 necessite numarra...
30,432
def ContrastMask(self,outfile): """Ceci est un filtre de debouchage de photographies, aussi appel masque de contraste, il permet de rattrapper une photo trop contrast, un contre jour, ... crit par Jrme Kieffer, avec l'aide de la liste python@aful, en particulier A. Fayolles et F. Mantegazza avril 2006 necessite numarra...
def ContrastMask(self,outfile): """Ceci est un filtre de debouchage de photographies, aussi appel masque de contraste, il permet de rattrapper une photo trop contrast, un contre jour, ... crit par Jrme Kieffer, avec l'aide de la liste python@aful, en particulier A. Fayolles et F. Mantegazza avril 2006 necessite numarra...
30,433
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,434
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,435
# def start(self):
# def start(self):
30,436
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
def start(self,List): """ Lance les calculs """ self.startSignal.emit(self.__label, len(List))
30,437
def process_file(file, debug=0): # determine whether it's a JPEG or TIFF data=file.read(4) comment = None is_exif = 0 is_comment = 0 if data[0:4] in ['II*\x00', 'MM\x00*']: # it's a TIFF file file.seek(0) endian=file.read(1) file.read(1) offset=0 elif data[0:2] == '\xFF\xD8': # it's a JPEG file # skip JFIF style header...
def process_file(file, debug=0): # determine whether it's a JPEG or TIFF data=file.read(4) comment = None is_exif = 0 is_comment = 0 if data[0:4] in ['II*\x00', 'MM\x00*']: # it's a TIFF file file.seek(0) endian=file.read(1) file.read(1) offset=0 elif data[0:2] == '\xFF\xD8': # it's a JPEG file # skip JFIF style header...
30,438
def process_file(file, debug=0): # determine whether it's a JPEG or TIFF data=file.read(4) comment = None is_exif = 0 is_comment = 0 if data[0:4] in ['II*\x00', 'MM\x00*']: # it's a TIFF file file.seek(0) endian=file.read(1) file.read(1) offset=0 elif data[0:2] == '\xFF\xD8': # it's a JPEG file # skip JFIF style header...
def process_file(file, debug=0): # determine whether it's a JPEG or TIFF data=file.read(4) comment = None is_exif = 0 is_comment = 0 if data[0:4] in ['II*\x00', 'MM\x00*']: # it's a TIFF file file.seek(0) endian=file.read(1) file.read(1) offset=0 elif data[0:2] == '\xFF\xD8': # it's a JPEG file # skip JFIF style header...
30,439
def runcmd(args): args = [ commands.mkarg(arg) for arg in args ] cmd = " ".join(args) # t = time.time() # print("Executing '%s'." % cmd) (exitstatus, output) = commands.getstatusoutput(cmd) if exitstatus != 0: raise SVKError(cmd, exitstatus >> 8, output) # print("'%s' executed in %s" % (cmd, time.time() - t)) return...
def runcmd(args, mode = Commands): args = [ commands.mkarg(arg) for arg in args ] cmd = " ".join(args) # t = time.time() # print("Executing '%s'." % cmd) (exitstatus, output) = commands.getstatusoutput(cmd) if exitstatus != 0: raise SVKError(cmd, exitstatus >> 8, output) # print("'%s' executed in %s" % (cmd, time.tim...
30,440
def runcmd(args): args = [ commands.mkarg(arg) for arg in args ] cmd = " ".join(args) # t = time.time() # print("Executing '%s'." % cmd) (exitstatus, output) = commands.getstatusoutput(cmd) if exitstatus != 0: raise SVKError(cmd, exitstatus >> 8, output) # print("'%s' executed in %s" % (cmd, time.time() - t)) return...
defoutput = None runcmd(args):output = None argsoutput = None =output = None [output = None commands.mkarg(arg)output = None foroutput = None argoutput = None inoutput = None argsoutput = None ]output = None output = None cmdoutput = None =output = None "output = None ".join(args)output = None output = None #output = N...
30,441
def runcmd(args): args = [ commands.mkarg(arg) for arg in args ] cmd = " ".join(args) # t = time.time() # print("Executing '%s'." % cmd) (exitstatus, output) = commands.getstatusoutput(cmd) if exitstatus != 0: raise SVKError(cmd, exitstatus >> 8, output) # print("'%s' executed in %s" % (cmd, time.time() - t)) return...
def runcmd(args): args = [ commands.mkarg(arg) for arg in args ] cmd = " ".join(args) # t = time.time() # print("Executing '%s'." % cmd) if mode == Commands: (exitstatus, output) = commands.getstatusoutput(cmd) exitstatus >>= 8 elif mode == System: exitstatus = os.system(cmd) if exitstatus != 0: raise SVKError(cmd, ...
30,442
def runcmd(args): args = [ commands.mkarg(arg) for arg in args ] cmd = " ".join(args) # t = time.time() # print("Executing '%s'." % cmd) (exitstatus, output) = commands.getstatusoutput(cmd) if exitstatus != 0: raise SVKError(cmd, exitstatus >> 8, output) # print("'%s' executed in %s" % (cmd, time.time() - t)) return...
def runcmd(args): args = [ commands.mkarg(arg) for arg in args ] cmd = " ".join(args) # t = time.time() # print("Executing '%s'." % cmd) (exitstatus, output) = commands.getstatusoutput(cmd) if exitstatus != 0: raise SVKError(cmd, exitstatus, output) # print("'%s' executed in %s" % (cmd, time.time() - t)) return outp...
30,443
def getexternals(path): svnpath = findsvnpath(finddepotpath(path)) def findexternals(arg, dirname, fnames): import re args = [ Config.svn, 'propget', 'svn:externals', re.sub("^%s" % path, svnpath, dirname) ] try: dirext = runcmd(args) except SVKError: return if dirext == '': return import re for line in re.split('[\n...
def findcopypath(path): info = runcmd([Config.svk, 'info', path]) infodict = {} for line in info.splitlines(): (key, value) = line.split(": ") infodict[key] = value return '/'+infodict['Copied From'].split(', ')[0] def getexternals(path, depotpath): if not depotpath: depotpath = finddepotpath(path) svnpath = findsvnpa...
30,444
def handleexternals(path, handler): extcache = [] toclist = gettocfiles(path) for toc in toclist: tocdir = os.path.dirname(toc) extdestdir = os.path.dirname(tocdir) externals = getexternals(path) for ext,upstream in externals: if upstream in extcache: continue mipath = None for url in mi.byvalue.keys(): i = upstream....
def handleexternals(path, handler, depotpath): extcache = [] toclist = gettocfiles(path) for toc in toclist: tocdir = os.path.dirname(toc) extdestdir = os.path.dirname(tocdir) externals = getexternals(path) for ext,upstream in externals: if upstream in extcache: continue mipath = None for url in mi.byvalue.keys(): i ...
30,445
def handleexternals(path, handler): extcache = [] toclist = gettocfiles(path) for toc in toclist: tocdir = os.path.dirname(toc) extdestdir = os.path.dirname(tocdir) externals = getexternals(path) for ext,upstream in externals: if upstream in extcache: continue mipath = None for url in mi.byvalue.keys(): i = upstream....
def handleexternals(path, handler): extcache = [] toclist = gettocfiles(path) for toc in toclist: tocdir = os.path.dirname(toc) extdestdir = os.path.dirname(tocdir) externals = getexternals(tocdir, tocdir.replace(path, depotpath)) if not externals: continue for ext,upstream in externals: if upstream in extcache: conti...
30,446
def findcopypath(path): return getlastpath('Copied From')
def findcopypath(path): return getlastpath(path, 'Copied From')
30,447
def getlastmergepath(path): return getlastpath('Merged From')
def getlastmergepath(path): return getlastpath(path, 'Merged From')
30,448
def getsvkinfo(path): if not infos.get(path): import types info = runcmd([Config.svk, 'info', path]) infodict = {} for line in info.splitlines(): fields = line.split(": ") if len(fields) != 2: sys.__stderr__.write("Unexpected number of fields in line `%s', skipping." % line) continue key = fields[1] value = fields[2] ...
def getsvkinfo(path): if not infos.get(path): import types, re info = runcmd([Config.svk, 'info', path]) infodict = {} for line in info.splitlines(): fields = line.split(": ") if len(fields) != 2: sys.__stderr__.write("Unexpected number of fields in line `%s', skipping." % line) continue key = fields[1] value = fields...
30,449
def getsvkinfo(path): if not infos.get(path): import types info = runcmd([Config.svk, 'info', path]) infodict = {} for line in info.splitlines(): fields = line.split(": ") if len(fields) != 2: sys.__stderr__.write("Unexpected number of fields in line `%s', skipping." % line) continue key = fields[1] value = fields[2] ...
def getsvkinfo(path): if not infos.get(path): import types info = runcmd([Config.svk, 'info', path]) infodict = {} for line in info.splitlines(): m = re.match('([^:]+): (.*)$', line) key = m.group(1) value = m.group(2) val = infodict.get(key) if val: if type(val) == types.ListType: val.append(value) else: infodict[key...
30,450
def __init__(self): path = "notes/active/" for note in os.listdir(path): if os.path.isfile(os.path.join(path,note)): self.noteList.append(self.loadNote(note))
def __init__(self): for note in os.listdir(path): if os.path.isfile(os.path.join(path,note)): self.noteList.append(self.loadNote(note))
30,451
def __init__(self): path = "notes/active/" for note in os.listdir(path): if os.path.isfile(os.path.join(path,note)): self.noteList.append(self.loadNote(note))
def __init__(self): path = "notes/active/" for note in os.listdir(path): if os.path.isfile(os.path.join(path,note)): self.noteList.append(self.loadNote(note))
30,452
def loadNote(self,file): note = cPickle.load(open("notes/active/%s" % file,"rb")) note.text = decompress(note.text) return note
def loadNote(self,file): note = cPickle.load(open(file,"rb")) note.setFilepath(file) note.setText(decompress(note.getText())) if note not in self.noteList: self.noteList.append(note) return note
30,453
def saveNote(self,note): if note not in self.noteList: self.noteList.append(note)
def saveNote(self,note): if note not in self.noteList: self.noteList.append(note)
30,454
def saveNote(self,note): if note not in self.noteList: self.noteList.append(note)
def saveNote(self,note): if note not in self.noteList: self.noteList.append(note)
30,455
def saveNote(self,note): if note not in self.noteList: self.noteList.append(note)
def saveNote(self,note): if note not in self.noteList: self.noteList.append(note)
30,456
def saveNote(self,note): if note not in self.noteList: self.noteList.append(note)
def saveNote(self,note): if note not in self.noteList: self.noteList.append(note)
30,457
def loadNote(self,file): note = cPickle.load(open(file,"rb")) note.setFilepath(file) note.setText(decompress(note.getText()))
def loadNote(self,file): note = cPickle.load(open(file,"rb")) note.setFilepath(file) note.setText(decompress(note.getText()))
30,458
def saveNote(self,note):
def saveNote(self,note):
30,459
def run(self, result=None): if result is None: result = self.defaultTestResult() c2pread, c2pwrite = os.pipe() # fixme - error -> result # now fork pid = os.fork() if pid == 0: # Child # Close parent's pipe ends os.close(c2pread) # Dup fds for child os.dup2(c2pwrite, 1) # Close pipe fds. os.close(c2pwrite)
def run(self, result=None): if result is None: result = self.defaultTestResult() c2pread, c2pwrite = os.pipe() # fixme - error -> result # now fork pid = os.fork() if pid == 0: # Child # Close parent's pipe ends os.close(c2pread) # Dup fds for child os.dup2(c2pwrite, 1) # Close pipe fds. os.close(c2pwrite)
30,460
def Open(self, filename): self.filename = filename self.text.LoadFile(filename)
def Open(self, filename): self.filename = filename self.text.LoadFile(filename)
30,461
def InitMenu(self): menu = (('&File', (('&New', wx.ID_NEW, self.OnNew), ('&Open', wx.ID_OPEN, self.OnOpen), ('&Save', wx.ID_SAVE, self.OnSave), ('Save as...', wx.ID_SAVEAS, self.OnSaveAs), None, ('&Close', wx.ID_CLOSE, self.OnClose), ('Close all', wx.ID_CLOSE_ALL, self.OnCloseAll), ('E&xit', wx.ID_EXIT, self.OnExit))),...
def InitMenu(self): menu = (('&File', (('&New', wx.ID_NEW, self.OnNew), ('&Open', wx.ID_OPEN, self.OnOpen), ('&Save', wx.ID_SAVE, self.OnSave), ('Save as...', wx.ID_SAVEAS, self.OnSaveAs), None, ('&Close', wx.ID_CLOSE, self.OnClose), ('Close all', wx.ID_CLOSE_ALL, self.OnCloseAll), ('E&xit', wx.ID_EXIT, self.OnExit))),...
30,462
def OnOpenRecent(self, evt): self.Load(self.recent[evt.GetId()-ID_RECENT_FILES])
def OnOpenRecent(self, evt): self.Load(self.recent[evt.GetId()-ID_RECENT_FILES])
30,463
def Load(self, filename): SrcFrame.create(self, filename) if filename in self.recent: self.recent.remove(filename) self.recent.append(filename)
def Load(self, filename): SrcFrame.create(self, filename) absname = os.path.abspath(filename) if absname in self.recent: self.recent.remove(absname) self.recent.append(absname)
30,464
def OnRedo(self, evt): pass
def OnRedo(self, evt): pass
30,465
def OnCut(self, evt): sel = self.book.GetSelection() if sel != -1: self.clip = self.book.GetPage(sel).text.Copy(True)
def OnCut(self, evt): sel = self.book.GetSelection() if sel != -1: self.clip = self.book.GetPage(sel).text.Copy(True)
30,466
def OnPaste(self, evt): sel = self.book.GetSelection() if sel != -1: self.clip = self.book.GetPage(sel).text.Paste(self.clip)
def OnPaste(self, evt): sel = self.book.GetSelection() if sel != -1: self.clip = self.book.GetPage(sel).text.Paste(self.clip)
30,467
def ClosePage(self, index): if self.book.GetPage(index).text.IsModified(): return False else: success = self.book.DeletePage(index) self.book.SetSelection(0) return success
def ClosePage(self, index): if self.book.GetPage(index).text.IsModified(): return False else: success = self.book.DeletePage(index) if self.book.GetPageCount() > 0: self.book.SetSelection(0) return success
30,468
def is_dirty(self): for s in self.__stores: if s.is_dirty(): return 1 return 0
def is_dirty(self): for s in self.__stores: if self.__stores[s].is_dirty(): return 1 return 0
30,469
def savenext(self, obj): try: self.save(obj) except NotValid: self.error("Data not valid") return UI.save_previous(self, item) self.samenext.is_sensitive(1) self.next(obj) self.saveable(self.stores.is_dirty())
def savenext(self, obj): try: self.save(obj) except NotValid: self.error("Data not valid") return UI.save_previous(self, item) self.sameButton.set_sensitive(1) self.next(obj) self.saveable(self.stores.is_dirty())
30,470
def samenext(self, obj): item = UI.get_previous(self) self.title.entry.set_text(item.get_title(1)) self.__textview_set(self.desc, item.get_description(1)) self.next(obj)
def samenext(self, obj): item = UI.get_previous(self) self.title.entry.set_text(item.get_title(1)) self.__textview_set(self.desc, item.get_description(1)) self.next(obj)
30,471
def getstore(self, filename): print filename print self.__getdirname(filename) try: store = self.__stores[self.__getdirname(filename)] except KeyError: self.open(filename) store = self.__stores[self.__getdirname(filename)] return store
def getstore(self, filename): try: store = self.__stores[self.__getdirname(filename)] except KeyError: self.open(filename) store = self.__stores[self.__getdirname(filename)] return store
30,472
def __get_description_element(self): children = self.__node.childNodes for node in children: # Here I assume that description is a text node; I am not sure # it's a good assumption if node.nodeType == xml.dom.Node.ELEMENT_NODE and node.tagName == "description": return node else: return None return None
def __get_description_element(self): children = self.__node.childNodes for node in children: # Here I assume that description is a text node; I am not sure # it's a good assumption if node.nodeType == xml.dom.Node.ELEMENT_NODE and node.tagName == "description": return node else: return None return None
30,473
def __get_description_element(self): children = self.__node.childNodes for node in children: # Here I assume that description is a text node; I am not sure # it's a good assumption if node.nodeType == xml.dom.Node.ELEMENT_NODE and node.tagName == "description": return node else: return None return None
def __get_description_element(self): children = self.__node.childNodes for node in children: # Here I assume that description is a text node; I am not sure # it's a good assumption if node.nodeType == xml.dom.Node.ELEMENT_NODE and node.tagName == "description": return node return None
30,474
def get_description(self, nonone = 0): desc_element = self.__get_description_element() if desc_element != None and desc_element.hasChildNodes() and desc_element.firstChild.nodeType == xml.dom.Node.TEXT_NODE: value = desc_element.firstChild.data else: value = None if nonone and value == None: value = "" return value
def get_description(self, nonone = 0): desc_element = self.__get_description_element() if desc_element != None: if desc_element.firstChild.nodeType == xml.dom.Node.ELEMENT_NODE: node = desc_element.firstChild else: node = desc_element value = xmlutils.getChildTextNode(node) else: value = None if nonone and value == N...
30,475
def save(self, obj): item = self.stores.get_item(self.filename, self) item.set_title(self.title.entry.get_text()) self.__combo_add_entry(self.title, self.title.entry.get_text()) item.set_description(self.desc.get_buffer().get_text())
def save(self, obj): item = self.stores.get_item(self.filename, self) item.set_title(self.title.entry.get_text()) self.__combo_add_entry(self.title, self.title.entry.get_text()) item.set_description(self.desc.get_buffer().get_text())
30,476
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [optoins] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/...
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [options] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/...
30,477
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [optoins] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/...
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [optoins] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/...
30,478
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [optoins] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/...
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [optoins] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/...
30,479
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [optoins] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/...
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [optoins] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/...
30,480
def branch_TAO (): branch_ACE () # Perform branching destination = opts.repo + opts.dest svn_copy (opts.repo + opts.source + "/TAO", destination + "modules/TAO") #Create the set svn_mkdir_local ("sets/ACE+TAO") svn_propset ("sets/ACE+TAO", "svn:externals", "%s\t%s\n%s\t%s" % ("ACE_wrappers", destination + "modules/AC...
def branch_TAO (): branch_ACE () # Perform branching destination = opts.repo + opts.dest svn_copy (opts.repo + opts.source + "/TAO", destination + "modules/TAO") #Create the set svn_mkdir_local ("sets/ACE+TAO") svn_propset ("sets/ACE+TAO", "svn:externals", "%s\t%s\n%s\t%s" % ("ACE_wrappers", destination + "modules/AC...
30,481
def branch_CIAO (): branch_TAO () #Perform branching destination = opts.repo + opts.dest svn_copy (opts.repo + opts.source + "/CIAO", destination + "modules/CIAO") # Create the set svn_mkdir_local ("sets/ACE+TAO+CIAO") svn_propset ("sets/ACE+TAO+CIAO", "svn:externals", "%s\t%s\n%s\t%s\n%s\t%s" % ("ACE_wrappers", dest...
def branch_CIAO (): branch_TAO () #Perform branching destination = opts.repo + opts.dest svn_copy (opts.repo + opts.source + "/CIAO", destination + "modules/CIAO") # Create the set svn_mkdir_local ("sets/ACE+TAO+CIAO") svn_propset ("sets/ACE+TAO+CIAO", "svn:externals", "%s\t%s\n%s\t%s\n%s\t%s" % ("ACE_wrappers", dest...
30,482
def main (opts, args): # Lets make opts global globals ()['opts'] = opts path = str () if opts.action: # True for tag path = "tags/" else: # Branch path = "branches/" path += "%s/%s" % (opts.dest, args[0]) # Make branch/tag directory svn_mkdir (opts.repo + path) # Make modules and sets subdirectory svn_mkdir (opts.r...
def main (opts, args): # Lets make opts global globals ()['opts'] = opts path = str () if opts.action: # True for tag path = "tags/" else: # Branch path = "branches/" path += "%s/%s" % (opts.dest, args[0]) # Make branch/tag directory svn_mkdir (opts.repo + path) # Make modules and sets subdirectory svn_mkdir (opts.r...
30,483
def main (opts, args): # Lets make opts global globals ()['opts'] = opts path = str () if opts.action: # True for tag path = "tags/" else: # Branch path = "branches/" path += "%s/%s" % (opts.dest, args[0]) # Make branch/tag directory svn_mkdir (opts.repo + path) # Make modules and sets subdirectory svn_mkdir (opts.r...
def main (opts, args): # Lets make opts global globals ()['opts'] = opts path = str () if opts.action: # True for tag path = "tags/" else: # Branch path = "branches/" path += "%s/%s" % (opts.dest, args[0]) # Make branch/tag directory svn_mkdir (opts.repo + path) # Make modules and sets subdirectory svn_mkdir (opts.r...
30,484
def copyWithZone_(self, zone): o = super(MyCopyClass, self).copyWithZone_(zone) o.foobar = 2 return o
def copyWithZone_(self, zone): o = self.__class__.alloc().init() o.foobar = 2 return o
30,485
def copyWithZone_(self, zone): o = super(MyCopyClass, self).copyWithZone_(zone) o.foobar = 2 return o
def copyWithZone_(self, zone): o = super(MyCopyClass, self).copyWithZone_(zone) o.foobar = 2 return o
30,486
def main(): pool = rt.NSAutoreleasePool() # Load Application Framework: rt.NSBundle.bundleWithPath_( '/System/Library/Frameworks/AppKit.framework').load() NSApp = rt.NSApplication.sharedApplication() win = rt.NSWindow.alloc() frame = ((200.0, 300.0), (250.0, 100.0)) win.initWithContentRect_styleMask_backing_defer_ ...
def main(): pool = rt.NSAutoreleasePool() # Load Application Framework: rt.NSBundle.bundleWithPath_('/System/Library/Frameworks/AppKit.framework').load() NSApp = rt.NSApplication.sharedApplication() win = rt.NSWindow.alloc() frame = ((200.0, 300.0), (250.0, 100.0)) win.initWithContentRect_styleMask_backing_defer_ (...
30,487
def main(): pool = rt.NSAutoreleasePool() # Load Application Framework: rt.NSBundle.bundleWithPath_( '/System/Library/Frameworks/AppKit.framework').load() NSApp = rt.NSApplication.sharedApplication() win = rt.NSWindow.alloc() frame = ((200.0, 300.0), (250.0, 100.0)) win.initWithContentRect_styleMask_backing_defer_ ...
def main(): pool = rt.NSAutoreleasePool() # Load Application Framework: rt.NSBundle.bundleWithPath_( '/System/Library/Frameworks/AppKit.framework').load() win = rt.NSWindow.alloc() frame = ((200.0, 300.0), (250.0, 100.0)) win.initWithContentRect_styleMask_backing_defer_ (frame, 15, 2, 0) win.setTitle_ ('HelloWorld...
30,488
def __pos__CFNumber(numA): return +number_wrap(_num_to_python(numA))
def __pos__CFNumber(numA): return number_wrap(+_num_to_python(numA))
30,489
def __init__(self): """Create a worker thread. Start it by calling the start() method.""" self.queue = Queue() Thread.__init__(target=self.doWork)
def __init__(self): """Create a worker thread. Start it by calling the start() method.""" self.queue = Queue() Thread.__init__(self)
30,490
def work(): self.setStatusTextFieldMessage_("Retrieving signature for method %s..." % selectedMethod) methodDescription = getattr(self._server, self._methodPrefix + "methodHelp")(selectedMethod) if not methodDescription: methodDescription = "No description available." self._methodDescriptions[selectedMethod] = methodDe...
def work(): self.setStatusTextFieldMessage_("Retrieving signature for method %s..." % selectedMethod) methodDescription = getattr(self._server, self._methodPrefix + "methodHelp")(selectedMethod) if not methodDescription: methodDescription = "No description available." self._methodDescriptions[selectedMethod] = methodDe...
30,491
def work(): self.setStatusTextFieldMessage_("Retrieving signature for method %s..." % selectedMethod) methodDescription = getattr(self._server, self._methodPrefix + "methodHelp")(selectedMethod) if not methodDescription: methodDescription = "No description available." self._methodDescriptions[selectedMethod] = methodDe...
def work(): self.setStatusTextFieldMessage_("Retrieving signature for method %s..." % selectedMethod) methodDescription = getattr(self._server, self._methodPrefix + "methodHelp")(selectedMethod) if not methodDescription: methodDescription = "No description available." self._methodDescriptions[selectedMethod] = methodDe...
30,492
def work(): self.setStatusTextFieldMessage_("Retrieving signature for method %s..." % selectedMethod) methodDescription = getattr(self._server, self._methodPrefix + "methodHelp")(selectedMethod) if not methodDescription: methodDescription = "No description available." self._methodDescriptions[selectedMethod] = methodDe...
def work(): self.setStatusTextFieldMessage_("Retrieving signature for method %s..." % selectedMethod) methodDescription = getattr(self._server, self._methodPrefix + "methodHelp")(selectedMethod) if not methodDescription: methodDescription = "No description available." self._methodDescriptions[selectedMethod] = methodDe...
30,493
def write_preflight_rm(path, files): fobj = file(path, 'w') fobj.write(PREFLIGHT_RM % dict(files=map(os.path.normpath, files))) fobj.close() os.chmod(path, 0775)
def write_preflight_rm(path, files): fobj = file(path, 'w') fobj.write(PREFLIGHT_RM % dict(files=map(os.path.normpath, files))) fobj.close() os.chmod(path, 0775)
30,494
def _getDefaults(cls): defaults = {} for name, value in cls.__dict__.items(): if name[0] != "_" and not isinstance(value, (function, classmethod)): defaults[name] = deepcopy(value) for base in cls.__bases__: if hasattr(base, "_getDefaults"): defaults.update(base._getDefaults()) return defaults
def _getDefaults(cls): defaults = {} for name, value in cls.__dict__.items(): if name[0] != "_" and not isinstance(value, (function, classmethod)): defaults[name] = deepcopy(value) return defaults
30,495
def setup(self): # XXX rethink self.name munging, this is brittle. self.name, ext = os.path.splitext(self.name) if not ext: ext = ".bundle" bundleextension = ext # misc (derived) attributes self.bundlepath = pathjoin(self.builddir, self.name + bundleextension)
def setup(self): # XXX rethink self.name munging, this is brittle. self.name, ext = os.path.splitext(self.name) if not ext: ext = ".bundle" bundleextension = ext # misc (derived) attributes self.bundlepath = pathjoin(self.builddir, self.name + bundleextension)
30,496
def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path)
def __load(): import imp, sys, os for p in sys.path: path = os.path.join(p, "%(filename)s") if os.path.exists(path): break else: assert 0, "file not found: %(filename)s" mod = imp.load_dynamic("%(name)s", path)
30,497
def setup(self): if ((self.standalone or self.semi_standalone) and self.mainprogram is None): raise BundleBuilderError, ("must specify 'mainprogram' when " "building a standalone application.") if self.mainprogram is None and self.executable is None: raise BundleBuilderError, ("must specify either or both of " "'execut...
def setup(self): if ((self.standalone or self.semi_standalone) and self.mainprogram is None): raise BundleBuilderError, ("must specify 'mainprogram' when " "building a standalone application.") if self.mainprogram is None and self.executable is None: raise BundleBuilderError, ("must specify either or both of " "'execut...
30,498
def main(builder=None): if builder is None: builder = AppBuilder(verbosity=1) shortopts = "b:n:r:f:e:m:c:p:lx:i:hvqa" longopts = ("builddir=", "name=", "resource=", "file=", "executable=", "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "argv", "standalone", "exclude=", "...
def main(builder=None): if builder is None: builder = AppBuilder(verbosity=1) shortopts = "b:n:r:f:e:m:c:p:lx:i:hvqa" longopts = ("builddir=", "name=", "resource=", "file=", "executable=", "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "argv", "standalone", "exclude=", "...
30,499