rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
return privKey[:16], string.join(map(lambda x: chr(x), iv), '') | return privKey[:16], string.join(map(chr, iv), '') | def __getDecryptionKey(self, privKey, snmpEngineBoots, snmpEngineTime, salt): snmpEngineBoots, snmpEngineTime, salt = ( long(snmpEngineBoots), long(snmpEngineTime), str(salt) ) | 6c6728a9fa75cbf5dad50de60795de1d16d64891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/6c6728a9fa75cbf5dad50de60795de1d16d64891/aes.py |
snmpEngineBoots, snmpEngineTime, salt = privParameters | def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | 6c6728a9fa75cbf5dad50de60795de1d16d64891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/6c6728a9fa75cbf5dad50de60795de1d16d64891/aes.py | |
aesObj = AES.new(aesKey, AES.MODE_CFB, iv) | aesObj = AES.new(aesKey, AES.MODE_CFB, iv, segment_size=128) dataToEncrypt = dataToEncrypt + '\0' * (16-len(dataToEncrypt)%16) | def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | 6c6728a9fa75cbf5dad50de60795de1d16d64891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/6c6728a9fa75cbf5dad50de60795de1d16d64891/aes.py |
return univ.OctetString(ciphertext), salt | return univ.OctetString(ciphertext), univ.OctetString(salt) | def encryptData(self, encryptKey, privParameters, dataToEncrypt): if AES is None: raise error.StatusInformation( errorIndication='encryptionError' ) | 6c6728a9fa75cbf5dad50de60795de1d16d64891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/6c6728a9fa75cbf5dad50de60795de1d16d64891/aes.py |
aesObj = AES.new(aesKey, AES.MODE_CFB, iv) | aesObj = AES.new(aesKey, AES.MODE_CFB, iv, segment_size=128) encryptedData = encryptedData + '\0' * (16-len(encryptedData)%16) | def decryptData(self, decryptKey, privParameters, encryptedData): if AES is None: raise error.StatusInformation( errorIndication='decryptionError' ) | 6c6728a9fa75cbf5dad50de60795de1d16d64891 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/6c6728a9fa75cbf5dad50de60795de1d16d64891/aes.py |
try: maxSizeResponseScopedPDU = maxMessageSize - len(securityParameters) - 48 except PyAsn1Error: maxSizeResponseScopedPDU = 0 | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py | |
securityEngineID = securityParameters.getComponentByPosition(0) | msgAuthoritativeEngineID = securityParameters.getComponentByPosition(0) | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
if not self.__timeline.has_key(securityEngineID): debug.logger & debug.flagSM and debug.logger('processIncomingMsg: unknown securityEngineID %s' % repr(securityEngineID)) if securityEngineID: self.__timeline[securityEngineID] = ( securityParameters.getComponentByPosition(1), securityParameters.getComponentByPosition(2... | if not self.__timeline.has_key(msgAuthoritativeEngineID): debug.logger & debug.flagSM and debug.logger('processIncomingMsg: unknown securityEngineID %s' % repr(msgAuthoritativeEngineID)) if not msgAuthoritativeEngineID: | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
msgAuthoritativeEngineID = securityParameters.getComponentByPosition(0) | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py | |
snmpEngine.msgAndPduDsp.mibInstrumController, msgAuthoritativeEngineID, msgUserName | snmpEngine.msgAndPduDsp.mibInstrumController, msgAuthoritativeEngineID, msgUserName | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
securityEngineID, | msgAuthoritativeEngineID, | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
debug.logger & debug.flagSM and debug.logger('processIncomingMsg: unknown securityEngineID %s msgUserName %s' % (repr(securityEngineID), msgUserName)) | debug.logger & debug.flagSM and debug.logger('processIncomingMsg: unknown securityEngineID %s msgUserName %s' % (repr(msgAuthoritativeEngineID), msgUserName)) | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
if self.__timeline.has_key(securityEngineID): | if self.__timeline.has_key(msgAuthoritativeEngineID): | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
if not msgUserName and not securityEngineID: | if not msgUserName and not msgAuthoritativeEngineID: | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
securityEngineID=securityEngineID, | securityEngineID=msgAuthoritativeEngineID, | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
return ( securityEngineID, | return ( msgAuthoritativeEngineID, | 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... | ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ffab0a87ee018d8dd66a5dcbe0630c6fbab8f6c1/service.py |
k = transportTarget, tagList | k = paramsName, transportTarget, tagList | 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... | ca4726b65920ae01a0cc8c1915005bfed214ae2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ca4726b65920ae01a0cc8c1915005bfed214ae2f/cmdgen.py |
N = min(nonRepeaters, len(reqVarBinds)) | N = min(int(nonRepeaters), len(reqVarBinds)) | 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) | d54e32b693ad075cf7a2d9e764fe7ef936d4bbff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/d54e32b693ad075cf7a2d9e764fe7ef936d4bbff/cmdrsp.py |
if nonRepeaters: | if N: | 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) | d54e32b693ad075cf7a2d9e764fe7ef936d4bbff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/d54e32b693ad075cf7a2d9e764fe7ef936d4bbff/cmdrsp.py |
reqVarBinds[:int(nonRepeaters)], (acFun, acCtx) | reqVarBinds[:N], (acFun, acCtx) | 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) | d54e32b693ad075cf7a2d9e764fe7ef936d4bbff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/d54e32b693ad075cf7a2d9e764fe7ef936d4bbff/cmdrsp.py |
if M and R: for i in range(N, R): varBind = reqVarBinds[i] for r in range(1, M): rspVarBinds.extend(contextMibInstrumCtl.readNextVars( (varBind,), (acFun, acCtx) )) varBind = rspVarBinds[-1] if len(rspVarBinds) > self.maxVarBinds: rspVarBinds = rspVarBinds[:self.maxVarBinds] return 0, 0, rspVarBinds | varBinds = reqVarBinds[-R:] while M and R: rspVarBinds.extend( contextMibInstrumCtl.readNextVars(varBinds, (acFun, acCtx)) ) varBinds = rspVarBinds[-R:] M = M - 1 if len(rspVarBinds): return 0, 0, rspVarBinds else: raise pysnmp.smi.error.SmiError() | 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) | d54e32b693ad075cf7a2d9e764fe7ef936d4bbff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/d54e32b693ad075cf7a2d9e764fe7ef936d4bbff/cmdrsp.py |
errorStatus, errorIndex = 'genErr', errorIndication.get('idx',-1)+1 | errorStatus, errorIndex = 'genErr', len(varBinds) and 1 or 0 | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | eba049ea6c26b222cbfea39d8f59a87139288557 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/eba049ea6c26b222cbfea39d8f59a87139288557/cmdrsp.py |
errorStatus, errorIndex = 'genErr', errorIndication.get('idx',-1)+1 | errorStatus, errorIndex = 'genErr', len(varBinds) and 1 or 0 | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | eba049ea6c26b222cbfea39d8f59a87139288557 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/eba049ea6c26b222cbfea39d8f59a87139288557/cmdrsp.py |
debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: local user usmUserName %s usmUserAuthProtocol %s usmUserPrivProtocol %s by securityEngineID %s securityName %s' % (usmUserName, usmUserAuthProtocol, usmUserPrivProtocol, repr(securityEngineID), securityName)) | debug.logger & debug.flagSM and debug.logger('__generateRequestOrResponseMsg: local user usmUserName %s usmUserAuthProtocol %s usmUserPrivProtocol %s securityEngineID %s securityName %s' % (usmUserName, usmUserAuthProtocol, usmUserPrivProtocol, repr(securityEngineID), securityName)) | def __generateRequestOrResponseMsg( self, snmpEngine, messageProcessingModel, globalData, maxMessageSize, securityModel, securityEngineID, securityName, securityLevel, scopedPDU, securityStateReference ): snmpEngineID = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('__SNMP-FRAMEWORK-MIB', 'snmpE... | e8d075d2779d420fd51a257e50c47cea2a5c0d19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/e8d075d2779d420fd51a257e50c47cea2a5c0d19/service.py |
debug.logger & debug.flagSM and debug.logger('processIncomingMsg: cache read securityStateReference %s by msgUserName %s' % (securityStateReference, securityParameters.getComponentByPosition(3))) | debug.logger & debug.flagSM and debug.logger('processIncomingMsg: cache write securityStateReference %s by msgUserName %s' % (securityStateReference, securityParameters.getComponentByPosition(3))) | 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... | e8d075d2779d420fd51a257e50c47cea2a5c0d19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/e8d075d2779d420fd51a257e50c47cea2a5c0d19/service.py |
self._cachePop(securityStateReference) securityStateReference = self._cachePush( msgUserName=securityParameters.getComponentByPosition(3), usmUserAuthProtocol=usmUserAuthProtocol, usmUserAuthKeyLocalized=usmUserAuthKeyLocalized, usmUserPrivProtocol=usmUserPrivProtocol, usmUserPrivKeyLocalized=usmUserPrivKeyLocalized )... | 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... | e8d075d2779d420fd51a257e50c47cea2a5c0d19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/e8d075d2779d420fd51a257e50c47cea2a5c0d19/service.py | |
errorStatus, errorIndex = 'genErr', 1 | errorStatus, errorIndex = 'genErr', errorIndication.get('idx',-1)+1 | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | af52f0955fa3c23fc1b319b54161d6cf0dbcd2a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/af52f0955fa3c23fc1b319b54161d6cf0dbcd2a5/cmdrsp.py |
errorStatus, errorIndex = 'genErr', 1 | errorStatus, errorIndex = 'genErr', errorIndication.get('idx',-1)+1 | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | af52f0955fa3c23fc1b319b54161d6cf0dbcd2a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/af52f0955fa3c23fc1b319b54161d6cf0dbcd2a5/cmdrsp.py |
else: v2c.apiPDU.setErrorStatus(v2Pdu, errorStatus) v2c.apiPDU.setErrorIndex(v2Pdu, errorIndex) | v2c.apiPDU.setErrorStatus(v2Pdu, errorStatus) v2c.apiPDU.setErrorIndex(v2Pdu, errorIndex) | 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... | 92694b50dae3ce2ed9aaed8f9483d37bec283d25 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/92694b50dae3ce2ed9aaed8f9483d37bec283d25/rfc2576.py |
ringBuffer = passphrase * (64/len(passphrase)+1) | ringBuffer = passphrase * (passphrase and (64/len(passphrase)+1) or 1) | 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... | c516434111eec3fa2fadeb865125722bd6701f5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/c516434111eec3fa2fadeb865125722bd6701f5b/localkey.py |
if "egg" in arg: | if string.find(arg, 'egg') == -1: | def howto_install_setuptools(): print """Error: You need setuptools Python package! | 059a8bf66f9d0d606c88ee1f1c98010f0094a51a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/059a8bf66f9d0d606c88ee1f1c98010f0094a51a/setup.py |
contextMibInstrumCtl = self.snmpContext.getMibInstrum(contextName) | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | ca511d4861e2766119d6d61ee2703c35e34f7451 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ca511d4861e2766119d6d61ee2703c35e34f7451/cmdrsp.py | |
snmpEngine, contextMibInstrumCtl, PDU, | snmpEngine, self.snmpContext.getMibInstrum(contextName), PDU, | def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ): | ca511d4861e2766119d6d61ee2703c35e34f7451 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ca511d4861e2766119d6d61ee2703c35e34f7451/cmdrsp.py |
errorIndication = self.asyncSendNotification( | self.asyncSendNotification( | def __cbFun(sendRequestHandle, errorIndication, appReturn): appReturn['errorIndication'] = errorIndication | baebea6e770e069a4cac5bf7303b8d1a37482017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/baebea6e770e069a4cac5bf7303b8d1a37482017/ntforg.py |
if errorIndication: return errorIndication | def __cbFun(sendRequestHandle, errorIndication, appReturn): appReturn['errorIndication'] = errorIndication | baebea6e770e069a4cac5bf7303b8d1a37482017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/baebea6e770e069a4cac5bf7303b8d1a37482017/ntforg.py | |
testExample(id='1',path="FiniteElasticity/CylinderInflation",nodes='2',input='\n',ndiffDir="expected_results/2proc",outputDir="./outputs") | testExample(id='2',path="FiniteElasticity/CylinderInflation",nodes='2',ndiffDir="expected_results/2proc",outputDir="./outputs") | 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>"... | 6a292b3ab17f9ba26a15f0eba37531495da7b37c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/6a292b3ab17f9ba26a15f0eba37531495da7b37c/examplesTester.py |
elif err==0 : | else : | 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... | 786f56a7ecc54ba806a176553158ccdd73ce934c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/786f56a7ecc54ba806a176553158ccdd73ce934c/noseMain.py |
testExample(id='1',path="FluidMechanics/Darcy/QuasistaticMaterial",nodes='1',input='\n',expectedFile="expected_results/TIME_STEP_0003.exnode",actualFile="output/TIME_STEP_0003.exnode") | testExample(id='1',path="FluidMechanics/Darcy/QuasistaticMaterial",nodes='1',input='\n',ndiffDir="expected_results",outputDir="output") | 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 = ... | cb80f96b112a5f93588ed242f9b99c95d8eccdb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/cb80f96b112a5f93588ed242f9b99c95d8eccdb3/examplesTester.py |
testExample(id='1',path="FluidMechanics/NavierStokes/Statici_FieldML",nodes='1',input='\n') | testExample(id='1',path="FluidMechanics/NavierStokes/Static_FieldML",nodes='1',input='\n') | 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 = ... | 437184cddb7787a256b3dd9ce7a72bfce5e00ac4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/437184cddb7787a256b3dd9ce7a72bfce5e00ac4/examplesTester.py |
buildExample("ClassicalField/Diffusion/LinearConvergenceTest") buildExample("ClassicalField/Diffusion/QuadraticConvergenceTest") buildExample("ClassicalField/Diffusion/CubicConvergenceTest") | logExample(path="ClassicalField/Diffusion/LinearConvergenceTest") logExample(path="ClassicalField/Diffusion/QuadraticConvergenceTest") logExample(path="ClassicalField/Diffusion/CubicConvergenceTest") | 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... | 70f8678a1bce22fff817b706f77a4aa5408aff32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/70f8678a1bce22fff817b706f77a4aa5408aff32/examplesLogger.py |
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... | 70f8678a1bce22fff817b706f77a4aa5408aff32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/70f8678a1bce22fff817b706f77a4aa5408aff32/examplesLogger.py | ||
execCommand = subprocess.Popen([execPath], stdin=inputPipe.stdout, stdout=f1,stderr=f) | execCommand = subprocess.Popen([execPath], stdin=inputPipe.stdout, stdout=f1,stderr=f1) | 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... | 6f0530cdfc08dc786fe7697166ff42ae040014b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/6f0530cdfc08dc786fe7697166ff42ae040014b2/examplesTester.py |
if log.startswith('intel_'+path+'_build') : intelexamplelog=log.split('|'); | 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... | 18b5abe27f23a6110ba10b3a1a245eaec911dc4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/18b5abe27f23a6110ba10b3a1a245eaec911dc4a/examplesLogger.py | |
if log.startswith('intel_'+path+'_test') : inteltestlog=log.split('|'); | 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... | 18b5abe27f23a6110ba10b3a1a245eaec911dc4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/18b5abe27f23a6110ba10b3a1a245eaec911dc4a/examplesLogger.py | |
f.write("<tr><td><a href='"+rootUrl+"logs_x86_64-linux/"+path+"/build-intel'>Example Build</a></td>") if(intelexamplelog[1].startswith('success')) : f.write("<td><font color='green'>Success</font></td>") else : f.write("<td><font color='red'>Fail</font></td>") f.write("<td>"+intelexamplelog[2]+"</td></tr>") if(len(inte... | 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... | 18b5abe27f23a6110ba10b3a1a245eaec911dc4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/18b5abe27f23a6110ba10b3a1a245eaec911dc4a/examplesLogger.py | |
if log.startswith('intel_') : | if log.startswith('gnu_') : | 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... | 18b5abe27f23a6110ba10b3a1a245eaec911dc4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/18b5abe27f23a6110ba10b3a1a245eaec911dc4a/examplesLogger.py |
if(paths[0].endswith('_build') and (not log.startswith('intel_library_build'))) : logExample(path=paths[0].replace('intel_','').replace('_build','')); | if(paths[0].endswith('_build') and (not log.startswith('gnu_library_build'))) : logExample(path=paths[0].replace('gnu_','').replace('_build','')); | 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... | 18b5abe27f23a6110ba10b3a1a245eaec911dc4a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/18b5abe27f23a6110ba10b3a1a245eaec911dc4a/examplesLogger.py |
ret = subprocess.call('/bin/bash run42.sh') | ret = subprocess.call('/bin/bash run42.sh', shell=True) | 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') | fd9cbf0a80965a8664bd0a25fdec949c56a048a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/fd9cbf0a80965a8664bd0a25fdec949c56a048a0/make42tree.py |
testExample(id='1',path="SinglePhysics/LinearProblems/"+times+"/Stokes/"+dims+"/"+els+"/"+interp+"/"+level+"",master42=,master42="FluidMechanics/Stokes/42Master",nodes='1',ndiffDir='expected_results',outputDir='output') | testExample(id='1',path="SinglePhysics/LinearProblems/"+times+"/Stokes/"+dims+"/"+els+"/"+interp+"/"+level+"",master42="FluidMechanics/Stokes/42Master",nodes='1',ndiffDir='expected_results',outputDir='output') | 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>"... | 4b4af678af2faefcde702c301578f77cd09ed528 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/4b4af678af2faefcde702c301578f77cd09ed528/examplesTester.py |
testExample(id='1',path="SinglePhysics/NonlinearProblems/"+times+"/NavierStokes/"+dims+"/"+els+"/"+interp+"/"+level+"",master42=,master42="FluidMechanics/NavierStokes/42Master",nodes='1',ndiffDir='expected_results',outputDir='output') | testExample(id='1',path="SinglePhysics/NonlinearProblems/"+times+"/NavierStokes/"+dims+"/"+els+"/"+interp+"/"+level+"",master42="FluidMechanics/NavierStokes/42Master",nodes='1',ndiffDir='expected_results',outputDir='output') | 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>"... | 4b4af678af2faefcde702c301578f77cd09ed528 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/4b4af678af2faefcde702c301578f77cd09ed528/examplesTester.py |
if path.endswith('42Master') : execPath='./run42-debug.sh' else : | if path.endswith('42Master') : execPath='./run42-debug.sh' else : | 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 = ... | 5328f0a045221d426c701212ad1cf7cc8afdae17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/5328f0a045221d426c701212ad1cf7cc8afdae17/examplesTester.py |
f = open(newDir + "/test" + id + "-" + compiler,"w") execCommand = subprocess.Popen([execPath], stdin=inputPipe.stdout, stdout=f,stderr=f) f.close() | f1 = open(newDir + "/test" + id + "-" + compiler,"w") execCommand = subprocess.Popen([execPath], stdin=inputPipe.stdout, stdout=f1,stderr=f) f1.close() | 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... | cb3418ed22f1ef77399b84d482126a3c2e1aa893 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1766/cb3418ed22f1ef77399b84d482126a3c2e1aa893/examplesTester.py |
"pad image rows to multiples of 4 pixels" | """ Pad image width to a multiple of 4 pixels, and minimum dims of 12x12. QImage is very particular about its data. """ | 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 | bc1155eca691c7b7470ff6ef879a4b09ec55cabc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/bc1155eca691c7b7470ff6ef879a4b09ec55cabc/backend_qpainter.py |
pad = 4-(x%4) if pad == 4: | pad = lambda v: (4-(v%4))%4 nx = max(x+pad(x),12) ny = max(y,12) if x == nx and y == ny: | 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 | bc1155eca691c7b7470ff6ef879a4b09ec55cabc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/bc1155eca691c7b7470ff6ef879a4b09ec55cabc/backend_qpainter.py |
ret = np.zeros((y,x+pad,d), dtype=np.uint8) ret[:,:x] = array[:] | ret = np.zeros((ny,nx,d), dtype=np.uint8) ret[:y,:x] = array[:] | 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 | bc1155eca691c7b7470ff6ef879a4b09ec55cabc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/bc1155eca691c7b7470ff6ef879a4b09ec55cabc/backend_qpainter.py |
copy_array.shape[1], height, QtGui.QImage.Format_RGB32) | copy_array.shape[1], height, QtGui.QImage.Format_RGB32) | 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 | bc1155eca691c7b7470ff6ef879a4b09ec55cabc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/bc1155eca691c7b7470ff6ef879a4b09ec55cabc/backend_qpainter.py |
self.width = size[0] self.height = size[1] | self._width = size[0] self._height = size[1] | 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... | e1d10cdf0b7bbd8002dc0561869e665cc341491a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e1d10cdf0b7bbd8002dc0561869e665cc341491a/backend_qpainter.py |
dest_rect = QtCore.QRectF(0.0, 0.0, self.width, self.height) | dest_rect = QtCore.QRectF(0.0, 0.0, self.width(), self.height()) | 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 | e1d10cdf0b7bbd8002dc0561869e665cc341491a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e1d10cdf0b7bbd8002dc0561869e665cc341491a/backend_qpainter.py |
r,g,b,a = clear_color | """ """ if len(clear_color) == 4: r,g,b,a = clear_color else: r,g,b = clear_color a = 1.0 | 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)) | e1d10cdf0b7bbd8002dc0561869e665cc341491a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e1d10cdf0b7bbd8002dc0561869e665cc341491a/backend_qpainter.py |
self.gc.eraseRect(QtCore.QRectF(0,0,self.width,self.height)) | 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)) | e1d10cdf0b7bbd8002dc0561869e665cc341491a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e1d10cdf0b7bbd8002dc0561869e665cc341491a/backend_qpainter.py |
return GraphicsContext((width, height), self) | return GraphicsContext((width, height), parent=self) | 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 | e1d10cdf0b7bbd8002dc0561869e665cc341491a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e1d10cdf0b7bbd8002dc0561869e665cc341491a/backend_qpainter.py |
elif isinstance(value, str): return color_table[value] | 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) &... | 66adde64a614a7106913072bfd9cd5993034a5c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/66adde64a614a7106913072bfd9cd5993034a5c2/colors.py | |
elif isinstance(value, Str): return color_table.get(value, transparent_color) | 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) ... | 66adde64a614a7106913072bfd9cd5993034a5c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/66adde64a614a7106913072bfd9cd5993034a5c2/colors.py | |
ColorTrait = Trait("black", Tuple, List, Str, color_table, | ColorTrait = Trait("black", Tuple, List, color_table, | def str_color(self, color): if isinstance(color, QtGui.QColor): color = color.getRgbF() | 66adde64a614a7106913072bfd9cd5993034a5c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/66adde64a614a7106913072bfd9cd5993034a5c2/colors.py |
return color_table.get(value, transparent_color) | return color_table[value] | 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 >>... | 604a25f9a6b4f9a6e62297e1e359a4691b85c878 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/604a25f9a6b4f9a6e62297e1e359a4691b85c878/colors.py |
ColorTrait = Trait("black", Tuple, List, Str, color_table, | ColorTrait = Trait("black", Tuple, List, color_table, | 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 | 604a25f9a6b4f9a6e62297e1e359a4691b85c878 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/604a25f9a6b4f9a6e62297e1e359a4691b85c878/colors.py |
x_trans = x + self.view_position[0] y_trans = y + self.view_position[1] | x_trans, y_trans = self.viewport_to_component(x, y) | 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). | 8a576a0bbe8ee5801b474f63817edfbbfdc89310 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/8a576a0bbe8ee5801b474f63817edfbbfdc89310/viewport.py |
def is_in(self, x, y): """ Return True if the (x,y) coordinates are within the viewport's native coordinate space. """ pos = [0.0, 0.0] bounds = self.view_bounds return (x >= pos[0]) and (x < pos[0] + bounds[0]) and \ (y >= pos[1]) and (y < pos[1] + bounds[1]) | 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). | 8a576a0bbe8ee5801b474f63817edfbbfdc89310 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/8a576a0bbe8ee5801b474f63817edfbbfdc89310/viewport.py | |
def _enable_zoom_changed(self, old, new): """ Add or remove the zoom tool overlay depending whether or not zoom is enabled. """ if self.zoom_tool is None: return if self.enable_zoom: if not self.zoom_tool in self.tools: self.tools.append(self.zoom_tool) else: if self.zoom_tool in self.tools: self.tools.remove(se... | 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 | 8a576a0bbe8ee5801b474f63817edfbbfdc89310 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/8a576a0bbe8ee5801b474f63817edfbbfdc89310/viewport.py | |
raise NotImplementedError, "GetGlobalMousePosition is not defined for" \ "toolkit '%s'." % ETSConfig.toolkit | def GetGlobalMousePosition(): raise NotImplementedError, "GetGlobalMousePosition is not defined for" \ "toolkit '%s'." % ETSConfig.toolkit | def GetGlobalMousePosition(): pos = QtGui.QCursor.pos() return (pos.x(), pos.y()) | 1b913a9f531630acc1ed2e9add0ab32ba9789165 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/1b913a9f531630acc1ed2e9add0ab32ba9789165/hover_tool.py |
gcc_version = os.popen("g++ --version") gcc_version_head = gcc_version.readline().split() gcc_version.close() if int(gcc_version_head[2][0]) < 4: | f = os.popen("g++ --version") line0 = f.readline() f.close() m = re.match(r'.+?\s(\d)\.\d+', line0) if m and int(m.group(1)) < 4: | 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] | ae200359e7ca590ce8578332e0c0f940d5fede35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/ae200359e7ca590ce8578332e0c0f940d5fede35/setup.py |
self.size = (size.GetWidth(), size.GetHeight()) | self._size = (size.GetWidth(), size.GetHeight()) | 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... | 3f17141ac48fcb4ceff159a19aa5ae1d4a3b26d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/3f17141ac48fcb4ceff159a19aa5ae1d4a3b26d8/backend_wx.py |
self.size = size | self._size = size | 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 | 3f17141ac48fcb4ceff159a19aa5ae1d4a3b26d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/3f17141ac48fcb4ceff159a19aa5ae1d4a3b26d8/backend_wx.py |
paintdc.Blit(0, 0, self.size[0], self.size[1], | paintdc.Blit(0, 0, self._size[0], self._size[1], | 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 | 3f17141ac48fcb4ceff159a19aa5ae1d4a3b26d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/3f17141ac48fcb4ceff159a19aa5ae1d4a3b26d8/backend_wx.py |
if '64bit' in platform.architecture(): gcc_version = os.popen("g++ --version") gcc_version_head = gcc_version.readline().split() gcc_version.close() if int(gcc_version_head[2][0]) < 4: | if sys.platform == 'linux2' and '64bit' in platform.architecture(): f = os.popen("g++ --version") line0 = f.readline() f.close() m = re.match(r'.+?\s(3|4)\.\d+', line0) if int(m.group(1)) < 4: | 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] | 79fcde9fa0b3976a90b9fb95c85cdab5e75159f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/79fcde9fa0b3976a90b9fb95c85cdab5e75159f1/setup.py |
def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', | def radial_gradient(self, cx, cy, r, fx, fy, stops, spreadMethod='pad', | def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | e9c81498a254d6d3a135adc8bbf12f67e7d61625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e9c81498a254d6d3a135adc8bbf12f67e7d61625/backend_cairo.py |
gradient = cairo.RadialGradient(cx, cy, r, fx, fx, r) | gradient = cairo.RadialGradient(fx, fy, 0.0, cx, cy, r) for stop in stops: if stop.size == 10: start = tuple(stop[0:5]) end = tuple(stop[5:10]) gradient.add_color_stop_rgba(*start) gradient.add_color_stop_rgba(*end) else: start = tuple(stop[0:5]) gradient.add_color_stop_rgba(*start) self.state.has_gradient = True se... | def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | e9c81498a254d6d3a135adc8bbf12f67e7d61625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e9c81498a254d6d3a135adc8bbf12f67e7d61625/backend_cairo.py |
return gradient def linear_gradient(self, x1, y1, x2, y2, stops, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): gradient = cairo.LinearGradient(x1, y1, x2, y2) for stop in stops: if stop.size == 10: start = tuple(stop[0:5]) end = tuple(stop[5:10]) gradient.add_color_stop_rgba(*start) gradient.ad... | self.state.has_gradient = True self._ctx.set_source(gradient) | def radial_gradient(self, cx, cy, r, stops, fx=None,fy=None, spreadMethod='pad', transforms=None, units='userSpaceOnUse'): | e9c81498a254d6d3a135adc8bbf12f67e7d61625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e9c81498a254d6d3a135adc8bbf12f67e7d61625/backend_cairo.py |
else: self._ctx.arc_negative( x, y, radius, start_angle, end_angle) | def arc(self, x, y, radius, start_angle, end_angle, cw=False): """ Draw a circular arc. | e9c81498a254d6d3a135adc8bbf12f67e7d61625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e9c81498a254d6d3a135adc8bbf12f67e7d61625/backend_cairo.py | |
self._set_source_color(self.state.fill_color) | if not self.state.has_gradient: self._set_source_color(self.state.fill_color) | def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | e9c81498a254d6d3a135adc8bbf12f67e7d61625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e9c81498a254d6d3a135adc8bbf12f67e7d61625/backend_cairo.py |
self._set_source_color(self.state.stroke_color) | if not self.state.has_gradient: self._set_source_color(self.state.stroke_color) | def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | e9c81498a254d6d3a135adc8bbf12f67e7d61625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e9c81498a254d6d3a135adc8bbf12f67e7d61625/backend_cairo.py |
self._set_source_color(self.state.fill_color) | if not self.state.has_gradient: self._set_source_color(self.state.fill_color) | def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | e9c81498a254d6d3a135adc8bbf12f67e7d61625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e9c81498a254d6d3a135adc8bbf12f67e7d61625/backend_cairo.py |
self._set_source_color(self.state.stroke_color) | if not self.state.has_gradient: self._set_source_color(self.state.stroke_color) | def draw_path(self, mode=constants.FILL_STROKE): """ Walks through all the drawing subpaths and draw each element. | e9c81498a254d6d3a135adc8bbf12f67e7d61625 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/e9c81498a254d6d3a135adc8bbf12f67e7d61625/backend_cairo.py |
dash_patterns = outer_join(self.dash_values,self.dash_values) | dash_patterns = outer_join(self.dash_values[1:], self.dash_values) | 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... | 0c88eb6159363a7ca56b601fc1abd0380d510607 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/0c88eb6159363a7ca56b601fc1abd0380d510607/sampler.py |
def show_glyphs(self): """ """ msg = "show_glyphs not implemented on PDF yet." raise NotImplementedError, msg | 26f2b81df2e92de8d64f974dad89239bc4df6936 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/26f2b81df2e92de8d64f974dad89239bc4df6936/backend_pdf.py | ||
descent = (-descent) * fontsize / 1000.0 | aw,ah,ad,al = self._agg_gc.get_full_text_extent(textstring) descent = 0.0 if ad == 0.0 else descent * fontsize / 1000.0 | 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... | 26f2b81df2e92de8d64f974dad89239bc4df6936 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/26f2b81df2e92de8d64f974dad89239bc4df6936/backend_pdf.py |
height=ascent+descent width=self.gc.stringWidth(textstring,fontname,fontsize) | height = ascent + abs(descent) width = self.gc.stringWidth(textstring,fontname,fontsize) | 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... | 26f2b81df2e92de8d64f974dad89239bc4df6936 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/26f2b81df2e92de8d64f974dad89239bc4df6936/backend_pdf.py |
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... | 26f2b81df2e92de8d64f974dad89239bc4df6936 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/26f2b81df2e92de8d64f974dad89239bc4df6936/backend_pdf.py | ||
def get_text_extent(self,textstring): w,h,d,l = self.get_full_text_extent(textstring) return w,h | 26f2b81df2e92de8d64f974dad89239bc4df6936 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/26f2b81df2e92de8d64f974dad89239bc4df6936/backend_pdf.py | ||
raise "Not Implemented" | raise NotImplementedError | def makePDFObject(self): # XXX Kiva specific change raise "Not Implemented" | 4e20c80df88eebd4a85ac28667b2bc18474bc122 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/4e20c80df88eebd4a85ac28667b2bc18474bc122/pdfmetrics.py |
raise "Not Implemented" | raise NotImplementedError | def addObjects(self, doc): # XXX Kiva specific change raise "Not Implemented" | 4e20c80df88eebd4a85ac28667b2bc18474bc122 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/4e20c80df88eebd4a85ac28667b2bc18474bc122/pdfmetrics.py |
raise "Not Implemented" | raise NotImplementedError | def addObjects(self, doc): # XXX Kiva specific changes raise "Not Implemented" | 4e20c80df88eebd4a85ac28667b2bc18474bc122 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/4e20c80df88eebd4a85ac28667b2bc18474bc122/pdfmetrics.py |
view = Viewport(component=container, view_position=[10.0, 10.0], view_bounds=[50.0, 50.0]) | view = Viewport(component=container, view_position=[10.0, 10.0], view_bounds=[50.0, 50.0], position=[0,0], bounds=[50,50]) | 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.... | f83805a42528b4ea5e7dbf5567663721915a0242 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/f83805a42528b4ea5e7dbf5567663721915a0242/viewport_test_case.py |
w = self._gc.width h = self._gc.height | w = self._gc.width() h = self._gc.height() | def _window_paint(self, event): if self.control is None: return | 7d87bc8cc19073d24141eeafd9109df4b64214db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/7d87bc8cc19073d24141eeafd9109df4b64214db/window.py |
self.control.SetFocus() | if self.control == self.control.GetCapture(): self.control.SetFocus() | def _set_focus ( self ): "Sets the keyboard focus to this window" self.control.SetFocus() return | bfa02fe0a4b667de6ccaae623e1a451271db9c15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/bfa02fe0a4b667de6ccaae623e1a451271db9c15/window.py |
if numpy.__version__[:5] < '1.0.3': from numpy.distutils.command import build_ext old_run = build_ext.build_ext.run def new_run(self): if not self.extensions: return self.run_command('build_src') if self.distribution.has_c_libraries(): self.run_command('build_clib') build_clib = self.get_finalized_command(... | 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... | b8b6c9ec54e40a27a852ecf9714fb7eabd52b50c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/b8b6c9ec54e40a27a852ecf9714fb7eabd52b50c/setup.py | |
def create_texture(self, cls): | def create_texture(self, cls, rectangle): | def create_texture(self, cls): '''Create a texture containing this image. | 4fa5535366b03153a4c4fef1fa9f92b5aa63f19b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/4fa5535366b03153a4c4fef1fa9f92b5aa63f19b/backend_gl.py |
texture = cls.create_for_size( gl.GL_TEXTURE_2D, self.width, self.height) | _is_pow2 = lambda v: (v & (v - 1)) == 0 target = gl.GL_TEXTURE_2D if rectangle and not (_is_pow2(self.width) and _is_pow2(self.height)): if gl.gl_info.have_extension('GL_ARB_texture_rectangle'): target = gl.GL_TEXTURE_RECTANGLE_ARB elif gl.gl_info.have_extension('GL_NV_texture_rectangle'): target = gl.GL_TEXTURE_RECT... | def create_texture(self, cls): '''Create a texture containing this image. | 4fa5535366b03153a4c4fef1fa9f92b5aa63f19b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/4fa5535366b03153a4c4fef1fa9f92b5aa63f19b/backend_gl.py |
if gl._current_context._workaround_unpack_row_length: | if gl.current_context._workaround_unpack_row_length: | def component_column(component): try: pos = 'RGBA'.index(component) return [0] * pos + [1] + [0] * (3 - pos) except ValueError: return [0, 0, 0, 0] | 4fa5535366b03153a4c4fef1fa9f92b5aa63f19b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/4fa5535366b03153a4c4fef1fa9f92b5aa63f19b/backend_gl.py |
[(0,1,0,0,1),(1,1,1,1,1)], 'reflect') | array([start, end]), 'reflect') | 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 | 8bd3a659d2220ac943209aa64904a046b18b375e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/8bd3a659d2220ac943209aa64904a046b18b375e/qt4_simple.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.