rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
{'H2': [segment(11.0, 15)], 'H1': [segment(5.0, 9.0)]}
{'H2': [segment(6.0, 15)], 'H1': [segment(0.0, 9.0)]}
def popitem(*args): raise NotImplementedError
8e48b6075bb8a5cd31c1c0ad7f6050e789bbb144 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/8e48b6075bb8a5cd31c1c0ad7f6050e789bbb144/segments.py
working copy of a segmentlist object. The first is to initialize a new object from an existing one with
copy of a segmentlist object. The first is to initialize a new object from an existing one with >>> old = segmentlistdict()
def copy(self): """ Return a copy of the segmentlistdict object. The return value is a new object with a new offsets attribute, with references to the original keys, and shallow copies of the segment lists. Modifications made to the offset dictionary or segmentlists in the object returned by this method will not affe...
8e48b6075bb8a5cd31c1c0ad7f6050e789bbb144 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/8e48b6075bb8a5cd31c1c0ad7f6050e789bbb144/segments.py
This creates a working copy of the dictionary, but not of its contents. That is, this creates new with references to the segmentlists in old, so changes to the segmentlists in either new or old are reflected in both. The second method is
This creates a copy of the dictionary, but not of its contents. That is, this creates new with references to the segmentlists in old, therefore changes to the segmentlists in either new or old are reflected in both. The second method is
def copy(self): """ Return a copy of the segmentlistdict object. The return value is a new object with a new offsets attribute, with references to the original keys, and shallow copies of the segment lists. Modifications made to the offset dictionary or segmentlists in the object returned by this method will not affe...
8e48b6075bb8a5cd31c1c0ad7f6050e789bbb144 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/8e48b6075bb8a5cd31c1c0ad7f6050e789bbb144/segments.py
This creates a working copy of the dictionary and of the
This creates a copy of the dictionary and of the
def copy(self): """ Return a copy of the segmentlistdict object. The return value is a new object with a new offsets attribute, with references to the original keys, and shallow copies of the segment lists. Modifications made to the offset dictionary or segmentlists in the object returned by this method will not affe...
8e48b6075bb8a5cd31c1c0ad7f6050e789bbb144 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/8e48b6075bb8a5cd31c1c0ad7f6050e789bbb144/segments.py
self.name_output_file = job.tag_base + "-" + str(time) + ".tgz"
self.name_output_file = job.tag_base + "-" + repr(time) + ".tgz"
def __init__(self, dag, job, cp, opts, time, ifo, p_nodes=[], type="ht", variety="fg"):
6a0d2205ec2f7140b459b78cf45c546500409709 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/6a0d2205ec2f7140b459b78cf45c546500409709/stfu_pipe.py
a minimum threshold of min_threshold in the most sensitive one, for a source
a minimum threshold of min_threshold in the least sensitive one, for a source
def detector_thresholds(min_threshold, ifos, RA, dec, gps_time, sensitivities=None): """ Return a dictionary of sensitivity thresholds for each detector, based on a minimum threshold of min_threshold in the most sensitive one, for a source at position (RA,dec) specified in radians at time gps_time. Specifying a diction...
81fa541cb286c29af6357c97e64fb609c8050da9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/81fa541cb286c29af6357c97e64fb609c8050da9/grbsummary.py
def New(Type, columns = None):
def New(Type, columns = None, **kwargs):
def New(Type, columns = None): """ Convenience function for constructing pre-defined LSC tables. The optional columns argument is a list of the names of the columns the table should be constructed with. If columns = None, then the table is constructed with all valid columns included (pass columns = [] to create a tab...
b7911df0228672c2c788b9d67a03d14a75d99b68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/b7911df0228672c2c788b9d67a03d14a75d99b68/lsctables.py
new = Type(sax.xmlreader.AttributesImpl({u"Name": Type.tableName}))
new = Type(sax.xmlreader.AttributesImpl({u"Name": Type.tableName}), **kwargs)
def New(Type, columns = None): """ Convenience function for constructing pre-defined LSC tables. The optional columns argument is a list of the names of the columns the table should be constructed with. If columns = None, then the table is constructed with all valid columns included (pass columns = [] to create a tab...
b7911df0228672c2c788b9d67a03d14a75d99b68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/b7911df0228672c2c788b9d67a03d14a75d99b68/lsctables.py
if program_name == "thinca":
if program_name == "thinca":
def get_segments(connection, xmldoc, program_name): seglists = segments.segmentlistdict() if program_name == "thinca": seglists = db_thinca_rings.get_thinca_zero_lag_segments(connection, program_name) if program_name == "gstlal_inspiral" or program_name == "lalapps_ring": seglists = llwapp.segmentlistdict_fromsearchsum...
467bb49d7b49200eba6a86b26772b07c1c9a7ac0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/467bb49d7b49200eba6a86b26772b07c1c9a7ac0/farutils.py
if program_name == "thinca":
if program_name == "thinca":
def get_background_livetime_by_slide(connection, program_name, seglists, veto_segments=None, verbose = False): if program_name == "thinca": return background_livetime_ring_by_slide(connection, program_name, seglists, veto_segments, verbose) if program_name == "gstlal_inspiral": return background_livetime_nonring_by_s...
467bb49d7b49200eba6a86b26772b07c1c9a7ac0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/467bb49d7b49200eba6a86b26772b07c1c9a7ac0/farutils.py
infile = '%s/%s.in' % (src_dir, basename)
infile = '%s.in' % basename
def generate_git_version_info(): # info object info = git_info() git_path = check_call_out(('which', 'git')) # determine basic info about the commit # %H -- full git hash id # %ct -- commit time # %an, %ae -- author name, email # %cn, %ce -- committer name, email git_id, git_udate, git_author_name, git_author_email, ...
ef6699d85dbb8efec59f6d7a740308a16375520b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/ef6699d85dbb8efec59f6d7a740308a16375520b/generate_vcs_info.py
if paramnames(parnum)=='mchirp': return inj.mchirp if paramname(parnum)=='eta': return inj.eta if paramname(parnum)=='time': return inj.get_end() if paramname(parnum)=='phi0': return inj.phi0 if paramname(parnum)=='dist': return inj.distance if paramname(parnum)=='RA': return inj.longitude if paramname(parnum)=='dec': ...
if paramnames[parnum]=='mchirp': return inj.mchirp if paramnames[parnum]=='eta': return inj.eta if paramnames[parnum]=='time': return inj.get_end() if paramnames[parnum]=='phi0': return inj.phi0 if paramnames[parnum]=='dist': return inj.distance if paramnames[parnum]=='RA': return inj.longitude if paramnames[parnum]=='...
def getinjpar(inj,parnum): if paramnames(parnum)=='mchirp': return inj.mchirp if paramname(parnum)=='eta': return inj.eta if paramname(parnum)=='time': return inj.get_end() if paramname(parnum)=='phi0': return inj.phi0 if paramname(parnum)=='dist': return inj.distance if paramname(parnum)=='RA': return inj.longitude if...
50b7ece49c798f0c0a51eadae38e35a1dfb1d927 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/50b7ece49c798f0c0a51eadae38e35a1dfb1d927/cbcBayesSkyRes.py
if injection and getinjpar(injection,paramnames.index('mchirp'))<max(pos[:,paranmanes.index('mchirp')]) and getinjpar(injection,paramnames.index('mchirp'))>min(pos[:,paramnames.index('mchirp')]) and getinjpar(injection,paramnames.index('eta'))>min(pos[:,paramnames.index('eta')]) and getinjpar(injection,paramnames.index...
if injection and getinjpar(injection,paramnames.index('mchirp'))<max(pos[:,paramnames.index('mchirp')]) and getinjpar(injection,paramnames.index('mchirp'))>min(pos[:,paramnames.index('mchirp')]) and getinjpar(injection,paramnames.index('eta'))>min(pos[:,paramnames.index('eta')]) and getinjpar(injection,paramnames.index...
def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y...
50b7ece49c798f0c0a51eadae38e35a1dfb1d927 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/50b7ece49c798f0c0a51eadae38e35a1dfb1d927/cbcBayesSkyRes.py
for (frac,size) in skyreses: htmlfile.write('<tr><td>%f</td>%f</td></tr>'%(frac,size))
for (frac,skysize) in skyreses: htmlfile.write('<tr><td>%f</td>%f</td></tr>'%(frac,skysize))
def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/y...
647ad923ab86edfe537f5abc2b4402de62356695 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/647ad923ab86edfe537f5abc2b4402de62356695/OddsPostProc.py
segment_definer AS x WHERE x.name = segment_definer.name )\
segment_definer AS x, segment AS y \ WHERE x.name = segment_definer.name AND \ x.segment_def_id = y.segment_def_id AND \ y.segment_def_cdb = x.creator_db AND \ NOT (y.start_time > %s OR %s > y.end_time) ) \
def getSciSegs(ifo=None, gpsStart=None, gpsStop=None, cut=bool(False), serverURL=None, segName="DMT-SCIENCE", seglenmin=None, segpading=0
5270539576c4e2945cb782583298d134a1f2c06b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/5270539576c4e2945cb782583298d134a1f2c06b/fu_utils.py
sqlQuery=query01%(segName,ifo,gpsStop,gpsStart)
sqlQuery=query01%(segName,ifo,gpsStop,gpsStart,gpsStop,gpsStart)
def getSciSegs(ifo=None, gpsStart=None, gpsStop=None, cut=bool(False), serverURL=None, segName="DMT-SCIENCE", seglenmin=None, segpading=0
5270539576c4e2945cb782583298d134a1f2c06b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/5270539576c4e2945cb782583298d134a1f2c06b/fu_utils.py
(home_dirs()+"/romain/followupbackgrounds/omega/VSR2a/background/background_931035296_935798415.cache",931035296,935798415,"V1")
(home_dirs()+"/romain/followupbackgrounds/omega/VSR2a/background/background_931035296_935798415.cache",931035296,935798415,"V1"),
def figure_out_cache(time,ifo): cacheList=( (home_dirs()+"/romain/followupbackgrounds/omega/S5/background/background_815155213_875232014.cache",815155213,875232014,"H1H2L1"), (home_dirs()+"/romain/followupbackgrounds/omega/S6a/background/background_931035296_935798415.cache",931035296,935798415,"H1L1"), (home_dirs()+"...
e2df3d907fc79585abd65c0605de1e63db5a8b07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/e2df3d907fc79585abd65c0605de1e63db5a8b07/stfu_pipe.py
os.path.join("bin","cbcBayesPostProc.py")
os.path.join("bin","cbcBayesPostProc.py")
def run(self): # remove the automatically generated user env scripts for script in ["pylal-user-env.sh", "pylal-user-env.csh"]: log.info("removing " + script ) try: os.unlink(os.path.join("etc", script)) except: pass
e1cc8c3a3ccb5ac0f287429b4a4089ef7d6834ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/e1cc8c3a3ccb5ac0f287429b4a4089ef7d6834ae/setup.py
self.add_var_arg(p_nodes[1].name_output_file)
self.add_var_arg(p_nodes[1].outputFileName)
def __init__(self, dag, job, cp, opts, ifo, time, p_nodes=[], type=""):
861e37c73755058b7941a8b8bfc36024be47a7bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/861e37c73755058b7941a8b8bfc36024be47a7bd/stfu_pipe.py
self.add_var_opt('server','ldr-bologna.phys.uwm.edu') if not(cp.has_option('fu-remote-jobs','remote-jobs') and job.name in cp.get('fu-remote-jobs','remote-jobs') and cp.has_option('fu-remote-jobs','remote-ifos') and ifo in cp.get('fu-remote-jobs','remote-ifos')) or if opts.do_remoteScans:
self.add_var_arg('--server ldr-bologna.phys.uwm.edu') if not(cp.has_option('fu-remote-jobs','remote-jobs') and job.name in cp.get('fu-remote-jobs','remote-jobs') and cp.has_option('fu-remote-jobs','remote-ifos') and ifo in cp.get('fu-remote-jobs','remote-ifos')) or opts.do_remoteScans:
def __init__(self, dag, job, cp, opts, ifo, sngl=None, qscan=False, trigger_time=None, data_type="hoft", p_nodes=[]):
861e37c73755058b7941a8b8bfc36024be47a7bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/861e37c73755058b7941a8b8bfc36024be47a7bd/stfu_pipe.py
one of the segments in self. If self has length n, then if item is a scalar or a segment this operation is O(log n), if it is a segmentlist of m segments this operation is O(m
the segments in self. If self has length n, then if item is a scalar or a segment this operation is O(log n), if item is a segmentlist of m segments this operation is O(m
def __contains__(self, item): """ Returns True if the given object is wholly contained within one of the segments in self. If self has length n, then if item is a scalar or a segment this operation is O(log n), if it is a segmentlist of m segments this operation is O(m log n).
666812caa6aac59ffb0e844aa826a1ba2e4d9b91 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/666812caa6aac59ffb0e844aa826a1ba2e4d9b91/segments.py
oldVal=None
def __init__(self,cp,block_id,dagDir,channel=''): self.dagDirectory=dagDir self.__executable = cp.get('condor','clustertool') self.__universe= cp .get('condor','clustertool_universe') pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) pipeline.AnalysisJob.__init__(self,cp) self.add_condor_cmd('geten...
2bf156950a8e87899e02d51b15c066f02356afbf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/2bf156950a8e87899e02d51b15c066f02356afbf/tracksearch.py
for sec in ['candidatethreshold']: self.add_ini_opts(cp,sec)
oldValList.append((optionText,oldVal)) for sec in ['candidatethreshold']: self.add_ini_opts(cp,sec) for myOpt,oldVal in oldValList:
def __init__(self,cp,block_id,dagDir,channel=''): self.dagDirectory=dagDir self.__executable = cp.get('condor','clustertool') self.__universe= cp .get('condor','clustertool_universe') pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) pipeline.AnalysisJob.__init__(self,cp) self.add_condor_cmd('geten...
2bf156950a8e87899e02d51b15c066f02356afbf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/2bf156950a8e87899e02d51b15c066f02356afbf/tracksearch.py
cp.set('candidatethreshold',optionText,oldVal)
cp.set('candidatethreshold',myOpt,oldVal)
def __init__(self,cp,block_id,dagDir,channel=''): self.dagDirectory=dagDir self.__executable = cp.get('condor','clustertool') self.__universe= cp .get('condor','clustertool_universe') pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) pipeline.AnalysisJob.__init__(self,cp) self.add_condor_cmd('geten...
2bf156950a8e87899e02d51b15c066f02356afbf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/2bf156950a8e87899e02d51b15c066f02356afbf/tracksearch.py
for x in self.ifos: if x not in self.__backgroundPickle__.keys(): sys.stderr.write("Could not either open or save DQ \ background in %s.\n"%(self.__backgroundPickle__)) self.__backgroundResults__=list() self.__backgroundTimesDict__=dict() self.__backgroundDict__=dict() self.__haveBackgroundDict__=bool(False) return
if not self.__haveBackgroundDict__: sys.stderr.write("Could not either open or save DQ \ background in %s no background data available!\n"%(self.__backgroundPickle__)) self.__backgroundResults__=list() self.__backgroundTimesDict__=dict() self.__backgroundDict__=dict() self.__haveBackgroundDict__=bool(False) return
def estimateDQbackground(self): """ This method looks at the self.resultlist inside the instance. Using this and 1000 generated time stamp it tabulates a ranking of flag prevelance, binomial probability 'p' """ if len(self.resultList) < 1: self.__backgroundResults__=list() self.__backgroundTimesDict__=dict() self.__bac...
94dbbcc188e5f8f0fa5a09c0af0988c2f139c5c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/94dbbcc188e5f8f0fa5a09c0af0988c2f139c5c4/fu_utils.py
... self.items = []
... self.items = {} ... self.next_id = 1
... def __init__(self):
11b478972152a15fce1de03ba52e6a7774bb2569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10444/11b478972152a15fce1de03ba52e6a7774bb2569/add.py
... self.items.append(MockBooking(**kwargs))
... booking_id = str(self.next_id) ... self.next_id += 1 ... self.items[booking_id] = MockBooking(**kwargs) ... return booking_id
... def invokeFactory(self, type, **kwargs):
11b478972152a15fce1de03ba52e6a7774bb2569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10444/11b478972152a15fce1de03ba52e6a7774bb2569/add.py
... return [x.id for x in self.items]
... return self.items.keys() ... def get(self, id): ... return self.items.get(id)
... def objectIds(self):
11b478972152a15fce1de03ba52e6a7774bb2569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10444/11b478972152a15fce1de03ba52e6a7774bb2569/add.py
>>> booking = context.items[0]
>>> booking = context.get('1')
... def objectIds(self):
11b478972152a15fce1de03ba52e6a7774bb2569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10444/11b478972152a15fce1de03ba52e6a7774bb2569/add.py
>>> booking = context.items[-1]
>>> booking = context.get('2')
... def objectIds(self):
11b478972152a15fce1de03ba52e6a7774bb2569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10444/11b478972152a15fce1de03ba52e6a7774bb2569/add.py
>>> booking = context.items[-1]
>>> booking = context.get('3')
... def objectIds(self):
11b478972152a15fce1de03ba52e6a7774bb2569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10444/11b478972152a15fce1de03ba52e6a7774bb2569/add.py
>>> booking = context.items[-1]
>>> booking = context.get('4')
... def objectIds(self):
11b478972152a15fce1de03ba52e6a7774bb2569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10444/11b478972152a15fce1de03ba52e6a7774bb2569/add.py
context.invokeFactory('Booking', id=str(idx), title=title, hours=hours, minutes=minutes, description=description, bookingDate=day)
booking_id = context.invokeFactory( 'Booking', id=str(idx), title=title, hours=hours, minutes=minutes, description=description, bookingDate=day) obj = context.get(booking_id) obj.unmarkCreationFlag()
... def objectIds(self):
11b478972152a15fce1de03ba52e6a7774bb2569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10444/11b478972152a15fce1de03ba52e6a7774bb2569/add.py
u = User.objects.get(id=int(id))
try: u = User.objects.get(id=int(id)) except User.DoesNotExist: continue
def member_list(request, eid=None): if 'event' in request.REQUEST: return HttpResponseRedirect('/member_list/%s/' % request.REQUEST['event']) if request.method == 'POST': if not request.user.profile.is_admin: message(request, 'Error: you are not an administrator!') return HttpResponseRedirect('/member_list') action = r...
b4995c23e284aaa8116244499b1b1957f83aaa3f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12766/b4995c23e284aaa8116244499b1b1957f83aaa3f/views_lists.py
return render_template('errors/404.mako', request, parent='../base.mako' if request.user else '../layout.mako')
return render_template('errors/404.mako', request, parent='../base.mako' if request.user.is_authenticated() else '../layout.mako')
def custom404(request): print request.user return render_template('errors/404.mako', request, parent='../base.mako' if request.user else '../layout.mako')
dacd5c84720d9ff48e37aa603bb803175874007d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12766/dacd5c84720d9ff48e37aa603bb803175874007d/views.py
return render_template('errors/500.mako', request, parent='../base.mako' if request.user else '../layout.mako')
return render_template('errors/500.mako', request, parent='../base.mako' if request.user.is_authenticated() else '../layout.mako')
def custom500(request): return render_template('errors/500.mako', request, parent='../base.mako' if request.user else '../layout.mako')
dacd5c84720d9ff48e37aa603bb803175874007d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12766/dacd5c84720d9ff48e37aa603bb803175874007d/views.py
for event in chapter.calendar_events.filter(date__gte=datetime.date.today()):
for event in (chapter.link or chapter).calendar_events.filter(date__gte=datetime.date.today()):
def calendar(request): if 'chapter' not in request.GET: return HttpResponse('No chapter specified.') chapter = Chapter.objects.get(id=int(request.GET['chapter'])) if 'key' not in request.GET or chapter.calendar_key != request.GET['key']: return HttpResponse('Invalid key specified.') cal = vobject.iCalendar() cal.add('m...
47a01ebe595204dc02fe03fce7b07fe49d64a469 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12766/47a01ebe595204dc02fe03fce7b07fe49d64a469/views.py
confirm_password = request.POST['password']
confirm_password = request.POST['confirm_password']
def reset_password(request): if request.method == 'POST': if 'username' in request.POST: try: user = User.objects.get(Q(username=request.POST['username']) | Q(email=request.POST['username'])) except User.DoesNotExist: return render_template('registration/request_reset.mako', request, error_msg='Unknown username or emai...
a0e6cd19fffc087a4e2af8b8504533f834e90341 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12766/a0e6cd19fffc087a4e2af8b8504533f834e90341/views.py
return render_template('registration/perform_reset.mako', reques, user=uid, auth=auth , error_msg='Error: passwords do not match.')
return render_template('registration/perform_reset.mako', request, user=uid, auth=auth , error_msg='Error: passwords do not match.')
def reset_password(request): if request.method == 'POST': if 'username' in request.POST: try: user = User.objects.get(Q(username=request.POST['username']) | Q(email=request.POST['username'])) except User.DoesNotExist: return render_template('registration/request_reset.mako', request, error_msg='Unknown username or emai...
a0e6cd19fffc087a4e2af8b8504533f834e90341 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12766/a0e6cd19fffc087a4e2af8b8504533f834e90341/views.py
return render_template('registration/perform_reset.mako', request, user=uid, auth=auth )
return render_template('registration/perform_reset.mako', request, uid=uid, auth=auth )
def reset_password(request): if request.method == 'POST': if 'username' in request.POST: try: user = User.objects.get(Q(username=request.POST['username']) | Q(email=request.POST['username'])) except User.DoesNotExist: return render_template('registration/request_reset.mako', request, error_msg='Unknown username or emai...
dd9530eaab13e607db23122a3f3aab12c8f6c2d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12766/dd9530eaab13e607db23122a3f3aab12c8f6c2d3/views.py
gtk.main()
if _main_loop: _main_loop.run() else: gtk.main()
def run(self): self.success = False self._timeout_count = 0
4d402ab8b98837e718d887827d3d5e283cd599e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/4d402ab8b98837e718d887827d3d5e283cd599e1/waiters.py
if gtk.main_level(): gtk.main_quit()
if _main_loop: _main_loop.quit() else: if gtk.main_level(): gtk.main_quit()
def _timeout_cb(self): if self.success: # dispose of previous waiters. return False self._timeout_count += 1 self.poll() if self._timeout_count >= self.timeout or self.success: try: if gtk.main_level(): gtk.main_quit() except RuntimeError: # In Mandriva RuntimeError exception is thrown # If, gtk.main was already quit p...
4d402ab8b98837e718d887827d3d5e283cd599e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/4d402ab8b98837e718d887827d3d5e283cd599e1/waiters.py
if gtk.main_level(): gtk.main_quit()
if _main_loop: _main_loop.quit() else: if gtk.main_level(): gtk.main_quit()
def _event_cb(self, event): self.event_cb(event) if self.success: try: if gtk.main_level(): gtk.main_quit() except RuntimeError: # In Mandriva RuntimeError exception is thrown # If, gtk.main was already quit pass
4d402ab8b98837e718d887827d3d5e283cd599e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/4d402ab8b98837e718d887827d3d5e283cd599e1/waiters.py
'''
"""
def generatemouseevent(self, x, y, eventType = 'b1c'): ''' Generate mouse event on x, y co-ordinates. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: int @param object_name: Object name to look for, either full name, LDTP's name convention, or a...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def generatemouseevent(self, x, y, eventType = 'b1c'): ''' Generate mouse event on x, y co-ordinates. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: int @param object_name: Object name to look for, either full name, LDTP's name convention, or a...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def mouseleftclick(self, window_name, object_name): ''' Mouse left click on an object. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. ...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def mouseleftclick(self, window_name, object_name): ''' Mouse left click on an object. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. ...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def mousemove(self, window_name, object_name): ''' Mouse move on an object. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. Or menu hei...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def mousemove(self, window_name, object_name): ''' Mouse move on an object. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. Or menu hei...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def mouserightclick(self, window_name, object_name): ''' Mouse right click on an object. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def mouserightclick(self, window_name, object_name): ''' Mouse right click on an object. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def doubleclick(self, window_name, object_name): ''' Double click on the object @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. Or menu...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
'''
"""
def doubleclick(self, window_name, object_name): ''' Double click on the object @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. Or menu...
2840728a35706bfd7cd3e236c75533448a30fc1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/2840728a35706bfd7cd3e236c75533448a30fc1d/mouse.py
def __call__(self, *args, **kwargs): logger.debug('%s(%s)' % \ (self.__name, ', '.join(map(repr, args)+['%s=%s' % (k, repr(v)) for k, v in kwargs.items()]))) args += (kwargs,) return self.__send(self.__name, args)
c979caa406fcc3b264af368e618797bca44baac4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/c979caa406fcc3b264af368e618797bca44baac4/client.py
if cls._isRemoteMethod(d[attr]) and cls._isRelevant(d[attr]):
if cls._isRemoteMethod(d[attr]):
def __new__(cls, *args, **kwargs): if not cls._generated: cls._generated = True d = ldtp.__dict__ cls._wrapped_methods =[] for attr in d: if cls._isRemoteMethod(d[attr]) and cls._isRelevant(d[attr]): setted = attr if hasattr(cls, attr): setted = "_remote_"+setted cls._wrapped_methods.append(setted) setattr(cls, setted,...
013692654065af9a83de517d76b3e3ef6da24f65 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/013692654065af9a83de517d76b3e3ef6da24f65/_context.py
def getchild(self, child_name='', role=''): matches = self._remote_getchild(child_name, role, True) if matches: if role: return [Component(self._window_name, matches[0])] else: return Component(self._window_name, matches[0]) else: return None
def getchild(self, child_name='', role=''): # TODO: Bad API choice. Inconsistent, should return object or list, # not both. UPDATE: Only returns first match. matches = self._remote_getchild(child_name, role, True) if matches: if role: return [Component(self._window_name, matches[0])] else: return Component(self._window...
013692654065af9a83de517d76b3e3ef6da24f65 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/013692654065af9a83de517d76b3e3ef6da24f65/_context.py
def _isRelevant(cls, obj): args = cls._listArgs(obj) return len(args) >= 2 and \ 'window_name' == args[0] and 'object_name' == args[1]
013692654065af9a83de517d76b3e3ef6da24f65 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/013692654065af9a83de517d76b3e3ef6da24f65/_context.py
self._callback = {}
def __init__(self): lazy_load = True self._states = {} self._state_names = {} self._callback = {} self._window_uptime = {} self._callback_event = [] self._get_all_state_names() self._handle_table_cell = False self._desktop = pyatspi.Registry.getDesktop(0) if Utils.cached_apps is None: pyatspi.Registry.registerEventList...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
for app in list(self.cached_apps):
for app in self.cached_apps:
def _list_apps(self): for app in list(self.cached_apps): if not app: continue yield app
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
for app in list(self.cached_apps):
for app in self.cached_apps:
def _list_guis(self): for app in list(self.cached_apps): if not app: continue try: for gui in app: if not gui: continue yield gui except LookupError: self.cached_apps.remove(app)
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
try: if acc.name == name:
if acc.name == name: return 1 _ldtpize_accessible_name = self._ldtpize_accessible(acc) _object_name = u'%s%s' % (_ldtpize_accessible_name[0], _ldtpize_accessible_name[1]) if _object_name == name: return 1 if self._glob_match(name, acc.name): return 1 if self._glob_match(name, _object_name): return 1 role = acc.getRole(...
def _match_name_to_acc(self, name, acc): try: if acc.name == name: return 1 _ldtpize_accessible_name = self._ldtpize_accessible(acc) _object_name = u'%s%s' % (_ldtpize_accessible_name[0], _ldtpize_accessible_name[1]) if _object_name == name: return 1 if self._glob_match(name, acc.name): return 1 if self._glob_match(nam...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
_ldtpize_accessible_name = self._ldtpize_accessible(acc) _object_name = u'%s%s' % (_ldtpize_accessible_name[0], _ldtpize_accessible_name[1]) if _object_name == name:
if acc['label']: _tmp_name = re.sub(strip, '', acc['label']) if self._glob_match(obj_name, _tmp_name):
def _match_name_to_acc(self, name, acc): try: if acc.name == name: return 1 _ldtpize_accessible_name = self._ldtpize_accessible(acc) _object_name = u'%s%s' % (_ldtpize_accessible_name[0], _ldtpize_accessible_name[1]) if _object_name == name: return 1 if self._glob_match(name, acc.name): return 1 if self._glob_match(nam...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
if self._glob_match(name, acc.name): return 1 if self._glob_match(name, _object_name): return 1 role = acc.getRole() if role == pyatspi.ROLE_FRAME or role == pyatspi.ROLE_DIALOG or \ role == pyatspi.ROLE_WINDOW or \ role == pyatspi.ROLE_FONT_CHOOSER or \ role == pyatspi.ROLE_FILE_CHOOSER or \ role == pyatspi.ROLE_ALERT...
if self._glob_match(obj_name, acc['key']):
def _match_name_to_acc(self, name, acc): try: if acc.name == name: return 1 _ldtpize_accessible_name = self._ldtpize_accessible(acc) _object_name = u'%s%s' % (_ldtpize_accessible_name[0], _ldtpize_accessible_name[1]) if _object_name == name: return 1 if self._glob_match(name, acc.name): return 1 if self._glob_match(nam...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
if child and child.getRole() == pyatspi.ROLE_TABLE_CELL and \
if child.getRole() == pyatspi.ROLE_TABLE_CELL and \
def _list_objects(self, obj): if obj: yield obj for child in obj: if child and child.getRole() == pyatspi.ROLE_TABLE_CELL and \ not self._handle_table_cell: # In OO.o navigating table cells consumes more time # and resource break for c in self._list_objects(child): yield c
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
def _list_objects(self, obj): if obj: yield obj for child in obj: if child and child.getRole() == pyatspi.ROLE_TABLE_CELL and \ not self._handle_table_cell: # In OO.o navigating table cells consumes more time # and resource break for c in self._list_objects(child): yield c
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
try: if obj: for child in obj: if not child: continue if child.childCount > 0: child_obj = self._get_combo_child_object_type(child) if child_obj: return child_obj if child.getRole() == pyatspi.ROLE_LIST: return child elif child.getRole() == pyatspi.ROLE_MENU: return child except: pass return None
if obj: for child in obj: if not child: continue if child.childCount > 0: child_obj = self._get_combo_child_object_type(child) if child_obj: return child_obj if child.getRole() == pyatspi.ROLE_LIST: return child elif child.getRole() == pyatspi.ROLE_MENU: return child
def _get_combo_child_object_type(self, obj): """ This function will check for all levels and returns the first matching LIST / MENU type """ try: if obj: for child in obj: if not child: continue if child.childCount > 0: child_obj = self._get_combo_child_object_type(child) if child_obj: return child_obj if child.getRole...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
try: if obj and role_type: for child in obj: if not child: continue if child.childCount > 0: child_obj = self._get_child_object_type(child, role_type) if child_obj: return child_obj if child.getRole() == role_type: return child except: pass return None def _appmap_pairs(self, gui): ldtpized_list = [] ldtpized_obj_inde...
if obj and role_type: for child in obj: if not child: continue if child.childCount > 0: child_obj = self._get_child_object_type(child, role_type) if child_obj: return child_obj if child.getRole() == role_type: return child def _add_appmap_data(self, obj, parent): abbrev_role, abbrev_name = self._ldtpize_accessible(obj...
def _get_child_object_type(self, obj, role_type): """ This function will check for all levels and returns the first matching role_type """ try: if obj and role_type: for child in obj: if not child: continue if child.childCount > 0: child_obj = self._get_child_object_type(child, role_type) if child_obj: return child_obj...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
if not re.search('^mnu', _menu_hierarchy[0]): _menu_hierarchy[0] = 'mnu%s' % _menu_hierarchy[0]
def _get_menu_hierarchy(self, window_name, object_name): _menu_hierarchy = re.split(';', object_name) # Get handle of menu obj = self._get_object(window_name, _menu_hierarchy[0]) # Navigate all sub-menu under a menu for _menu in _menu_hierarchy[1:]: _flag = False for _child in self._list_objects(obj): if obj == _child:...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
def _get_menu_hierarchy(self, window_name, object_name): _menu_hierarchy = re.split(';', object_name) # Get handle of menu obj = self._get_object(window_name, _menu_hierarchy[0]) # Navigate all sub-menu under a menu for _menu in _menu_hierarchy[1:]: _flag = False for _child in self._list_objects(obj): if obj == _child:...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
_flag = True
def _get_menu_hierarchy(self, window_name, object_name): _menu_hierarchy = re.split(';', object_name) # Get handle of menu obj = self._get_object(window_name, _menu_hierarchy[0]) # Navigate all sub-menu under a menu for _menu in _menu_hierarchy[1:]: _flag = False for _child in self._list_objects(obj): if obj == _child:...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
"Menu item %s doesn't exist in hierarchy" % _menu)
'Menu item "%s" doesn\'t exist in hierarchy' % _menu)
def _get_menu_hierarchy(self, window_name, object_name): _menu_hierarchy = re.split(';', object_name) # Get handle of menu obj = self._get_object(window_name, _menu_hierarchy[0]) # Navigate all sub-menu under a menu for _menu in _menu_hierarchy[1:]: _flag = False for _child in self._list_objects(obj): if obj == _child:...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
raise LdtpServerException('Object does not have a "click" action')
raise LdtpServerException('Object does not have a "%s" action' % action) def _get_object_in_window(self, appmap, obj_name): for name in appmap.keys(): obj = appmap[name] if self._match_name_to_appmap(obj_name, obj): return obj return None
def _click_object(self, obj, action = 'click'): try: iaction = obj.queryAction() except NotImplementedError: raise LdtpServerException( 'Object does not have an Action interface') else: for i in xrange(iaction.nActions): if re.match(action, iaction.getName(i)): iaction.doAction(i) return raise LdtpServerException('Obje...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
def _get_object_info(self, window_name, obj_name):
def _get_object(self, window_name, obj_name):
def _get_object_info(self, window_name, obj_name): _window_handle = self._get_window_handle(window_name) if not _window_handle: raise LdtpServerException('Unable to find window "%s"' % \ window_name) for name, obj, obj_index in self._appmap_pairs(_window_handle): if self._glob_match(obj_name, obj_index) or \ self._matc...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
for name, obj, obj_index in self._appmap_pairs(_window_handle): if self._glob_match(obj_name, obj_index) or \ self._match_name_to_acc(obj_name, obj) or \ self._match_name_to_appmap(obj_name, name): return name, obj, obj_index raise LdtpServerException( 'Unable to find object name "%s" in application map' % obj_name) d...
appmap = self._appmap_pairs(_window_handle) obj = self._get_object_in_window(appmap, obj_name) if not obj: appmap = self._appmap_pairs(_window_handle, force_remap = True) obj = self._get_object_in_window(appmap, obj_name) if not obj: raise LdtpServerException( 'Unable to find object name "%s" in application map' % obj...
def _get_object_info(self, window_name, obj_name): _window_handle = self._get_window_handle(window_name) if not _window_handle: raise LdtpServerException('Unable to find window "%s"' % \ window_name) for name, obj, obj_index in self._appmap_pairs(_window_handle): if self._glob_match(obj_name, obj_index) or \ self._matc...
43924f2ba30b8adb9b55c5c34c99a33f800d4022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/43924f2ba30b8adb9b55c5c34c99a33f800d4022/utils.py
else: self._ldtp_debug = None
def __init__(self): lazy_load = True self._states = {} self._appmap = {} self._callback = {} self._state_names = {} self._window_uptime = {} self._callback_event = [] self._get_all_state_names() self._handle_table_cell = False self._desktop = pyatspi.Registry.getDesktop(0) if Utils.cached_apps is None: pyatspi.Registry...
93dd62f57f43d2f663068965a392eaeb5ede0885 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/93dd62f57f43d2f663068965a392eaeb5ede0885/utils.py
@param cmdline: Command line string to execute. @type cmdline: string
@param cmd: Command line string to execute. @type cmd: string
def launchapp(self, cmd, args = [], delay = 0, env = 1): ''' Launch application.
63b3f38be85054613367cd3a1154ef29e47f8c4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/63b3f38be85054613367cd3a1154ef29e47f8c4c/core.py
return bool(re_match(glob_trans(pattern), string, re.M | re.U | re.L))
return bool(re_match(glob_trans(pattern), string, re.M | re.U | re.L))
def _glob_match(self, pattern, string): return bool(re_match(glob_trans(pattern), string, re.M | re.U | re.L))
5f6c08007b6636c30e4c66eeb6619c1ab4f6b2ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/5f6c08007b6636c30e4c66eeb6619c1ab4f6b2ba/utils.py
print 'obj', obj
def _get_menu_hierarchy(self, window_name, object_name): _menu_hierarchy = re.split(';', object_name) if not re.search('^mnu', _menu_hierarchy[0]): _menu_hierarchy[0] = 'mnu%s' % _menu_hierarchy[0] obj = self._get_object(window_name, _menu_hierarchy[0]) for _menu in _menu_hierarchy[1:]: _flag = False print 'obj', obj f...
5f6c08007b6636c30e4c66eeb6619c1ab4f6b2ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/5f6c08007b6636c30e4c66eeb6619c1ab4f6b2ba/utils.py
print '_child', _child
def _get_menu_hierarchy(self, window_name, object_name): _menu_hierarchy = re.split(';', object_name) if not re.search('^mnu', _menu_hierarchy[0]): _menu_hierarchy[0] = 'mnu%s' % _menu_hierarchy[0] obj = self._get_object(window_name, _menu_hierarchy[0]) for _menu in _menu_hierarchy[1:]: _flag = False print 'obj', obj f...
5f6c08007b6636c30e4c66eeb6619c1ab4f6b2ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/5f6c08007b6636c30e4c66eeb6619c1ab4f6b2ba/utils.py
def _click_object(self, obj, action = 'click'):
def _click_object(self, obj, action = '(click|press|activate)'):
def _click_object(self, obj, action = 'click'): try: iaction = obj.queryAction() except NotImplementedError: raise LdtpServerException( 'Object does not have an Action interface') else: for i in xrange(iaction.nActions): if re.match(action, iaction.getName(i)): iaction.doAction(i) return raise LdtpServerException('Obje...
5f6c08007b6636c30e4c66eeb6619c1ab4f6b2ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/5f6c08007b6636c30e4c66eeb6619c1ab4f6b2ba/utils.py
def getchild(self, child_name='', role=''): matches = self._remote_getchild(child_name, role, True) if matches: if role: return [Component(self._window_name, matches[0])] else: return Component(self._window_name, matches[0]) else: return None
def getchild(self, child_name='', role=''): # TODO: Bad API choice. Inconsistent, should return object or list, # not both. UPDATE: Only returns first match. matches = self._remote_getchild(child_name, role, True) if matches: if role: return [Component(self._window_name, matches[0])] else: return Component(self._window...
0936f4c7f51025878b4179a91a1228b7017de700 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/0936f4c7f51025878b4179a91a1228b7017de700/_context.py
'''
"""
def imagecapture(self, window_name = None, x = 0, y = 0, width = None, height = None): ''' Captures screenshot of the whole desktop or given window @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param x: x co-ordinate value @type x: int...
ddd66535b2683d07d3c03ce8033c90bfd83df55a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/ddd66535b2683d07d3c03ce8033c90bfd83df55a/generic.py
'''
"""
def imagecapture(self, window_name = None, x = 0, y = 0, width = None, height = None): ''' Captures screenshot of the whole desktop or given window @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param x: x co-ordinate value @type x: int...
ddd66535b2683d07d3c03ce8033c90bfd83df55a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/ddd66535b2683d07d3c03ce8033c90bfd83df55a/generic.py
def _ebRender(self, failure): '''Custom error render method (used by our XMLRPC objects)''' if isinstance(failure.value, xmlrpclib.Fault): return failure.value
if not _ldtp_debug: def _ebRender(self, failure): '''Custom error render method (used by our XMLRPC objects)''' if isinstance(failure.value, xmlrpclib.Fault): return failure.value
def _ebRender(self, failure): '''Custom error render method (used by our XMLRPC objects)''' if isinstance(failure.value, xmlrpclib.Fault): return failure.value
89607e76b487ccd2061e9e6cfc039823fcdd8e82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/89607e76b487ccd2061e9e6cfc039823fcdd8e82/xmlrpc_daemon.py
if hasattr(failure, 'getErrorMessage'): value = failure.getErrorMessage() else: value = 'error'
if hasattr(failure, 'getErrorMessage'): value = failure.getErrorMessage() else: value = 'error'
def _ebRender(self, failure): '''Custom error render method (used by our XMLRPC objects)''' if isinstance(failure.value, xmlrpclib.Fault): return failure.value
89607e76b487ccd2061e9e6cfc039823fcdd8e82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/89607e76b487ccd2061e9e6cfc039823fcdd8e82/xmlrpc_daemon.py
return xmlrpclib.Fault(self.FAILURE, value)
return xmlrpclib.Fault(self.FAILURE, value)
def _ebRender(self, failure): '''Custom error render method (used by our XMLRPC objects)''' if isinstance(failure.value, xmlrpclib.Fault): return failure.value
89607e76b487ccd2061e9e6cfc039823fcdd8e82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/89607e76b487ccd2061e9e6cfc039823fcdd8e82/xmlrpc_daemon.py
x, y, resolution2, resolution1 = bb.x, bb.y, bb.height, bb.width
x, y, height, width = bb.x, bb.y, bb.height, bb.width
def imagecapture(self, window_name = None, x = 0, y = 0, width = None, height = None): ''' Captures screenshot of the whole desktop or given window @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param x: x co-ordinate value @type x: int...
ff746be08b5d982d2599f56ebe1f94cbebc66c8f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/ff746be08b5d982d2599f56ebe1f94cbebc66c8f/generic.py
@return: list of integers on success.
@return: list of string on success
def getallstates(self, window_name, object_name): ''' Get all states of given object @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. @t...
93e2a5d5bedc2d2efc547a12fe735701c82228f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/93e2a5d5bedc2d2efc547a12fe735701c82228f7/core.py
_obj_states.append(state.real)
_obj_states.append(self._state_names[state.real])
def getallstates(self, window_name, object_name): ''' Get all states of given object @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. @t...
93e2a5d5bedc2d2efc547a12fe735701c82228f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/93e2a5d5bedc2d2efc547a12fe735701c82228f7/core.py
_state = obj.getState() _obj_state = _state.getStates()
_state_inst = obj.getState() _obj_state = _state_inst.getStates()
def hasstate(self, window_name, object_name, state): ''' has state @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. @type object_name: s...
93e2a5d5bedc2d2efc547a12fe735701c82228f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/93e2a5d5bedc2d2efc547a12fe735701c82228f7/core.py
print "ldtpd exited!"
if _ldtp_debug: print "ldtpd exited!"
def _handle_signal(self, signum, frame): if os.environ.has_key('LDTP_DEBUG'): if signum == signal.SIGCHLD: print "ldtpd exited!" elif signum == signal.SIGUSR1: print "SIGUSR1 received. ldtpd ready for requests." elif signum == signal.SIGALRM: print "SIGALRM received. Timeout waiting for SIGUSR1."
7fc4e329b2fb61c2e3a4520c94120c45bcc72810 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/7fc4e329b2fb61c2e3a4520c94120c45bcc72810/client.py
print "SIGUSR1 received. ldtpd ready for requests."
if _ldtp_debug: print "SIGUSR1 received. ldtpd ready for requests."
def _handle_signal(self, signum, frame): if os.environ.has_key('LDTP_DEBUG'): if signum == signal.SIGCHLD: print "ldtpd exited!" elif signum == signal.SIGUSR1: print "SIGUSR1 received. ldtpd ready for requests." elif signum == signal.SIGALRM: print "SIGALRM received. Timeout waiting for SIGUSR1."
7fc4e329b2fb61c2e3a4520c94120c45bcc72810 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/7fc4e329b2fb61c2e3a4520c94120c45bcc72810/client.py
print "SIGALRM received. Timeout waiting for SIGUSR1."
if _ldtp_debug: print "SIGALRM received. Timeout waiting for SIGUSR1."
def _handle_signal(self, signum, frame): if os.environ.has_key('LDTP_DEBUG'): if signum == signal.SIGCHLD: print "ldtpd exited!" elif signum == signal.SIGUSR1: print "SIGUSR1 received. ldtpd ready for requests." elif signum == signal.SIGALRM: print "SIGALRM received. Timeout waiting for SIGUSR1."
7fc4e329b2fb61c2e3a4520c94120c45bcc72810 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/7fc4e329b2fb61c2e3a4520c94120c45bcc72810/client.py
self._daemon = subprocess.Popen( ['python', '-c', 'import ldtpd; ldtpd.main()'], close_fds = True)
self._daemon = os.spawnlp(os.P_NOWAIT, 'python', 'python', '-c', 'import ldtpd; ldtpd.main()')
def _spawn_daemon(self): self._daemon = subprocess.Popen( ['python', '-c', 'import ldtpd; ldtpd.main()'], close_fds = True)
6a274309339d6d3c366fca4e15b281d9b9132e78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/6a274309339d6d3c366fca4e15b281d9b9132e78/client.py
self._daemon.kill()
os.kill(self._daemon, 9)
def kill_daemon(self): try: self._daemon.kill() except AttributeError: pass
6a274309339d6d3c366fca4e15b281d9b9132e78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/6a274309339d6d3c366fca4e15b281d9b9132e78/client.py
raise LdtpServerException('Could not find a child.')
if child_name: _name = 'name "%s" ' % child_name if role: _role = 'role "%s" ' % role if parent: _parent = 'parent "%s"' % parent exception = 'Could not find a child %s%s%s' % (_name, _role, _parent) raise LdtpServerException(exception)
def _get_all_children_under_obj(obj, child_list): if role and obj['class'] == role: child_list.append(obj['key']) elif child_name and self._match_name_to_appmap(child_name, obj): child_list.append(obj['key']) if obj: children = obj['children'] if not children: return child_list for child in children: return _get_all_ch...
59d960e05a787b32fb46726d225f7cb5c7ce7e4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/59d960e05a787b32fb46726d225f7cb5c7ce7e4a/core.py
raise LdtpServerException('Could not find a child.')
if child_name: _name = 'name "%s" ' % child_name if role: _role = 'role "%s" ' % role if parent: _parent = 'parent "%s"' % parent exception = 'Could not find a child %s%s%s' % (_name, _role, _parent) raise LdtpServerException(exception)
def _get_all_children_under_obj(obj, child_list): if role and obj['class'] == role: child_list.append(obj['key']) elif child_name and self._match_name_to_appmap(child_name, obj): child_list.append(obj['key']) if obj: children = obj['children'] if not children: return child_list for child in children: return _get_all_ch...
59d960e05a787b32fb46726d225f7cb5c7ce7e4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/59d960e05a787b32fb46726d225f7cb5c7ce7e4a/core.py
if child_obj: return child_obj
if child_obj: return child_obj
def _get_child_object_type(self, obj, role_type): """ This function will check for all levels and returns the first matching role_type """ try: if obj and role_type: for child in obj: if not child: continue if child.childCount > 0: child_obj = self._get_child_object_type(child, role_type) if child_obj: return child_obj...
915f62d5410c1f3cad3555e5ba795ed43c4d929b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/915f62d5410c1f3cad3555e5ba795ed43c4d929b/utils.py
@rtype: string
@rtype: list
def getcpustat(self, process_name): """ get CPU stat for the give process name
9cd025e9ee04c34cacf9c2d8f53a1a30827bb71d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/9cd025e9ee04c34cacf9c2d8f53a1a30827bb71d/core.py
if _object_name == name:
if _object_name == name:
def _match_name_to_acc(self, name, acc): if acc.name == name: return 1 _ldtpize_accessible_name = self._ldtpize_accessible(acc) _object_name = u'%s%s' % (_ldtpize_accessible_name[0], _ldtpize_accessible_name[1]) if _object_name == name: return 1 if self._glob_match(name, acc.name): return 1 if self._glob_match(name, _...
e03e56a3772febd94e812dda3639ae19433f4b0d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11266/e03e56a3772febd94e812dda3639ae19433f4b0d/utils.py