bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def __getDecryptionKey(self, privKey, snmpEngineBoots, snmpEngineTime, salt): snmpEngineBoots, snmpEngineTime, salt = ( long(snmpEngineBoots), long(snmpEngineTime), str(salt) ) | def __getDecryptionKey(self, privKey, snmpEngineBoots, snmpEngineTime, salt): snmpEngineBoots, snmpEngineTime, salt = ( long(snmpEngineBoots), long(snmpEngineTime), str(salt) ) | 463,300 |
def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | 463,301 |
def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | 463,302 |
def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | 463,303 |
def decryptData(self, decryptKey, privParameters, encryptedData): if AES is None: raise error.StatusInformation( errorIndication='decryptionError' ) | def decryptData(self, decryptKey, privParameters, encryptedData): if AES is None: raise error.StatusInformation( errorIndication='decryptionError' ) | 463,304 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,305 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,306 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,307 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,308 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,309 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,310 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,311 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,312 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,313 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,314 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,315 |
def cfgCmdGen(self, authData, transportTarget, tagList=''): if self.__knownAuths.has_key(authData): paramsName = self.__knownAuths[authData] else: paramsName = 'p%s' % nextID() if isinstance(authData, CommunityData): config.addV1System( self.snmpEngine, authData.securityName, authData.communityName ) config.addTargetPa... | def cfgCmdGen(self, authData, transportTarget, tagList=''): if self.__knownAuths.has_key(authData): paramsName = self.__knownAuths[authData] else: paramsName = 'p%s' % nextID() if isinstance(authData, CommunityData): config.addV1System( self.snmpEngine, authData.securityName, authData.communityName ) config.addTargetPa... | 463,316 |
def _handleManagementOperation(self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx)): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) | def _handleManagementOperation(self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx)): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) | 463,317 |
def _handleManagementOperation(self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx)): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) | def _handleManagementOperation(self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx)): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) | 463,318 |
def _handleManagementOperation(self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx)): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) | def _handleManagementOperation(self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx)): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) | 463,319 |
def _handleManagementOperation(self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx)): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) | def _handleManagementOperation(self, snmpEngine, contextMibInstrumCtl, PDU, (acFun, acCtx)): nonRepeaters = v2c.apiBulkPDU.getNonRepeaters(PDU) if nonRepeaters < 0: nonRepeaters = 0 maxRepetitions = v2c.apiBulkPDU.getMaxRepetitions(PDU) if maxRepetitions < 0: maxRepetitions = 0 reqVarBinds = v2c.apiPDU.getVarBinds(PDU) | 463,320 |
def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | 463,321 |
def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | 463,322 |
def __generateRequestOrResponseMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ): snmpEngineID = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpE... | def __generateRequestOrResponseMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ): snmpEngineID = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpE... | 463,323 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,324 |
def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | def processIncomingMsg( self, snmpEngine, messageProcessingModel, maxMessageSize, securityParameters, securityModel, securityLevel, wholeMsg, msg # XXX ): # 3.2.1 try: securityParameters, rest = decoder.decode( securityParameters, asn1Spec=self._securityParametersSpec ) except PyAsn1Error: snmpInASNParseErrs, = snmpEn... | 463,325 |
def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | 463,326 |
def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | 463,327 |
def v1ToV2(v1Pdu, origV2Pdu=None): pduType = v1Pdu.tagSet v2Pdu = __v1ToV2PduMap[pduType].clone() v2c.apiPDU.setDefaults(v2Pdu) debug.logger & debug.flagPrx and debug.logger('v1ToV2: v1Pdu %s' % v1Pdu.prettyPrint()) v2VarBinds = [] # 3.1 if rfc3411.notificationClassPDUs.has_key(pduType): # 3.1.1 sysUpTime = v1.apiTr... | def v1ToV2(v1Pdu, origV2Pdu=None): pduType = v1Pdu.tagSet v2Pdu = __v1ToV2PduMap[pduType].clone() v2c.apiPDU.setDefaults(v2Pdu) debug.logger & debug.flagPrx and debug.logger('v1ToV2: v1Pdu %s' % v1Pdu.prettyPrint()) v2VarBinds = [] # 3.1 if rfc3411.notificationClassPDUs.has_key(pduType): # 3.1.1 sysUpTime = v1.apiTr... | 463,328 |
def hashPassphraseMD5(passphrase): md = md5() ringBuffer = passphrase * (64/len(passphrase)+1) ringBufferLen = len(ringBuffer) count = 0 mark = 0 while count < 16384: e = mark + 64 if e < ringBufferLen: md.update(ringBuffer[mark:e]) mark = e else: md.update( ringBuffer[mark:ringBufferLen] + ringBuffer[0:e-ringBufferLen... | def hashPassphraseMD5(passphrase): md = md5() ringBuffer = passphrase * (passphrase and (64/len(passphrase)+1) or 1) ringBufferLen = len(ringBuffer) count = 0 mark = 0 while count < 16384: e = mark + 64 if e < ringBufferLen: md.update(ringBuffer[mark:e]) mark = e else: md.update( ringBuffer[mark:ringBufferLen] + ringBu... | 463,329 |
def howto_install_setuptools(): print """Error: You need setuptools Python package! | def howto_install_setuptools(): print """Error: You need setuptools Python package! | 463,330 |
def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | 463,331 |
def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | 463,332 |
def __cbFun(sendRequestHandle, errorIndication, appReturn): appReturn['errorIndication'] = errorIndication | def __cbFun(sendRequestHandle, errorIndication, appReturn): appReturn['errorIndication'] = errorIndication | 463,333 |
def __cbFun(sendRequestHandle, errorIndication, appReturn): appReturn['errorIndication'] = errorIndication | def __cbFun(sendRequestHandle, errorIndication, appReturn): appReturn['errorIndication'] = errorIndication | 463,334 |
def htmlWrapper(infile, outfile) : stext1 = "<"; stext2 = ">"; rtext1 = "<"; rtext2 = ">"; input = sys.stdin output = sys.stdout input = open(infile) output = open(outfile, 'w') insertTag("<pre>",output) for s in input.xreadlines(): output.write(s.replace(stext1, rtext1).replace(stext2,rtext2)) insertTag("</pre>"... | def htmlWrapper(infile, outfile) : stext1 = "<"; stext2 = ">"; rtext1 = "<"; rtext2 = ">"; input = sys.stdin output = sys.stdout input = open(infile) output = open(outfile, 'w') insertTag("<pre>",output) for s in input.xreadlines(): output.write(s.replace(stext1, rtext1).replace(stext2,rtext2)) insertTag("</pre>"... | 463,335 |
def add_history(historyPath,err) : global hostname if os.path.exists(historyPath) : history = open(historyPath,"a") else : history = open(historyPath,"w") history.write("<pre>Completed Time\t\tStatus\tHostname\n") if err==0 : history.write(strftime("%Y-%m-%d %H:%M:%S")+'\tsuccess\t'+hostname+'\n') elif err==0 : history... | def add_history(historyPath,err) : global hostname if os.path.exists(historyPath) : history = open(historyPath,"a") else : history = open(historyPath,"w") history.write("<pre>Completed Time\t\tStatus\tHostname\n") if err==0 : history.write(strftime("%Y-%m-%d %H:%M:%S")+'\tsuccess\t'+hostname+'\n') else : history.write(... | 463,336 |
def testExample(id, path, nodes, input=None, args=None, ndiffDir=None,outputDir=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = ... | def testExample(id, path, nodes, input=None, args=None, ndiffDir=None,outputDir=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = ... | 463,337 |
def testExample(id, path, nodes, input=None, args=None, ndiffDir=None,outputDir=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = ... | def testExample(id, path, nodes, input=None, args=None, ndiffDir=None,outputDir=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = ... | 463,338 |
def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | 463,339 |
def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | deflogExample(path):globallogDir,logs;intellibrarylog=[]gnulibrarylog=[]intelexamplelog=[]gnuexamplelog=[]inteltestlog=[]gnutestlog=[]forloginlogs:iflog.startswith('intel_library_build'):intellibrarylog=log.split('|');iflog.startswith('gnu_library_build'):gnulibrarylog=log.split('|');iflog.startswith('intel_'+path+'_bu... | 463,340 |
def testExample(id, path, nodes, input=None, args=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = newDir + '/' + folder if not o... | def testExample(id, path, nodes, input=None, args=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = newDir + '/' + folder if not o... | 463,341 |
def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.st... | 463,342 |
def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | 463,343 |
def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | 463,344 |
def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | 463,345 |
def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | def logExample(path) : global logDir,logs; intellibrarylog=[] gnulibrarylog=[] intelexamplelog=[] gnuexamplelog=[] inteltestlog=[] gnutestlog=[] for log in logs : if log.startswith('intel_library_build') : intellibrarylog=log.split('|'); if log.startswith('gnu_library_build') : gnulibrarylog=log.split('|'); if log.star... | 463,346 |
def leafFunc(self, sofar): print('Running %s' % '/'.join(sofar) + '/run42.sh') try: ret = subprocess.call('/bin/bash run42.sh') except Exception: print('Could not run subprocess') else: if not ret == 0: print('Bad return code %d, continuing...' % ret) else: subprocess.call('mv *.exnode *.exelem expected_results') | def leafFunc(self, sofar): print('Running %s' % '/'.join(sofar) + '/run42.sh') try: ret = subprocess.call('/bin/bash run42.sh', shell=True) except Exception: print('Could not run subprocess') else: if not ret == 0: print('Bad return code %d, continuing...' % ret) else: subprocess.call('mv *.exnode *.exelem expected_res... | 463,347 |
def htmlWrapper(infile, outfile) : stext1 = "<"; stext2 = ">"; rtext1 = "<"; rtext2 = ">"; input = sys.stdin output = sys.stdout input = open(infile) output = open(outfile, 'w') insertTag("<pre>",output) for s in input.xreadlines(): output.write(s.replace(stext1, rtext1).replace(stext2,rtext2)) insertTag("</pre>"... | def htmlWrapper(infile, outfile) : stext1 = "<"; stext2 = ">"; rtext1 = "<"; rtext2 = ">"; input = sys.stdin output = sys.stdout input = open(infile) output = open(outfile, 'w') insertTag("<pre>",output) for s in input.xreadlines(): output.write(s.replace(stext1, rtext1).replace(stext2,rtext2)) insertTag("</pre>"... | 463,348 |
def htmlWrapper(infile, outfile) : stext1 = "<"; stext2 = ">"; rtext1 = "<"; rtext2 = ">"; input = sys.stdin output = sys.stdout input = open(infile) output = open(outfile, 'w') insertTag("<pre>",output) for s in input.xreadlines(): output.write(s.replace(stext1, rtext1).replace(stext2,rtext2)) insertTag("</pre>"... | def htmlWrapper(infile, outfile) : stext1 = "<"; stext2 = ">"; rtext1 = "<"; rtext2 = ">"; input = sys.stdin output = sys.stdout input = open(infile) output = open(outfile, 'w') insertTag("<pre>",output) for s in input.xreadlines(): output.write(s.replace(stext1, rtext1).replace(stext2,rtext2)) insertTag("</pre>"... | 463,349 |
def testExample(id, path, nodes, input=None, args=None, ndiffDir=None,outputDir=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = ... | def testExample(id, path, nodes, input=None, args=None, ndiffDir=None,outputDir=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = ... | 463,350 |
def testExample(id, path, nodes, input=None, args=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = newDir + '/' + folder if not o... | def testExample(id, path, nodes, input=None, args=None) : global compiler,logDir,successbuilds,f; index = successbuilds.find(compiler+'_'+path) index = successbuilds.find('|',index) if (successbuilds.startswith('success',index+1)) : newDir = logDir for folder in path.split('/') : newDir = newDir + '/' + folder if not o... | 463,351 |
def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | def copy_padded(array): """ Pad image width to a multiple of 4 pixels, and minimum dims of 12x12. QImage is very particular about its data. """ y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | 463,352 |
def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = lambda v: (4-(v%4))%4 nx = max(x+pad(x),12) ny = max(y,12) if x == nx and y == ny: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | 463,353 |
def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((ny,nx,d), dtype=np.uint8) ret[:y,:x] = array[:] return ret | 463,354 |
def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | 463,355 |
def __init__(self, size, pix_format="", parent=None, bottom_up=0): self.width = size[0] self.height = size[1] self.text_pos = [0.0, 0.0] # create some sort of device context if parent is None: self.qt_dc = QtGui.QPixmap(*size) else: self.qt_dc = parent self.gc = QtGui.QPainter(self.qt_dc) self.path = QtGui.QPainterP... | def __init__(self, size, pix_format="", parent=None, bottom_up=0): self._width = size[0] self._height = size[1] self.text_pos = [0.0, 0.0] # create some sort of device context if parent is None: self.qt_dc = QtGui.QPixmap(*size) else: self.qt_dc = parent self.gc = QtGui.QPainter(self.qt_dc) self.path = QtGui.QPainte... | 463,356 |
def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | def copy_padded(array): "pad image rows to multiples of 4 pixels" y,x,d = array.shape pad = 4-(x%4) if pad == 4: return array ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] return ret | 463,357 |
def clear(self, clear_color=(1.0,1.0,1.0,1.0)): r,g,b,a = clear_color self.gc.setBackground(QtGui.QBrush(QtGui.QColor.fromRgbF(r,g,b,a))) self.gc.eraseRect(QtCore.QRectF(0,0,self.width,self.height)) | def clear(self, clear_color=(1.0,1.0,1.0,1.0)): """ """ if len(clear_color) == 4: r,g,b,a = clear_color else: r,g,b = clear_color a = 1.0 self.gc.setBackground(QtGui.QBrush(QtGui.QColor.fromRgbF(r,g,b,a))) self.gc.eraseRect(QtCore.QRectF(0,0,self.width,self.height)) | 463,358 |
def clear(self, clear_color=(1.0,1.0,1.0,1.0)): r,g,b,a = clear_color self.gc.setBackground(QtGui.QBrush(QtGui.QColor.fromRgbF(r,g,b,a))) self.gc.eraseRect(QtCore.QRectF(0,0,self.width,self.height)) | def clear(self, clear_color=(1.0,1.0,1.0,1.0)): r,g,b,a = clear_color self.gc.setBackground(QtGui.QBrush(QtGui.QColor.fromRgbF(r,g,b,a))) self.gc.eraseRect(QtCore.QRectF(0,0,self.width(),self.height())) | 463,359 |
def new_gc(self, size): """ Creates a new GC of the requested size (or of the widget's current size if size is None) and stores it in self.gc. """ if size is None: width = self.width() height = self.height() else: width, height = size | def new_gc(self, size): """ Creates a new GC of the requested size (or of the widget's current size if size is None) and stores it in self.gc. """ if size is None: width = self.width() height = self.height() else: width, height = size | 463,360 |
def convert_from_wx_color(obj, name, value): if isinstance(value, ColourPtr) or isinstance(value, wx.Colour): return (value.Red()/255.0, value.Green()/255.0, value.Blue()/255.0, 1.0) elif isinstance(value, str): return color_table[value] elif type(value) is int: num = int( value ) return ((num >> 16)/255.0, ((num>>8) &... | def convert_from_wx_color(obj, name, value): if isinstance(value, ColourPtr) or isinstance(value, wx.Colour): return (value.Red()/255.0, value.Green()/255.0, value.Blue()/255.0, 1.0) elif type(value) is int: num = int( value ) return ((num >> 16)/255.0, ((num>>8) & 0xFF)/255.0, (num & 0xFF)/255.0, 1.0) elif type(value)... | 463,361 |
def convert_from_pyqt_color(obj, name, value): if isinstance(value, QtGui.QColor): return value.getRgbF() elif isinstance(value, Str): return color_table.get(value, transparent_color) elif type(value) is int: num = int(value) return ((num >> 16)/255.0, ((num>>8) & 0xFF)/255.0, (num & 0xFF)/255.0, 1.0) elif type(value) ... | def convert_from_pyqt_color(obj, name, value): if isinstance(value, QtGui.QColor): return value.getRgbF() elif type(value) is int: num = int(value) return ((num >> 16)/255.0, ((num>>8) & 0xFF)/255.0, (num & 0xFF)/255.0, 1.0) elif type(value) in (list, tuple): if len(value) == 3: return (value[0]/255.0, value[1]/255.0, ... | 463,362 |
def str_color(self, color): if isinstance(color, QtGui.QColor): color = color.getRgbF() | def str_color(self, color): if isinstance(color, QtGui.QColor): color = color.getRgbF() | 463,363 |
def convert_from_wx_color(obj, name, value): if isinstance(value, ColourPtr) or isinstance(value, wx.Colour): return (value.Red()/255.0, value.Green()/255.0, value.Blue()/255.0, 1.0) elif isinstance(value, str): return color_table.get(value, transparent_color) elif type(value) is int: num = int( value ) return ((num >>... | def convert_from_wx_color(obj, name, value): if isinstance(value, ColourPtr) or isinstance(value, wx.Colour): return (value.Red()/255.0, value.Green()/255.0, value.Blue()/255.0, 1.0) elif isinstance(value, str): return color_table[value] elif type(value) is int: num = int( value ) return ((num >> 16)/255.0, ((num>>8) &... | 463,364 |
def str_color(self, color): if isinstance( color, ( wx.Colour, ColourPtr ) ): return "(%d,%d,%d)" % ( color.Red(), color.Green(), color.Blue() ) elif isinstance(color, tuple): fmt = "(" + ",".join(["%0.3f"]*len(color)) + ")" return fmt % color return color | def str_color(self, color): if isinstance( color, ( wx.Colour, ColourPtr ) ): return "(%d,%d,%d)" % ( color.Red(), color.Green(), color.Blue() ) elif isinstance(color, tuple): fmt = "(" + ",".join(["%0.3f"]*len(color)) + ")" return fmt % color return color | 463,365 |
def components_at(self, x, y, add_containers = False): """ Returns the list of components inside the viewport at the given (x,y) in the viewport's native coordinate space (not in the space of the component it is viewing). | def components_at(self, x, y, add_containers = False): """ Returns the list of components inside the viewport at the given (x,y) in the viewport's native coordinate space (not in the space of the component it is viewing). | 463,366 |
def components_at(self, x, y, add_containers = False): """ Returns the list of components inside the viewport at the given (x,y) in the viewport's native coordinate space (not in the space of the component it is viewing). | def components_at(self, x, y, add_containers = False): """ Returns the list of components inside the viewport at the given (x,y) in the viewport's native coordinate space (not in the space of the component it is viewing). | 463,367 |
def _do_layout(self): if self.initiate_layout: self.component.bounds = list(self.component.get_preferred_size()) self.component.do_layout() else: super(Viewport, self)._do_layout() return | def _do_layout(self): if self.initiate_layout: self.component.bounds = list(self.component.get_preferred_size()) self.component.do_layout() else: super(Viewport, self)._do_layout() return | 463,368 |
def GetGlobalMousePosition(): pos = QtGui.QCursor.pos() return (pos.x(), pos.y()) | def GetGlobalMousePosition(): pos = QtGui.QCursor.pos() return (pos.x(), pos.y()) | 463,369 |
def get_ft2_sources((lib_name, build_info), build_dir): sources = [prefix + "/" + s for s in freetype2_sources] if sys.platform=='darwin': return sources[:] return sources[:-1] | def get_ft2_sources((lib_name, build_info), build_dir): sources = [prefix + "/" + s for s in freetype2_sources] if sys.platform=='darwin': return sources[:] return sources[:-1] | 463,370 |
def __init__(self, parent, id = 01, size = wx.DefaultSize): # need to init self.memDC before calling BaseWxCanvas.__init__ self.memDC = wx.MemoryDC() self.size = (size.GetWidth(), size.GetHeight()) WidgetClass.__init__(self, parent, id, wx.Point(0, 0), size, wx.SUNKEN_BORDER | wx.WANTS_CHARS | \ wx.FULL_REPAINT_ON_RESI... | def __init__(self, parent, id = 01, size = wx.DefaultSize): # need to init self.memDC before calling BaseWxCanvas.__init__ self.memDC = wx.MemoryDC() self._size = (size.GetWidth(), size.GetHeight()) WidgetClass.__init__(self, parent, id, wx.Point(0, 0), size, wx.SUNKEN_BORDER | wx.WANTS_CHARS | \ wx.FULL_REPAINT_ON_RES... | 463,371 |
def _create_kiva_gc(self, size): self.size = size self.bitmap = wx.EmptyBitmap(size[0], size[1]) self.memDC.SelectObject(self.bitmap) gc = gc_for_dc(self.memDC) #gc.begin() #print " **** gc is:", gc return gc | def _create_kiva_gc(self, size): self._size = size self.bitmap = wx.EmptyBitmap(size[0], size[1]) self.memDC.SelectObject(self.bitmap) gc = gc_for_dc(self.memDC) #gc.begin() #print " **** gc is:", gc return gc | 463,372 |
def blit(self, event): t1 = now() paintdc = wx.PaintDC(self) paintdc.Blit(0, 0, self.size[0], self.size[1], self.memDC, 0, 0) t2 = now() self.blit_time = t2 - t1 self.dirty = 0 return | def blit(self, event): t1 = now() paintdc = wx.PaintDC(self) paintdc.Blit(0, 0, self._size[0], self._size[1], self.memDC, 0, 0) t2 = now() self.blit_time = t2 - t1 self.dirty = 0 return | 463,373 |
def get_ft2_sources((lib_name, build_info), build_dir): sources = [prefix + "/" + s for s in freetype2_sources] if sys.platform=='darwin': return sources[:] return sources[:-1] | def get_ft2_sources((lib_name, build_info), build_dir): sources = [prefix + "/" + s for s in freetype2_sources] if sys.platform=='darwin': return sources[:] return sources[:-1] | 463,374 |
def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | def radial_gradient(self, cx, cy, r, fx, fy, stops, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | 463,375 |
def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | 463,376 |
def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | 463,377 |
def arc(self, x, y, radius, start_angle, end_angle, cw=False): """ Draw a circular arc. | def arc(self, x, y, radius, start_angle, end_angle, cw=False): """ Draw a circular arc. | 463,378 |
def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | 463,379 |
def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | 463,380 |
def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | 463,381 |
def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | 463,382 |
def draw(self,gc): dash_patterns = outer_join(self.dash_values,self.dash_values) line_length = 120 gc.save_state() gc.set_line_cap(self.line_cap) gc.translate_ctm(10,20) gc.set_stroke_color((0,0,0,1)) gc.set_line_width(self.width) for dash in dash_patterns: gc.set_line_dash(dash) gc.begin_path() gc.move_to(0, 0) gc.l... | def draw(self,gc): dash_patterns = outer_join(self.dash_values[1:], self.dash_values) line_length = 120 gc.save_state() gc.set_line_cap(self.line_cap) gc.translate_ctm(10,20) gc.set_stroke_color((0,0,0,1)) gc.set_line_width(self.width) for dash in dash_patterns: gc.set_line_dash(dash) gc.begin_path() gc.move_to(0, 0)... | 463,383 |
def show_glyphs(self): """ """ msg = "show_glyphs not implemented on PDF yet." raise NotImplementedError, msg | def show_glyphs(self): """ """ msg = "show_glyphs not implemented on PDF yet." raise NotImplementedError, msg | 463,384 |
def get_full_text_extent(self,textstring): fontname=self.gc._fontname fontsize=self.gc._fontsize #this call does not seem to work. returns zero #ascent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face.ascent) #this call does not seem to work. returns -1 #descent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face... | def get_full_text_extent(self,textstring): fontname=self.gc._fontname fontsize=self.gc._fontsize #this call does not seem to work. returns zero #ascent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face.ascent) #this call does not seem to work. returns -1 #descent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face... | 463,385 |
def get_full_text_extent(self,textstring): fontname=self.gc._fontname fontsize=self.gc._fontsize #this call does not seem to work. returns zero #ascent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face.ascent) #this call does not seem to work. returns -1 #descent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face... | def get_full_text_extent(self,textstring): fontname=self.gc._fontname fontsize=self.gc._fontsize #this call does not seem to work. returns zero #ascent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face.ascent) #this call does not seem to work. returns -1 #descent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face... | 463,386 |
def get_full_text_extent(self,textstring): fontname=self.gc._fontname fontsize=self.gc._fontsize #this call does not seem to work. returns zero #ascent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face.ascent) #this call does not seem to work. returns -1 #descent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face... | defget_full_text_extent(self,textstring):fontname=self.gc._fontnamefontsize=self.gc._fontsize#thiscalldoesnotseemtowork.returnszero#ascent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face.ascent)#thiscalldoesnotseemtowork.returns-1#descent=(reportlab.pdfbase.pdfmetrics.getFont(fontname).face.descent) | 463,387 |
def get_text_extent(self,textstring): w,h,d,l = self.get_full_text_extent(textstring) return w,h | def get_text_extent(self,textstring): w,h,d,l = self.get_full_text_extent(textstring) return w,h | 463,388 |
def makePDFObject(self): # XXX Kiva specific change raise "Not Implemented" | def makePDFObject(self): # XXX Kiva specific change raise "Not Implemented" | 463,389 |
def addObjects(self, doc): # XXX Kiva specific change raise "Not Implemented" | def addObjects(self, doc): # XXX Kiva specific change raise "Not Implemented" | 463,390 |
def addObjects(self, doc): # XXX Kiva specific changes raise "Not Implemented" | def addObjects(self, doc): # XXX Kiva specific changes raise "Not Implemented" | 463,391 |
def test_basic_viewport(self): container = Container(bounds=[100.0, 100.0]) component = Component(bounds=[50.0, 50.0], position=[5.0, 5.0]) container.add(component) view = Viewport(component=container, view_position=[10.0, 10.0], view_bounds=[50.0, 50.0]) self.assert_(view.components_at(0.0, 0.0)[0] == component) self.... | def test_basic_viewport(self): container = Container(bounds=[100.0, 100.0]) component = Component(bounds=[50.0, 50.0], position=[5.0, 5.0]) container.add(component) view = Viewport(component=container, view_position=[10.0, 10.0], view_bounds=[50.0, 50.0], position=[0,0], bounds=[50,50]) self.assert_(view.components_at(... | 463,392 |
def _window_paint(self, event): if self.control is None: return | def _window_paint(self, event): if self.control is None: return | 463,393 |
def _set_focus ( self ): "Sets the keyboard focus to this window" self.control.SetFocus() return | def _set_focus ( self ): "Sets the keyboard focus to this window" if self.control == self.control.GetCapture(): self.control.SetFocus() return | 463,394 |
def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration(None, parent_package, top_path) config.set_options( ignore_setup_xxx_py=True, assume_default_configuration=True, delegate_options_to_subpackages=True, quiet=True, ) config.add_subpackage('ent... | def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration(None, parent_package, top_path) config.set_options( ignore_setup_xxx_py=True, assume_default_configuration=True, delegate_options_to_subpackages=True, quiet=True, ) config.add_subpackage('ent... | 463,395 |
def create_texture(self, cls): '''Create a texture containing this image. | def create_texture(self, cls, rectangle): '''Create a texture containing this image. | 463,396 |
def create_texture(self, cls): '''Create a texture containing this image. | def create_texture(self, cls): '''Create a texture containing this image. | 463,397 |
def component_column(component): try: pos = 'RGBA'.index(component) return [0] * pos + [1] + [0] * (3 - pos) except ValueError: return [0, 0, 0, 0] | def component_column(component): try: pos = 'RGBA'.index(component) return [0] * pos + [1] + [0] * (3 - pos) except ValueError: return [0, 0, 0, 0] | 463,398 |
def do_draw(self, gc): w = gc.width() h = gc.height() # Draw a red gradient filled box with green border gc.rect(w/4, h/4, w/2, h/2) gc.set_line_width(5.0) gc.set_stroke_color((0.0, 1.0, 0.0, 1.0)) gc.radial_gradient(w/4, h/4, 200, w/4+100, h/4+100, [(0,1,0,0,1),(1,1,1,1,1)], 'reflect') gc.draw_path() return | def do_draw(self, gc): w = gc.width() h = gc.height() # Draw a red gradient filled box with green border gc.rect(w/4, h/4, w/2, h/2) gc.set_line_width(5.0) gc.set_stroke_color((0.0, 1.0, 0.0, 1.0)) gc.radial_gradient(w/4, h/4, 200, w/4+100, h/4+100, array([start, end]), 'reflect') gc.draw_path() return | 463,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.