rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
if obj is None and obj != 'NULL':
if obj is None or obj == 'NULL':
def CreateLayer(self, name, srs = None, geom_type = wkbUnknown, options = [] ): if srs is None: srs_o = 'NULL' else: srs_o = srs._o md_c = _gdal.ListToStringList( options ) obj = _gdal.OGR_DS_CreateLayer( self._o, name, srs_o, geom_type, md_c) _gdal.CSLDestroy(md_c) if obj is None and obj != 'NULL': raise ValueError, g...
17f10d89fb123f60ceab67de83b0d7b25f0aeb59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/17f10d89fb123f60ceab67de83b0d7b25f0aeb59/ogr.py
def __init__(self, type=None, obj=None):
def __init__(self, type=None, obj=None, wkt=None):
def __init__(self, type=None, obj=None): if obj is not None: self._o = obj elif type is not None: self._o = _gdal.OGR_G_CreateGeometry( type ) else: raise ValueError, 'OGRGeometry may not be directly instantiated.'
17f10d89fb123f60ceab67de83b0d7b25f0aeb59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/17f10d89fb123f60ceab67de83b0d7b25f0aeb59/ogr.py
if _obj = None or _obj == "NULL" :
if _obj is None or _obj == "NULL" :
def Open(file,access=GA_ReadOnly): _gdal.GDALAllRegister() _obj = _gdal.GDALOpen(file,access) if _obj = None or _obj == "NULL" : return None; else: _gdal.GDALDereferenceDataset( _obj ) return Dataset(_obj)
2aec0ab68f34196519e629d434d2a877aa9a21d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/2aec0ab68f34196519e629d434d2a877aa9a21d0/gdal.py
shp_layer = shp_ds.CreateLayer( 'out', geom_type = ogr.wkbPolygon )
shp_layer = shp_ds.CreateLayer( 'out', geom_type = ogr.wkbPolygon, srs = nad83 )
def Usage(): print 'Usage: tigerpoly.py infile [outfile].shp' print sys.exit(1)
a8fc9e07c872caea0a539189560d3ae1f381780a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/a8fc9e07c872caea0a539189560d3ae1f381780a/tigerpoly.py
def Usage(): print print 'Read coordinate system and geotransformation matrix from input' print 'file and report latitude/longitude coordinates for the center' print 'of the specified pixel.' print print 'Usage: tolatlong.py pixel line infile' print sys.exit( 1 )
56457018d6c178c3d0d37483bd80bbe674335b48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/56457018d6c178c3d0d37483bd80bbe674335b48/tolatlong.py
(lat, long, height) = ct.TransformPoint(X, Y)
(long, lat, height) = ct.TransformPoint(X, Y)
def Usage(): print print 'Read coordinate system and geotransformation matrix from input' print 'file and report latitude/longitude coordinates for the center' print 'of the specified pixel.' print print 'Usage: tolatlong.py pixel line infile' print sys.exit( 1 )
56457018d6c178c3d0d37483bd80bbe674335b48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/56457018d6c178c3d0d37483bd80bbe674335b48/tolatlong.py
print 'latitude: %fd\t\tlongitude: %fd' % (long, lat) print 'latitude: ', gdal.DecToDMS(long, 'Lat', 2), \ '\tlongitude: ', gdal.DecToDMS(lat, 'Long', 2)
print 'latitude: %fd\t\tlongitude: %fd' % (lat, long) print 'latitude: ', gdal.DecToDMS(lat, 'Lat', 2), \ '\tlongitude: ', gdal.DecToDMS(long, 'Long', 2)
def Usage(): print print 'Read coordinate system and geotransformation matrix from input' print 'file and report latitude/longitude coordinates for the center' print 'of the specified pixel.' print print 'Usage: tolatlong.py pixel line infile' print sys.exit( 1 )
56457018d6c178c3d0d37483bd80bbe674335b48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/56457018d6c178c3d0d37483bd80bbe674335b48/tolatlong.py
driver_count = _gdal.GDALGetDriverCount() for iDriver in range(driver_count): driver_o = _gdal.GDALGetDriver( iDriver ) if _gdal.GDALGetDriverShortName(driver_o) == name: return Driver(driver_o) return None
driver_o = _gdal.GDALGetDriverByName( name ) if driver_o is None or driver_o == "NULL": return None else: return Driver( driver_o )
def GetDriverByName(name): _gdal.GDALAllRegister() driver_count = _gdal.GDALGetDriverCount() for iDriver in range(driver_count): driver_o = _gdal.GDALGetDriver( iDriver ) if _gdal.GDALGetDriverShortName(driver_o) == name: return Driver(driver_o) return None
b2e16229b70e93b98d38437267014e859a135acd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/b2e16229b70e93b98d38437267014e859a135acd/gdal.py
base.append([CXT_Attribute,'Z',[CXT_Text,yval]])
base.append([CXT_Attribute,'Z',[CXT_Text,zval]])
def serialize(self,with_Z=0): base = [CXT_Element,'GCP'] base.append([CXT_Attribute,'Id',[CXT_Text,self.Id]]) pixval = '%0.15E' % self.GCPPixel lineval = '%0.15E' % self.GCPLine xval = '%0.15E' % self.GCPX yval = '%0.15E' % self.GCPY zval = '%0.15E' % self.GCPZ base.append([CXT_Attribute,'Pixel',[CXT_Text,pixval]]) bas...
d094e32505ff6cdd363b6970089e167ac8ff566b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/d094e32505ff6cdd363b6970089e167ac8ff566b/gdal.py
psize_y = -1 * abs(float(argv[i+1]))
psize_y = -1 * abs(float(argv[i+2]))
def Usage(): print 'Usage: gdal_merge.py [-o out_filename] [-of out_format] [-co NAME=VALUE]*' print ' [-ps pixelsize_x pixelsize_y] [-separate] [-v] [-pct]' print ' [-ul_lr ulx uly lrx lry] [-n nodata_value] [-init value]' print ' [-ot datatype] input_files' ...
c5105af11340551759e9415287709d647d4bc262 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/c5105af11340551759e9415287709d647d4bc262/gdal_merge.py
o = SpatialReference(obj=_gdal.OSRClone( self._o ))
o = _gdal.OSRClone( self._o )
def Clone(self): o = SpatialReference(obj=_gdal.OSRClone( self._o )) if o is None or o == 'NULL': return None else: return SpatialReference(obj=o)
6b2098721b3e54cb3475974cd628e2c8926e7c59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/6b2098721b3e54cb3475974cd628e2c8926e7c59/osr.py
return SpatialReference(obj=_gdal.OSRCloneGeogCS( self._o ))
o = _gdal.OSRCloneGeogCS( self._o ) if o is None: return None else: return SpatialReference(obj=o)
def CloneGeogCS(self): return SpatialReference(obj=_gdal.OSRCloneGeogCS( self._o ))
80892844c11b28d8216329a91f08ecd8218b65c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/80892844c11b28d8216329a91f08ecd8218b65c3/osr.py
return SpatialReference(obj=_gdal.OSRClone( self._o ))
o = SpatialReference(obj=_gdal.OSRClone( self._o )) if o is None: return None else: return SpatialReference(obj=o)
def Clone(self): return SpatialReference(obj=_gdal.OSRClone( self._o ))
80892844c11b28d8216329a91f08ecd8218b65c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/80892844c11b28d8216329a91f08ecd8218b65c3/osr.py
ROOT.SgErrorIgnoreLevel = 3000
ROOT.gErrorIgnoreLevel = 3000
def test2ClassOverloads( self ): """Test functions overloaded on void* and non-existing classes."""
6f80a997066aaefb96d6a962831fe9245ed8e71b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/707/6f80a997066aaefb96d6a962831fe9245ed8e71b/PyROOT_overloadtests.py
for var in "CCSHARED","GCCSHARED":
for var in "CCSHARED","GCCSHARED","CFLAGS","OPT":
def disable_fPIC(): """Disable -fPIC in the c compiler command line. Some unix setups need -fPIC turned off to successfully compile video/libavcodec/i386/dsputil_mmx.c (and other files). Distutils gets the flag by parsing python2.3/config/Makefile and storing the result in a cache. This function is a hack that depen...
0c2bc0d2d208a80c2039c4be8a4ec30b39fc71b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/0c2bc0d2d208a80c2039c4be8a4ec30b39fc71b6/setup.py
def _getVStreamParams( self, vindex, vparams, r ):
def _getStreamParams( self, vindex, aindex, vparams, aparams, r ):
def _getVStreamParams( self, vindex, vparams, r ): # Decode one video frame and 1 audio frame to get stream data vDec= None for d in r: try: # Demux file into streams if d[ 0 ]== vindex: if not vDec: vDec= vcodec.Decoder( vparams ) vfr= vDec.decode( d[ 1 ] ) if vfr and vfr.data: if vfr.aspect_ratio> .0: self.pictureSiz...
c3a3c2f30c4310861582df4d5b48de338da7e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/c3a3c2f30c4310861582df4d5b48de338da7e8d1/player.py
vDec= None
vDec= aDec= None
def _getVStreamParams( self, vindex, vparams, r ): # Decode one video frame and 1 audio frame to get stream data vDec= None for d in r: try: # Demux file into streams if d[ 0 ]== vindex: if not vDec: vDec= vcodec.Decoder( vparams ) vfr= vDec.decode( d[ 1 ] ) if vfr and vfr.data: if vfr.aspect_ratio> .0: self.pictureSiz...
c3a3c2f30c4310861582df4d5b48de338da7e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/c3a3c2f30c4310861582df4d5b48de338da7e8d1/player.py
break
if aindex== -1 or aDec: break elif d[ 0 ]== aindex: if not aDec: aDec= acodec.Decoder( aparams ) afr= aDec.decode( d[ 1 ] ) if afr and afr.data: self.aBitRate= afr.bitrate self.aSampleRate= afr.sample_rate self.aChannels= afr.channels if vindex== -1 or vDec: break
def _getVStreamParams( self, vindex, vparams, r ): # Decode one video frame and 1 audio frame to get stream data vDec= None for d in r: try: # Demux file into streams if d[ 0 ]== vindex: if not vDec: vDec= vcodec.Decoder( vparams ) vfr= vDec.decode( d[ 1 ] ) if vfr and vfr.data: if vfr.aspect_ratio> .0: self.pictureSiz...
c3a3c2f30c4310861582df4d5b48de338da7e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/c3a3c2f30c4310861582df4d5b48de338da7e8d1/player.py
if self.snd== None:
if self.aBitRate== -1:
def _processAudioFrame( self, d ): # Decode audio frame afr= self.ac.decode( d[ 1 ] ) if afr: # See if we have to set up the sound if self.snd== None: self.aBitRate= afr.bitrate self.aSampleRate= afr.sample_rate self.aChannels= afr.channels try: # Hardcoded S16 ( 16 bit signed ) for now #print 'Opening sound', afr.samp...
c3a3c2f30c4310861582df4d5b48de338da7e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/c3a3c2f30c4310861582df4d5b48de338da7e8d1/player.py
self.snd= sound.Output( afr.sample_rate, afr.channels, sound.AFMT_S16_LE, self.audioCard )
self.snd= sound.Output( self.aSampleRate, self.aChannels, sound.AFMT_S16_LE, self.audioCard )
def _processAudioFrame( self, d ): # Decode audio frame afr= self.ac.decode( d[ 1 ] ) if afr: # See if we have to set up the sound if self.snd== None: self.aBitRate= afr.bitrate self.aSampleRate= afr.sample_rate self.aChannels= afr.channels try: # Hardcoded S16 ( 16 bit signed ) for now #print 'Opening sound', afr.samp...
c3a3c2f30c4310861582df4d5b48de338da7e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/c3a3c2f30c4310861582df4d5b48de338da7e8d1/player.py
if self.startPos: self.seekTo( self.startPos )
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.clearError() if type( self.playingFile ) in ( str, unicode ): try: f= open( ...
c3a3c2f30c4310861582df4d5b48de338da7e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/c3a3c2f30c4310861582df4d5b48de338da7e8d1/player.py
if self.vindex>= 0: self._getVStreamParams( self.vindex, streams[ self.vindex ], r )
as= vs= None if self.aindex!= -1: as= streams[ self.aindex ] if self.vindex!= -1: vs= streams[ self.vindex ] self._getStreamParams( self.vindex, self.aindex, vs, as, r )
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.clearError() if type( self.playingFile ) in ( str, unicode ): try: f= open( ...
c3a3c2f30c4310861582df4d5b48de338da7e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/c3a3c2f30c4310861582df4d5b48de338da7e8d1/player.py
if self.endPos and self._getPTS()* 1000> self.endPos:
if self.endPos and self._getPTS()> self.endPos:
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.clearError() if type( self.playingFile ) in ( str, unicode ): try: f= open( ...
c3a3c2f30c4310861582df4d5b48de338da7e8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/c3a3c2f30c4310861582df4d5b48de338da7e8d1/player.py
def loadIcon( self, paramName, default ):
def loadIcon( self, paramName, default, alpha= -1 ):
def loadIcon( self, paramName, default ): icons= self.getParam( paramName, default ) icons1= None if type( icons )== str: icons1= pygame.image.load( 'icons/'+ icons ) elif type( icons )== list or type( icons )== tuple: icons1= map( lambda x: pygame.image.load( 'icons/'+ x ), icons ) return icons1
e576803fb4e21a74a7e94a27a8f3538dab49a9be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/e576803fb4e21a74a7e94a27a8f3538dab49a9be/generic.py
font= pygame.font.SysFont( fontName, int( fontSize ) )
font= pygame.font.Font( 'icons/'+ fontName+ '.ttf', int( fontSize ) )
def loadFont( self, paramName ): fontName= self.getParam( paramName, DEFAULT_FONT ) fontSize= self.getParam( paramName+ 'Size', DEFAULT_FONT_SIZE ) font= pygame.font.SysFont( fontName, int( fontSize ) ) if self.getParam( paramName+ 'Bold', 'no' )== 'yes': font.set_bold( 1 ) fontColor= self.getParamList( paramName+ 'Co...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
text= self.font[ 0 ].render( item[ 'caption' ], 1 , self.font[ 1 ] )
text1= self.font[ 0 ].render( item[ 'caption' ], 1 , self.font[ 1 ] ) text= self.font[ 0 ].render( item[ 'caption' ], 1 , (0,0,0) ) text.blit( text1, (-1,-1))
def drawItem( self, itemPos, isFocused ): item= self.itemsWrapper.items()[ itemPos ] # Find out whether it is a directory or file text= self.font[ 0 ].render( item[ 'caption' ], 1 , self.font[ 1 ] ) # Center text into rect resItem= [] if isFocused== 1: resItem.append( ( self.stripeIcon, LEFT_C ) ) resItem.append( ( t...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
self.navIcons= self.loadIcon( 'navIcons', ( 'up_0.gif', 'down_0.gif' ) )
self.navIcons= self.loadIcon( 'navIcons', NAV_ICONS )
def __init__( self, rect, params, renderClass ): """ __init__( rect, renderClass, eventQueue ) -> Constructor for the class. renderClass - is a class which knows how to display certain type of files control will display default icons and behaviors when None or not specified. eventQueue - allows to process some items in...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
"""
Initiate process of displaying the data """
def init( self, itemsWrapper, activeItem= 0 ): """ """ # Initiate process of displaying the data itemsWrapper.init() self.renderClass.setItemsWrapper( itemsWrapper ) self.itemsWrapper= itemsWrapper self.lastActiveItem= -1 self.setItems( self.activeItem ) self.moveTo( activeItem )
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
"""
Return effective window height excluding header and footer areas """ i= 0
def getEffectiveHeight( self ): """ """ if self.scrollFlag: return self.rect[ 3 ]- self.scrollFont[ 0 ].get_height() else: return self.rect[ 3 ]
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
return self.rect[ 3 ]- self.scrollFont[ 0 ].get_height() else: return self.rect[ 3 ]
i+= self.scrollFont[ 0 ].get_linesize() if self.headerIcon: i+= self.headerFont[ 0 ].get_linesize() return self.rect[ 3 ]- i
def getEffectiveHeight( self ): """ """ if self.scrollFlag: return self.rect[ 3 ]- self.scrollFont[ 0 ].get_height() else: return self.rect[ 3 ]
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
return int( self.rect[ 2 ] / self.getRenderer().getItemSize()[ 0 ] )
return int( self.getEffectiveWidth() / self.getRenderer().getItemSize()[ 0 ] )
def getItemsPerRow( self ): """ Calculate number of items per row """ return int( self.rect[ 2 ] / self.getRenderer().getItemSize()[ 0 ] )
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
return int( self.rect[ 3 ] / self.getRenderer().getItemSize()[ 1 ] )
return int( self.getEffectiveHeight() / self.getRenderer().getItemSize()[ 1 ] )
def getItemsPerColumn( self ): """ Calculate number of items per column """ return int( self.rect[ 3 ] / self.getRenderer().getItemSize()[ 1 ] )
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
getActiveItem() -> ( index ) return active item as an index
return active item as an index
def getActiveItem( self ): """ getActiveItem() -> ( index ) return active item as an index """ return self.activeItem
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
def showItem( self, i, pos ):
def setHeader( self, title ): i= self.getEffectiveWidth() size= self.headerFont[ 0 ].size( title ) while size[ 0 ]> i: title= title[ 1: ] size= self.headerFont[ 0 ].size( title ) self.headerIcon= self.headerFont[ 0 ].render( title, 1, self.headerFont[ 1 ] ) j= self.headerIcon.get_width() self.headerIcon= (( self.heade...
def showItem( self, i, pos ): item= self.getRenderer().drawItem( i, self.activeItem== i and self.isActive() ) return self.adjustPos( item, pos )
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
def showLine( self, yPos, start ): """ _showLine( yPos ) -> ( success )
def renderLine( self, yPos, start ): """ showLine( yPos, startIndex ) -> ( currentIndex, items )
def showLine( self, yPos, start ): """ _showLine( yPos ) -> ( success ) Shows line based either on top of current items or at the bottom. Returns whether it was successfull. """ # Get drawer class renderClass= self.getRenderer() # Find out which item we should start from and how many of them would be displayed itemSiz...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
itemsPerLine= self.getItemsPerRow()
itemsPerRow= self.getItemsPerRow()
def showLine( self, yPos, start ): """ _showLine( yPos ) -> ( success ) Shows line based either on top of current items or at the bottom. Returns whether it was successfull. """ # Get drawer class renderClass= self.getRenderer() # Find out which item we should start from and how many of them would be displayed itemSiz...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
for i in xrange( start, start+ itemsPerLine ):
for i in xrange( start, start+ itemsPerRow ):
def showLine( self, yPos, start ): """ _showLine( yPos ) -> ( success ) Shows line based either on top of current items or at the bottom. Returns whether it was successfull. """ # Get drawer class renderClass= self.getRenderer() # Find out which item we should start from and how many of them would be displayed itemSiz...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
res+= self.showItem( i, ( xPos, yPos ) )
res+= self.renderItem( i, ( xPos, yPos ) )
def showLine( self, yPos, start ): """ _showLine( yPos ) -> ( success ) Shows line based either on top of current items or at the bottom. Returns whether it was successfull. """ # Get drawer class renderClass= self.getRenderer() # Find out which item we should start from and how many of them would be displayed itemSiz...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
def showStatusLine( self ):
def renderHeader( self ): """ renderHeader() -> yOffs, header Returns header if any. """ if self.headerIcon: return self.headerIcon[ 0 ][ 0 ].get_height(), list( self.headerIcon ) else: return 0, [] def renderStatusLine( self ): """ showStatusLine() -> statusLineItems Returns status items that been rendered if any....
def showStatusLine( self ): if self.isActive()== 0: return [] text= self.scrollFont[ 0 ].render( '%d of %d' % ( self.activeItem+ 1, self.getItemsCount() ), 1, self.scrollFont[ 1 ] ) totalWidth= self.navIcons[ 0 ].get_width()* 2+ text.get_width()+ 30 yPos= self.rect[ 3 ]- text.get_height()- 5 res= [ ( text, ( self.rect...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
return self.adjustPos( self.renderMessage( 'Empty' ), self.rect[ :2 ] ) yPos= 0 i= self.startFrom res= [] while i< self.getItemsCount() and yPos+ itemSize[ 1 ]< self.getEffectiveHeight(): j, resTmp= self.showLine( yPos, i ) i+= j res+= resTmp yPos+= itemSize[ 1 ] if ( self.activeItem< self.startFrom or self.activeI...
res+= self.renderCustomMessage( EMPTY ) else: iInitial= yPos i= self.startFrom while i< self.getItemsCount() and yPos- iInitial+ itemSize[ 1 ]<= self.getEffectiveHeight(): j, resTmp= self.renderLine( yPos, i ) i+= j res+= resTmp yPos+= itemSize[ 1 ] if ( self.activeItem< self.startFrom or self.activeItem> self.getLa...
def render( self ): # Start showing the menu if there was a change if self.visible== 0: return [] itemSize= self.getRenderer().getItemSize() # Render only message when list is empty if self.getItemsCount()== 0: self.activeItem= -1 return self.adjustPos( self.renderMessage( 'Empty' ), self.rect[ :2 ] ) # Show items o...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
class MenuWrapper: def __init__( self, items ): self.menuItems= items def items( self ): return self.menuItems import pygame resolution = 640,480 pygame.init() screen = pygame.display.set_mode(resolution) rect= ( 210,120,210,200 ) params= { 'font': 'Arial.ttf', 'fontSize': '20', 'fontColor': '89,150,255', 'scroll': 'n...
print 'This module cannot run. It should be used in pymedia library only.'
def render( self ): # Start showing the menu if there was a change if self.visible== 0: return [] itemSize= self.getRenderer().getItemSize() # Render only message when list is empty if self.getItemsCount()== 0: self.activeItem= -1 return self.adjustPos( self.renderMessage( 'Empty' ), self.rect[ :2 ] ) # Show items o...
d9a3fcad65a250470ef1d11adeb46423c5b58db4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/d9a3fcad65a250470ef1d11adeb46423c5b58db4/generic.py
self.err= []
def __init__( self, callback= None ): """ Create new Player instance. In case if you want to play video you have to supply the callback class instance which will get video data and will be able to display it properly ( onVideoReady() call ). For audio data the playback is done through the pymedia.sound.Output object. B...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.err.append( sys.exc_info()[1] )
self.err.append( sys.exc_info() )
def _initAudio( self, params ): try: # Reset audio stream self._resetAudio() # Initializing audio codec self.ac= acodec.Decoder( params ) except: self.err.append( sys.exc_info()[1] )
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
else: lStreams= filter( lambda x: x and ( x[ 'length' ]> 0 ), dm.streams ) if len( lStreams ): self.length= max( [ x[ 'length' ] for x in lStreams ] ) else: self.length= -1
def _getStreamLength( self, format, dm, f, fr ): # Demux frames from the beginning and from the end and get the PTS diff if not dm.hasHeader(): startPTS= -1 for d in fr: if d[ 3 ]> 0: startPTS= d[ 3 ] / 90 break
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.err.append( sys.exc_info()[1] )
self.err.append( sys.exc_info() )
def _getVStreamParams( self, vindex, vparams, r ): # Decode one video frame and 1 audio frame to get stream data vDec= None for d in r: try: # Demux file into streams if d[ 0 ]== vindex: if not vDec: vDec= vcodec.Decoder( vparams ) vfr= vDec.decode( d[ 1 ] ) if vfr and vfr.data: if vfr.aspect_ratio> .0: self.pictureSiz...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
def _processVideo( self, forced= False ): while 1: if len( self.decodedFrames )== 0: return vfr, videoPTS= self.decodedFrames[ 0 ] self.vDelay= videoPTS- self.seekADelta- self._getPTS() frRate= float( vfr.rate_base )/ vfr.rate res= self._decodeVideoFrame() #print '<<', res, self.vDelay, self.frameNum, videoPTS, self.g...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.snd.setVolume( self.volume )
def _processAudioFrame( self, d ): # Decode audio frame afr= self.ac.decode( d[ 1 ] ) if afr: # See if we have to set up the sound if self.snd== None: self.aBitRate= afr.bitrate self.aSampleRate= afr.sample_rate self.aChannels= afr.channels try: # Hardcoded S16 ( 16 bit signed ) for now self.snd= sound.Output( afr.samp...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.snd.setVolume( self.volume )
def _processAudioFrame( self, d ): # Decode audio frame afr= self.ac.decode( d[ 1 ] ) if afr: # See if we have to set up the sound if self.snd== None: self.aBitRate= afr.bitrate self.aSampleRate= afr.sample_rate self.aChannels= afr.channels try: # Hardcoded S16 ( 16 bit signed ) for now self.snd= sound.Output( afr.samp...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.err.append( sys.exc_info()[1] )
self.err.append( sys.exc_info() )
def _processAudioFrame( self, d ): # Decode audio frame afr= self.ac.decode( d[ 1 ] ) if afr: # See if we have to set up the sound if self.snd== None: self.aBitRate= afr.bitrate self.aSampleRate= afr.sample_rate self.aChannels= afr.channels try: # Hardcoded S16 ( 16 bit signed ) for now self.snd= sound.Output( afr.samp...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.aDecodedFrames.append( afr )
data= afr.data if len( data )> self.maxBufSize: data= str( data ) while len( data )> self.maxBufSize: chunk= data[ : self.maxBufSize ] data= data[ self.maxBufSize: ] self.aDecodedFrames.append( ( chunk, afr.sample_rate, afr.channels ) ) self.aDecodedFrames.append( ( data, afr.sample_rate, afr.channels ) )
def _processAudioFrame( self, d ): # Decode audio frame afr= self.ac.decode( d[ 1 ] ) if afr: # See if we have to set up the sound if self.snd== None: self.aBitRate= afr.bitrate self.aSampleRate= afr.sample_rate self.aChannels= afr.channels try: # Hardcoded S16 ( 16 bit signed ) for now self.snd= sound.Output( afr.samp...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
if len( self.aDecodedFrames[ 0 ].data )> snd.getSpace() and self.vindex!= -1:
if len( self.aDecodedFrames[ 0 ][ 0 ] )> snd.getSpace() and self.vindex!= -1:
def _processAudio( self ): snd= self.snd while len( self.aDecodedFrames ) and snd: # See if we can play sound chunk without clashing with the video frame if len( self.aDecodedFrames[ 0 ].data )> snd.getSpace() and self.vindex!= -1: break #print 'player SOUND LEFT:', self.snd.getLeft(), self.snd.getSpace(), self.isPlay...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
afr= self.aDecodedFrames.pop(0) s= afr.data
data, sampleRate, channnels= self.aDecodedFrames.pop(0)
def _processAudio( self ): snd= self.snd while len( self.aDecodedFrames ) and snd: # See if we can play sound chunk without clashing with the video frame if len( self.aDecodedFrames[ 0 ].data )> snd.getSpace() and self.vindex!= -1: break #print 'player SOUND LEFT:', self.snd.getLeft(), self.snd.getSpace(), self.isPlay...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
afr1= self.callback.onAudioReady( afr ) if afr1: s= afr1
data1= self.callback.onAudioReady( data, sampleRate, channnels ) if data1: data= data1
def _processAudio( self ): snd= self.snd while len( self.aDecodedFrames ) and snd: # See if we can play sound chunk without clashing with the video frame if len( self.aDecodedFrames[ 0 ].data )> snd.getSpace() and self.vindex!= -1: break #print 'player SOUND LEFT:', self.snd.getLeft(), self.snd.getSpace(), self.isPlay...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
s= self.resampler.resample( s ) snd.play( s )
data= self.resampler.resample( data ) snd.play( data )
def _processAudio( self ): snd= self.snd while len( self.aDecodedFrames ) and snd: # See if we can play sound chunk without clashing with the video frame if len( self.aDecodedFrames[ 0 ].data )> snd.getSpace() and self.vindex!= -1: break #print 'player SOUND LEFT:', self.snd.getLeft(), self.snd.getSpace(), self.isPlay...
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
volume = [ 0..255 ]
volume = [ 0..65535 ]
def setVolume( self, volume ): """ Set volume for the media track to play volume = [ 0..255 ] """ self.volume= volume if self.snd: self.snd.setVolume( self.volume )
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
if self.snd: self.snd.setVolume( self.volume )
conns= sound.Mixer().getControls() if len( conns ): conns[ 0 ][ 'control' ].setValue( self.volume )
def setVolume( self, volume ): """ Set volume for the media track to play volume = [ 0..255 ] """ self.volume= volume if self.snd: self.snd.setVolume( self.volume )
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
Get volume for the playing media track """ if self.snd: return self.snd.getVolume()
Get volume for the playing media track 0..65535 """ conns= sound.Mixer().getControls() if len( conns ): return conns[ 0 ][ 'control' ].getValue() return 0
def getVolume( self ): """ Get volume for the playing media track """ if self.snd: return self.snd.getVolume()
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
return self.aBitRate
if self.aindex!= -1: return self.aBitRate return 0 def getBitRate( self ): """ Get bitrate for the full stream """ return self.getABitRate()+ self.vBitRate
def getABitRate( self ): """ Get bitrate for the audio stream if present """ return self.aBitRate
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
return self._getPTS()
if self.isPlaying(): return self._getPTS() return 0
def getPosition( self ): """ Returns current position for the media """ return self._getPTS()
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
return 0
return 0
def _getPTS( self ): if self.aindex== -1: if not self.aPTS: self.aPTS= time.time() return time.time()- self.aPTS if self.snd== None: return 0 p= self.snd.getPosition() return p+ self.aDelta
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.err= []
self.clearError()
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.err.append( sys.exc_info()[1] )
self.err.append( sys.exc_info() )
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.err.append( sys.exc_info()[1] )
self.err.append( sys.exc_info() )
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
s= f.read( FILE_CHUNK ) r= dm.parse( s )
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.err= []
self.clearError()
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self._getStreamLength( format, dm, f, r )
self._getStreamLength( format, dm, f, r )
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
f.seek( self.seek* self.getABitRate()/ 8, 0 )
if self.length> 0 and self.fileSize> 0: f.seek( ( float( self.seek ) / self.length )* self.fileSize, 0 ) else: f.seek( self.seek* self.getBitRate()/ 8, 0 )
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.aDelta= seek
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
self.snd.stop()
if self.snd: self.snd.stop()
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
raise
self.err.append( sys.exc_info() ) self.playingFile= None break
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
s= f.read( 512 ) r= dm.parse( s )
try: s= f.read( 512 ) r= dm.parse( s ) except: traceback.print_exc() self.err.append( sys.exc_info() ) self.playingFile= None continue
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
506e9172460401ded500869a56c03da6aec7db18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2107/506e9172460401ded500869a56c03da6aec7db18/player.py
the fourth parameter indicates if the search should be
the third parameter indicates if the search should be
def Search(self, text, wholewords=0, titleonly=0): '''Performs full-text search on the archive. The first parameter is the word to look for, the second indicates if the search should be for whole words only, and the fourth parameter indicates if the search should be restricted to page titles. This method will return a ...
46ca4a1d2ea864fce3e706de4151224cf591ef8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6681/46ca4a1d2ea864fce3e706de4151224cf591ef8c/chm.py
print 'GetArchiveInfo:
sys.stderr.write('GetArchiveInfo:
def GetArchiveInfo(self): '''Obtains information on CHM archive. This function checks the /#SYSTEM file inside the CHM archive to obtain the index, home page, topics, encoding and title. It is called from LoadCHM. '''
92f1845bd4a8bdf41022dd6983a9bec4c35f3be4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6681/92f1845bd4a8bdf41022dd6983a9bec4c35f3be4/chm.py
print 'GetArchiveInfo: file size = 0'
sys.stderr.write('GetArchiveInfo: file size = 0\n')
def GetArchiveInfo(self): '''Obtains information on CHM archive. This function checks the /#SYSTEM file inside the CHM archive to obtain the index, home page, topics, encoding and title. It is called from LoadCHM. '''
92f1845bd4a8bdf41022dd6983a9bec4c35f3be4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6681/92f1845bd4a8bdf41022dd6983a9bec4c35f3be4/chm.py
print 'GetTopicsTree: file size = 0'
sys.stderr.write('GetTopicsTree: file size = 0\n')
def GetTopicsTree(self): '''Reads and returns the topics tree. This auxiliary function reads and returns the topics tree file contents for the CHM archive. ''' if (self.topics == None): return None
92f1845bd4a8bdf41022dd6983a9bec4c35f3be4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6681/92f1845bd4a8bdf41022dd6983a9bec4c35f3be4/chm.py
print 'GetIndex: file size = 0'
sys.stderr.write('GetIndex: file size = 0\n')
def GetIndex(self): '''Reads and returns the index tree. This auxiliary function reads and returns the index tree file contents for the CHM archive. ''' if (self.index == None): return None
92f1845bd4a8bdf41022dd6983a9bec4c35f3be4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6681/92f1845bd4a8bdf41022dd6983a9bec4c35f3be4/chm.py
if ((not self.topics) and (toc_index != 0)):
if (not self.topics):
def GetWindowsInfo(self): '''Gets information from the #WINDOWS file. Checks the #WINDOWS file to see if it has any info that was not found in #SYSTEM (topics, index or default page. ''' result, ui = chmlib.chm_resolve_object(self.file, '/#WINDOWS') if (result != chmlib.CHM_RESOLVE_SUCCESS): return -1
92f1845bd4a8bdf41022dd6983a9bec4c35f3be4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6681/92f1845bd4a8bdf41022dd6983a9bec4c35f3be4/chm.py
if ((not self.index) and (idx_index != 0)):
if (not self.index):
def GetWindowsInfo(self): '''Gets information from the #WINDOWS file. Checks the #WINDOWS file to see if it has any info that was not found in #SYSTEM (topics, index or default page. ''' result, ui = chmlib.chm_resolve_object(self.file, '/#WINDOWS') if (result != chmlib.CHM_RESOLVE_SUCCESS): return -1
92f1845bd4a8bdf41022dd6983a9bec4c35f3be4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6681/92f1845bd4a8bdf41022dd6983a9bec4c35f3be4/chm.py
if ((not self.topics) and (not self.index)): result, ui = chmlib.chm_resolve_object(self.file, '/ if (result != chmlib.CHM_RESOLVE_SUCCESS): print 'GetArchiveInfo: Could not find return 1 size, text = chmlib.chm_retrieve_object(self.file, ui, 1l, ui.length) if (size == 0): print 'GetArchiveInfo: STRINGS file size = 0'...
self.GetWindowsInfo()
def GetArchiveInfo(self): '''Obtains information on CHM archive. This function checks the /#SYSTEM file inside the CHM archive to obtain the index, home page, topics, encoding and title. It is called from LoadCHM. '''
9a4c2b3fb0670f529d6bdcf58f0a901b52e65ec4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6681/9a4c2b3fb0670f529d6bdcf58f0a901b52e65ec4/chm.py
print 'checking %s' % fullname
def lookupmodule(self, filename): """Helper function for break/clear parsing -- may be overridden.
0d9bf69cdd1f6d8799612cfe9a7ad26a022a6dcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6224/0d9bf69cdd1f6d8799612cfe9a7ad26a022a6dcd/epdb.py
return pdb.Pdb.default(self, line)
return pdb.Pdb.default(self, origLine)
def default(self, line): if line[0] == '!': line = line[1:] if self.handle_directive(line): return if line == '<<EOF': return self.multiline() if line.strip().endswith(':'): return self.multiline(line) if line.endswith('\\'): return self.multiline(line) origLine = line line = _removeQuotes(line) if line is None: return...
669e56922357b0629d9f61bda134cc7ecaf1df8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6224/669e56922357b0629d9f61bda134cc7ecaf1df8a/epdb.py
if self._historyPath: if os.path.exists(self._historyPath): readline.read_history_file(self._historyPath) atexit.register(self._save_history)
def __init__(self): self._exc_type = None self._exc_msg = None self._tb = None self._config = {} pdb.Pdb.__init__(self) if hasReadline: self._completer = erlcompleter.ECompleter() if self._historyPath: if os.path.exists(self._historyPath): readline.read_history_file(self._historyPath) atexit.register(self._save_histor...
4defa068e187c84366d877fc0f791435385e0916 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6224/4defa068e187c84366d877fc0f791435385e0916/epdb.py
def _save_history(self): if self._historyPath:
def read_history(self): if (hasReadline and self._historyPath and os.path.exists(self._historyPath)): readline.read_history_file(self._historyPath) def save_history(self): if hasReadline and self._historyPath: readline.set_history_length(1000)
def _save_history(self): if self._historyPath: readline.write_history_file(self._historyPath)
4defa068e187c84366d877fc0f791435385e0916 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6224/4defa068e187c84366d877fc0f791435385e0916/epdb.py
self.cmd.append('-Wdepend=afterok:%s' % self.after)
self.cmd.append('-Wdepend=afterok:%s' % self.afterok)
def build(self, script, args = []): self.cmd = [ self.qsub ]
00a5122c2ab8f7cda497688a0043448718484915 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/00a5122c2ab8f7cda497688a0043448718484915/pbs.py
if self.isMem(): self.is_src = '' self.is_dest = ''
def finalize(self): self.flags = self.getFlags() self.constructor = self.makeConstructor() self.op_decl = self.makeDecl()
f02f570d2e9793febba316e1c0ed81ca23d1d389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/f02f570d2e9793febba316e1c0ed81ca23d1d389/isa_parser.py
s = re.sub(r'%(?!\()', '%%', s)
s = protect_non_subst_percents(s)
def process_output(s): # protect any non-substitution '%'s (not followed by '(') s = re.sub(r'%(?!\()', '%%', s) # protects cpu-specific symbols too s = protect_cpu_symbols(s) return substBitOps(s % templateMap)
c993cf14f994e04f4727f444df86dc0cd12351d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c993cf14f994e04f4727f444df86dc0cd12351d0/isa_parser.py
return protect_cpu_symbols(self.template) % myDict
template = protect_cpu_symbols(template) return template % myDict
def subst(self, d): # Start with the template namespace. Make a copy since we're # going to modify it. myDict = templateMap.copy() # if the argument is a dictionary, we just use it. if isinstance(d, dict): myDict.update(d) # if the argument is an object, we use its attribute map. elif hasattr(d, '__dict__'): myDict.up...
c993cf14f994e04f4727f444df86dc0cd12351d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c993cf14f994e04f4727f444df86dc0cd12351d0/isa_parser.py
exportContextSymbols = ('InstObjParams', 'CodeBlock', 'makeList', 're', 'string')
exportContextSymbols = ('InstObjParams', 'makeList', 're', 'string')
def wrap_decode_block(self, pre, post = ''): self.decode_block = pre + indent(self.decode_block) + post
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
myDict = templateMap.copy() if isinstance(d, dict): myDict.update(d) elif hasattr(d, '__dict__'): myDict.update(d.__dict__) else: raise TypeError, "Template.subst() arg must be or have dictionary"
myDict = None
def subst(self, d): # Start with the template namespace. Make a copy since we're # going to modify it. myDict = templateMap.copy() # if the argument is a dictionary, we just use it. if isinstance(d, dict): myDict.update(d) # if the argument is an object, we use its attribute map. elif hasattr(d, '__dict__'): myDict.up...
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
c += '\n\t_srcRegIdx[%d] = %s;' % \
c += '\n\t_srcRegIdx[%d] = %s + Ctrl_Base_DepTag;' % \
def makeConstructor(self): c = '' if self.is_src: c += '\n\t_srcRegIdx[%d] = %s;' % \ (self.src_reg_idx, self.reg_spec) if self.is_dest: c += '\n\t_destRegIdx[%d] = %s;' % \ (self.dest_reg_idx, self.reg_spec) return c
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
c += '\n\t_destRegIdx[%d] = %s;' % \
c += '\n\t_destRegIdx[%d] = %s + Ctrl_Base_DepTag;' % \
def makeConstructor(self): c = '' if self.is_src: c += '\n\t_srcRegIdx[%d] = %s;' % \ (self.src_reg_idx, self.reg_spec) if self.is_dest: c += '\n\t_destRegIdx[%d] = %s;' % \ (self.dest_reg_idx, self.reg_spec) return c
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
base = 'xc->readMiscReg(%s)' % self.reg_spec
base = 'xc->readMiscRegOperand(this, %s)' % self.src_reg_idx
def makeRead(self): bit_select = 0 if (self.ctype == 'float' or self.ctype == 'double'): error(0, 'Attempt to read control register as FP') base = 'xc->readMiscReg(%s)' % self.reg_spec if self.size == self.dflt_size: return '%s = %s;\n' % (self.base_name, base) else: return '%s = bits(%s, %d, 0);\n' % \ (self.base_name...
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
wb = 'xc->setMiscRegWithEffect(%s, %s);\n' % (self.reg_spec, self.base_name)
wb = 'xc->setMiscRegOperandWithEffect(this, %s, %s);\n' % \ (self.dest_reg_idx, self.base_name)
def makeWrite(self): if (self.ctype == 'float' or self.ctype == 'double'): error(0, 'Attempt to write control register as FP') wb = 'xc->setMiscRegWithEffect(%s, %s);\n' % (self.reg_spec, self.base_name) wb += 'if (traceData) { traceData->setData(%s); }' % \ self.base_name return wb
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
class CodeBlock: def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code))
instFlagRE = re.compile(r'Is.*') opClassRE = re.compile(r'.*Op|No_OpClass') class InstObjParams: def __init__(self, mnem, class_name, base_class = '', snippets = None, opt_args = []): self.mnemonic = mnem self.class_name = class_name self.base_class = base_class compositeCode = '' if snippets: if not isinstance(sni...
def makeFlagConstructor(flag_list): if len(flag_list) == 0: return '' # filter out repeated flags flag_list.sort() i = 1 while i < len(flag_list): if flag_list[i] == flag_list[i-1]: del flag_list[i] else: i += 1 pre = '\n\tflags[' post = '] = true;' code = pre + string.join(flag_list, post + pre) + post return code
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
self.op_decl = self.operands.concatAttrStrings('op_decl') is_src = lambda op: op.is_src is_dest = lambda op: op.is_dest self.op_src_decl = \ self.operands.concatSomeAttrStrings(is_src, 'op_src_decl') self.op_dest_decl = \ self.operands.concatSomeAttrStrings(is_dest, 'op_dest_decl') self.op_rd = self.operands.concat...
def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ...
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
if self.operands.memOperand: self.mem_acc_size = self.operands.memOperand.mem_acc_size self.mem_acc_type = self.operands.memOperand.mem_acc_type
def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ...
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ...
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
instFlagRE = re.compile(r'Is.*') opClassRE = re.compile(r'.*Op|No_OpClass') class InstObjParams: def __init__(self, mnem, class_name, base_class = '', code = None, opt_args = [], extras = {}): self.mnemonic = mnem self.class_name = class_name self.base_class = base_class if code: if isinstance(code, CodeBlock): or...
def __init__(self, code): self.orig_code = code self.operands = OperandList(code) self.code = substMungedOpNames(substBitOps(code)) self.constructor = self.operands.concatAttrStrings('constructor') self.constructor += \ '\n\t_numSrcRegs = %d;' % self.operands.numSrcRegs self.constructor += \ '\n\t_numDestRegs = %d;' % ...
c7b684447a8771bc48d6030eca1f09d89113d4b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/c7b684447a8771bc48d6030eca1f09d89113d4b5/isa_parser.py
__all__ = ['env', 'issequence',
__all__ = ['env', 'issequence', 'panic',
def instantiate(root): instance = root.instantiate('root') instance.fixup() instance.display() if not noDot: dot = pydot.Dot() instance.outputDot(dot) dot.orientation = "portrait" dot.size = "8.5,11" dot.ranksep="equally" dot.rank="samerank" dot.write("config.dot") dot.write_ps("config.ps")
93591465b04ea2bbe43849dba6a04ab2e24ae08f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/93591465b04ea2bbe43849dba6a04ab2e24ae08f/config.py
scope = { '__file__' : sys.argv[0] }
def main(): import cc_main parse_args() done = False if options.copyright: done = True print info.LICENSE print if options.authors: done = True print 'Author information:' print print info.AUTHORS print if options.readme: done = True print 'Readme:' print print info.README print if options.release_notes: done = Tr...
a5fc6e54f9124b1b588a65615ca9e2bdd28d77bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/a5fc6e54f9124b1b588a65615ca9e2bdd28d77bc/main.py