bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def __init__(self, *args): this = apply(_quickfix.new_ScreenLogFactory, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_ScreenLogFactory, args) try: self.this.append(this) except: self.this = this
475,000
def destroy(*args): return apply(_quickfix.ScreenLogFactory_destroy, args)
def destroy(*args): return apply(_quickfix.ScreenLogFactory_destroy, args)
475,001
def clear(*args): return apply(_quickfix.Log_clear, args)
def clear(*args): return apply(_quickfix.Log_clear, args)
475,002
def clear(*args): return apply(_quickfix.NullLog_clear, args)
def clear(*args): return apply(_quickfix.NullLog_clear, args)
475,003
def __init__(self, *args): this = apply(_quickfix.new_ScreenLog, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_ScreenLog, args) try: self.this.append(this) except: self.this = this
475,004
def __init__(self, *args): this = apply(_quickfix.new_FileLogFactory, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_FileLogFactory, args) try: self.this.append(this) except: self.this = this
475,005
def __init__(self, *args): this = apply(_quickfix.new_FileLog, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_FileLog(*args) try: self.this.append(this) except: self.this = this
475,006
def clear(*args): return apply(_quickfix.FileLog_clear, args)
def clear(*args): return apply(_quickfix.FileLog_clear, args)
475,007
def setMillisecondsInTimeStamp(*args): return apply(_quickfix.FileLog_setMillisecondsInTimeStamp, args)
def setMillisecondsInTimeStamp(*args): return apply(_quickfix.FileLog_setMillisecondsInTimeStamp, args)
475,008
def create(*args): return apply(_quickfix.MessageStoreFactory_create, args)
def create(*args): return apply(_quickfix.MessageStoreFactory_create, args)
475,009
def create(*args): return apply(_quickfix.MemoryStoreFactory_create, args)
def create(*args): return apply(_quickfix.MemoryStoreFactory_create, args)
475,010
def __init__(self, *args): this = apply(_quickfix.new_MemoryStoreFactory, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_MemoryStoreFactory, args) try: self.this.append(this) except: self.this = this
475,011
def set(*args): return apply(_quickfix.MessageStore_set, args)
def set(*args): return apply(_quickfix.MessageStore_set, args)
475,012
def __init__(self, *args): this = apply(_quickfix.new_MemoryStore, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_MemoryStore, args) try: self.this.append(this) except: self.this = this
475,013
def refresh(*args): return apply(_quickfix.MemoryStore_refresh, args)
def refresh(*args): return apply(_quickfix.MemoryStore_refresh, args)
475,014
def __init__(self, *args): this = apply(_quickfix.new_MessageStoreFactoryExceptionWrapper, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_MessageStoreFactoryExceptionWrapper, args) try: self.this.append(this) except: self.this = this
475,015
def destroy(*args): return apply(_quickfix.MessageStoreFactoryExceptionWrapper_destroy, args)
def destroy(*args): return apply(_quickfix.MessageStoreFactoryExceptionWrapper_destroy, args)
475,016
def __init__(self, *args): this = apply(_quickfix.new_MessageStoreExceptionWrapper, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_MessageStoreExceptionWrapper(*args) try: self.this.append(this) except: self.this = this
475,017
def set(*args): return apply(_quickfix.MessageStoreExceptionWrapper_set, args)
def set(*args): return apply(_quickfix.MessageStoreExceptionWrapper_set, args)
475,018
def __init__(self, *args): this = apply(_quickfix.new_FileStoreFactory, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_FileStoreFactory, args) try: self.this.append(this) except: self.this = this
475,019
def __init__(self, *args): this = apply(_quickfix.new_FileStore, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_FileStore(*args) try: self.this.append(this) except: self.this = this
475,020
def set(*args): return apply(_quickfix.FileStore_set, args)
def set(*args): return apply(_quickfix.FileStore_set, args)
475,021
def refresh(*args): return apply(_quickfix.FileStore_refresh, args)
def refresh(*args): return apply(_quickfix.FileStore_refresh, args)
475,022
def onCreate(*args): return apply(_quickfix.Application_onCreate, args)
def onCreate(*args): return apply(_quickfix.Application_onCreate, args)
475,023
def __init__(self, *args): if self.__class__ == Application: args = (None,) + args else: args = (self,) + args this = apply(_quickfix.new_Application, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): if self.__class__ == Application: args = (None,) + args else: args = (self,) + args this = _quickfix.new_Application(*args) try: self.this.append(this) except: self.this = this
475,024
def __init__(self, *args): this = apply(_quickfix.new_SynchronizedApplication, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_SynchronizedApplication, args) try: self.this.append(this) except: self.this = this
475,025
def app(*args): return apply(_quickfix.SynchronizedApplication_app, args)
def app(*args): return apply(_quickfix.SynchronizedApplication_app, args)
475,026
def __init__(self, *args): this = apply(_quickfix.new_NullApplication, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_NullApplication(*args) try: self.this.append(this) except: self.this = this
475,027
def __init__(self, *args): this = apply(_quickfix.new_NullApplication, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_NullApplication, args) try: self.this.append(this) except: self.this = this
475,028
def block(*args): return apply(_quickfix.Initiator_block, args)
def block(*args): return apply(_quickfix.Initiator_block, args)
475,029
def __init__(self, *args): this = apply(_quickfix.new_SocketInitiatorBase, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_SocketInitiatorBase(*args) try: self.this.append(this) except: self.this = this
475,030
def __init__(self, *args): this = apply(_quickfix.new_SocketInitiatorBase, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_SocketInitiatorBase, args) try: self.this.append(this) except: self.this = this
475,031
def getLog(*args): return apply(_quickfix.Acceptor_getLog, args)
def getLog(*args): return apply(_quickfix.Acceptor_getLog, args)
475,032
def block(*args): return apply(_quickfix.Acceptor_block, args)
def block(*args): return apply(_quickfix.Acceptor_block, args)
475,033
def __init__(self, *args): this = apply(_quickfix.new_SocketAcceptorBase, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_SocketAcceptorBase(*args) try: self.this.append(this) except: self.this = this
475,034
def __init__(self, *args): this = apply(_quickfix.new_SocketAcceptorBase, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = apply(_quickfix.new_SocketAcceptorBase, args) try: self.this.append(this) except: self.this = this
475,035
def __init__(self, *args): this = apply(_quickfix.new_DataDictionary, args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_DataDictionary(*args) try: self.this.append(this) except: self.this = this
475,036
def readFromURL(*args): return apply(_quickfix.DataDictionary_readFromURL, args)
def readFromURL(*args): return apply(_quickfix.DataDictionary_readFromURL, args)
475,037
def __str__(*args): return _quickfix.SessionID___str__(*args)
def __str__(*args): return _quickfix.SessionID___str__(*args)
475,038
def hasGroup(*args): return _quickfix.Group_hasGroup(*args)
def hasGroup(*args): return _quickfix.Group_hasGroup(*args)
475,039
def __init__(self, *args): this = _quickfix.new_AvgPrxPrecision(*args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_AvgPrxPrecision(*args) try: self.this.append(this) except: self.this = this
475,040
def __init__(self, *args): this = _quickfix.new_OpenClose(*args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_OpenClose(*args) try: self.this.append(this) except: self.this = this
475,041
def __init__(self, *args): this = _quickfix.new_OpenClose(*args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_OpenClose(*args) try: self.this.append(this) except: self.this = this
475,042
def __init__(self, *args): this = _quickfix.new_AllocShares(*args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_AllocShares(*args) try: self.this.append(this) except: self.this = this
475,043
def __init__(self, *args): this = _quickfix.new_FutSettDate2(*args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_FutSettDate2(*args) try: self.this.append(this) except: self.this = this
475,044
def __init__(self, *args): this = _quickfix.new_SpreadToBenchmark(*args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_SpreadToBenchmark(*args) try: self.this.append(this) except: self.this = this
475,045
def __init__(self, *args): this = _quickfix.new_TotQuoteEntries(*args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_TotQuoteEntries(*args) try: self.this.append(this) except: self.this = this
475,046
def __init__(self, *args): this = _quickfix.new_TradeType(*args) try: self.this.append(this) except: self.this = this
def __init__(self, *args): this = _quickfix.new_TradeType(*args) try: self.this.append(this) except: self.this = this
475,047
def __str__(*args): return _quickfix.SessionID___str__(*args)
def __str__(*args): return _quickfix.SessionID___str__(*args)
475,048
def __str__(*args): return _quickfix.SessionID___str__(*args)
def __str__(*args): return _quickfix.SessionID___str__(*args)
475,049
def __str__(*args): return _quickfix.SessionID___str__(*args)
def __str__(*args): return _quickfix.SessionID___str__(*args)
475,050
def setDataDictionary(*args): return _quickfix.Session_setDataDictionary(*args)
def setDataDictionary(*args): return _quickfix.Session_setDataDictionary(*args)
475,051
def __init__(self): raise AttributeError, "No constructor defined"
def __init__(self): raise AttributeError, "No constructor defined"
475,052
def __init__(self): raise AttributeError, "No constructor defined"
def __init__(self): raise AttributeError, "No constructor defined"
475,053
def __init__(self): raise AttributeError, "No constructor defined"
def __init__(self): raise AttributeError, "No constructor defined"
475,054
def __init__(self): raise AttributeError, "No constructor defined"
def __init__(self): raise AttributeError, "No constructor defined"
475,055
def __init__(self): raise AttributeError, "No constructor defined"
def __init__(self): raise AttributeError, "No constructor defined"
475,056
def __init__(self): raise AttributeError, "No constructor defined"
def __init__(self): raise AttributeError, "No constructor defined"
475,057
def isMultipleValueStringField(*args): return _quickfix.DataDictionary_isMultipleValueStringField(*args)
def isMultipleValueStringField(*args): return _quickfix.DataDictionary_isMultipleValueStringField(*args)
475,058
def __init__(self, application, storeFactory, settings, logFactory=None): if logFactory == None: SocketAcceptorBase.__init__(self, application, storeFactory, settings) else: SocketAcceptorBase.__init__(self, application, storeFactory, settings, logFactory)
def __init__(self, application, storeFactory, settings, logFactory=None): if logFactory == None: SocketAcceptorBase.__init__(self, application, storeFactory, settings) else: SocketAcceptorBase.__init__(self, application, storeFactory, settings, logFactory)
475,059
def __init__(self, data = None): if data == None: quickfix.CheckSumField.__init__(self, 10) else: quickfix.CheckSumField.__init__(self, 10, data)
def __init__(self, data = None): if data == None: quickfix.CheckSumField.__init__(self, 10) else: quickfix.CheckSumField.__init__(self, 10, data)
475,060
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 16) else: quickfix.IntField.__init__(self, 16, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 16) else: quickfix.IntField.__init__(self, 16, data)
475,061
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 36) else: quickfix.IntField.__init__(self, 36, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 36) else: quickfix.IntField.__init__(self, 36, data)
475,062
def __init__(self, data = None): if data == None: quickfix.BoolField.__init__(self, 43) else: quickfix.BoolField.__init__(self, 43, data)
def __init__(self, data = None): if data == None: quickfix.BoolField.__init__(self, 43) else: quickfix.BoolField.__init__(self, 43, data)
475,063
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 45) else: quickfix.IntField.__init__(self, 45, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 45) else: quickfix.IntField.__init__(self, 45, data)
475,064
def __init__(self, data = None): if data == None: quickfix.UtcTimeStampField.__init__(self, 52) else: quickfix.UtcTimeStampField.__init__(self, 52, data)
def __init__(self, data = None): if data == None: quickfix.UtcTimeStampField.__init__(self, 52) else: quickfix.UtcTimeStampField.__init__(self, 52, data)
475,065
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 58) else: quickfix.StringField.__init__(self, 58, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 58) else: quickfix.StringField.__init__(self, 58, data)
475,066
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 93) else: quickfix.IntField.__init__(self, 93, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 93) else: quickfix.IntField.__init__(self, 93, data)
475,067
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 98) else: quickfix.IntField.__init__(self, 98, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 98) else: quickfix.IntField.__init__(self, 98, data)
475,068
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 108) else: quickfix.IntField.__init__(self, 108, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 108) else: quickfix.IntField.__init__(self, 108, data)
475,069
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 112) else: quickfix.StringField.__init__(self, 112, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 112) else: quickfix.StringField.__init__(self, 112, data)
475,070
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 116) else: quickfix.StringField.__init__(self, 116, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 116) else: quickfix.StringField.__init__(self, 116, data)
475,071
def __init__(self, data = None): if data == None: quickfix.BoolField.__init__(self, 123) else: quickfix.BoolField.__init__(self, 123, data)
def __init__(self, data = None): if data == None: quickfix.BoolField.__init__(self, 123) else: quickfix.BoolField.__init__(self, 123, data)
475,072
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 129) else: quickfix.StringField.__init__(self, 129, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 129) else: quickfix.StringField.__init__(self, 129, data)
475,073
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 145) else: quickfix.StringField.__init__(self, 145, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 145) else: quickfix.StringField.__init__(self, 145, data)
475,074
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 213) else: quickfix.StringField.__init__(self, 213, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 213) else: quickfix.StringField.__init__(self, 213, data)
475,075
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 347) else: quickfix.StringField.__init__(self, 347, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 347) else: quickfix.StringField.__init__(self, 347, data)
475,076
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 355) else: quickfix.StringField.__init__(self, 355, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 355) else: quickfix.StringField.__init__(self, 355, data)
475,077
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 373) else: quickfix.IntField.__init__(self, 373, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 373) else: quickfix.IntField.__init__(self, 373, data)
475,078
def __init__(self, data = None): if data == None: quickfix.CharField.__init__(self, 385) else: quickfix.CharField.__init__(self, 385, data)
def __init__(self, data = None): if data == None: quickfix.CharField.__init__(self, 385) else: quickfix.CharField.__init__(self, 385, data)
475,079
def __init__(self, data = None): if data == None: quickfix.BoolField.__init__(self, 464) else: quickfix.BoolField.__init__(self, 464, data)
def __init__(self, data = None): if data == None: quickfix.BoolField.__init__(self, 464) else: quickfix.BoolField.__init__(self, 464, data)
475,080
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 554) else: quickfix.StringField.__init__(self, 554, data)
def __init__(self, data = None): if data == None: quickfix.StringField.__init__(self, 554) else: quickfix.StringField.__init__(self, 554, data)
475,081
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 630) else: quickfix.IntField.__init__(self, 630, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 630) else: quickfix.IntField.__init__(self, 630, data)
475,082
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 789) else: quickfix.IntField.__init__(self, 789, data)
def __init__(self, data = None): if data == None: quickfix.IntField.__init__(self, 789) else: quickfix.IntField.__init__(self, 789, data)
475,083
def fromApp(self, message, sessionID): beginString = fix.BeginString() msgType = fix.MsgType() message.getHeader().getField( beginString ) message.getHeader().getField( msgType ) symbol = fix.Symbol() side = fix.Side() ordType = fix.OrdType() orderQty = fix.OrderQty() price = fix.Price() clOrdID = fix.ClOrdID()
def fromApp(self, message, sessionID): beginString = fix.BeginString() msgType = fix.MsgType() message.getHeader().getField( beginString ) message.getHeader().getField( msgType ) symbol = fix.Symbol() side = fix.Side() ordType = fix.OrdType() orderQty = fix.OrderQty() price = fix.Price() clOrdID = fix.ClOrdID()
475,084
def _handle_verkkokauppa(url): """http://www.verkkokauppa.com/popups/prodinfo.php?id=*""" bs = getUrl(url).getBS() if not bs: return product = bs.first("td", {'valign':'top', 'width':'59%', 'height':'139'}).next.strip() price = str(bs.first(text="Hinta:").next.next.next.next.string).split("&")[0] return "%s | %s EUR" % (product, price)
def _handle_verkkokauppa(url): """http://www.verkkokauppa.com/popups/prodinfo.php?id=*""" bs = getUrl(url).getBS() if not bs: return product = bs.first("td", {'valign':'top', 'width':'59%', 'height':'139'}).next.strip() price = str(bs.first(text="Hinta:").next.next.next.next.next.string).split("&")[0] return "%s | %s€" % (product, price)
475,085
def check_params(bot, args, channel): """Do some initial checking for the stuff we need for every subcommand""" if not args: return False expldir = expl_getdir(channel) if not expldir: bot.log("No expldir for channel %s, create %s to enable expl." % (channel, os.path.join(sys.path[0], "expl", channel))) return False termlist = expl_getlist(expldir) if not termlist: return False return expldir, termlist
def check_params(bot, args, channel): """Do some initial checking for the stuff we need for every subcommand""" if not args: return False expldir = expl_getdir(channel) if not expldir: bot.log("No expldir for channel %s, create %s to enable expl." % (channel, os.path.join(sys.path[0], "expl", channel))) return False termlist = expl_getlist(expldir) return expldir, termlist
475,086
def isIgnored(self, user): """Check if an user is ignored
def isIgnored(self, user): """Check if an user is ignored
475,087
def isIgnored(self, user): """Check if an user is ignored
def isIgnored(self, user): """Check if an user is ignored
475,088
def buildProtocol(self, address): if re.match("[^a-z]+", address.host): log.error("Kludge fix for twisted.words weirdness") fqdn = socket.getfqdn(address.host) address = (fqdn, address.port) else: address = (address.host, address.port)
def buildProtocol(self, address): if re.match("[^a-z]+", address.host): log.error("Kludge fix for twisted.words weirdness") fqdn = socket.getfqdn(address.host) address = (fqdn, address.port) else: address = (address.host, address.port)
475,089
def buildProtocol(self, address): if re.match("[^a-z]+", address.host): log.error("Kludge fix for twisted.words weirdness") fqdn = socket.getfqdn(address.host) address = (fqdn, address.port) else: address = (address.host, address.port)
def buildProtocol(self, address): if re.match("[^a-z]+", address.host): log.error("Kludge fix for twisted.words weirdness") fqdn = socket.getfqdn(address.host) address = (fqdn, address.port) else: address = (address.host, address.port)
475,090
def getSentence(self): return self.question + self.nugget_list[random.randint(0, len(self.nugget_list))]
def getSentence(self): return self.question + self.nugget_list[random.randint(0, len(self.nugget_list))]
475,091
def __init__(self, archive_num): self.question = "Did you know, " #archive_max checked 13-8-2009 self.archive_max = 246 self.archive_num = archive_num if self.archive_num > self.archive_max: self.archive_num = random.randint(1, self.archive_max) self.url = "http://en.wikipedia.org/wiki/Wikipedia:Recent_additions_" + str(self.archive_num) Nuggets.__init__(self)
def __init__(self, archive_num): self.question = "Did you know, " #archive_max checked 13-8-2009 self.archive_max = 255 self.archive_num = archive_num if self.archive_num > self.archive_max: self.archive_num = random.randint(1, self.archive_max) self.url = "http://en.wikipedia.org/wiki/Wikipedia:Recent_additions_" + str(self.archive_num) Nuggets.__init__(self)
475,092
def create_example_conf(): """Create an example configuration file""" conf = """ nick: botnick admins: - '*!*@myhost.com' networks: ircnet: server: irc.ircnet.com channels: - mychannel quakenet: server: irc.quakenet.org authname: name authpass: password channels: - (mysecret, password) """ examplefile = 'bot.config.example' if os.path.exists(examplefile): return False else: f = file(examplefile, 'w') yaml.dump(yaml.load(conf), f, default_flow_style=False) f.close() return True
def create_example_conf(): """Create an example configuration file""" conf = """ nick: botnick admins: - 'foo!bar@example.com' networks: ircnet: server: irc.ircnet.com channels: - mychannel quakenet: server: irc.quakenet.org authname: name authpass: password channels: - (mysecret, password) """ examplefile = 'bot.config.example' if os.path.exists(examplefile): return False else: f = file(examplefile, 'w') yaml.dump(yaml.load(conf), f, default_flow_style=False) f.close() return True
475,093
def buildProtocol(self, address): if re.match("[^a-z]+", address.host): log.error("Kludge fix for twisted.words weirdness") fqdn = socket.getfqdn(address.host) address = (fqdn, address.port) else: address = (address.host, address.port)
def buildProtocol(self, address): if re.match("[^a-z]+", address.host): log.error("Kludge fix for twisted.words weirdness") fqdn = socket.getfqdn(address.host) address = (fqdn, address.port) else: address = (address.host, address.port)
475,094
def _handle_iltalehti(url): """*iltalehti.fi*html""" # go as normal bs = getUrl(url).getBS() if not bs: return title = bs.first('title').string # the first part is the actual story title, lose the rest title = title.split("|")[0].strip() if not title: return return title
def _handle_iltalehti(url): """*iltalehti.fi*html""" # go as normal bs = getUrl(url).getBS() if not bs: return title = bs.first('title').string # the first part is the actual story title, lose the rest title = title.split("|")[0].strip() return title
475,095
def _handle_iltasanomat(url): """*iltasanomat.fi*uutinen.asp*""" bs = getUrl(url).getBS() if not bs: return title = bs.title.string.split(" - ")[0] if not title: return return title
def _handle_iltasanomat(url): """*iltasanomat.fi*uutinen.asp*""" bs = getUrl(url).getBS() if not bs: return title = " - ".join(bs.title.string.split(" - ")[:-1]) return title
475,096
def feels_like(temperature, air_speed): """tempature as °C, air_speed as kmph. The formula from http://www.bbc.co.uk/weather/features/understanding/feelslike.shtml""" air_speed = air_speed ** 0.16 return (13.12 + 0.6215 * temperature - 11.37 * air_speed + 0.3965 * temperature * air_speed)
def feels_like(temperature, air_speed): """tempeture as °C, air_speed as kmph. The formula from http://www.bbc.co.uk/weather/features/understanding/feelslike.shtml""" air_speed = air_speed ** 0.16 return (13.12 + 0.6215 * temperature - 11.37 * air_speed + 0.3965 * temperature * air_speed)
475,097
def feels_like(temperature, air_speed): """tempature as °C, air_speed as kmph. The formula from http://www.bbc.co.uk/weather/features/understanding/feelslike.shtml""" air_speed = air_speed ** 0.16 return (13.12 + 0.6215 * temperature - 11.37 * air_speed + 0.3965 * temperature * air_speed)
deffeels_like(temperature,air_speed):"""tempatureas°C,air_speedaskmph.Theformulafromhttp://www.bbc.co.uk/weather/features/understanding/feelslike.shtml"""air_speed=air_speed**0.16return(13.12+0.6215*temperature-11.37*air_speed+0.3965*temperature*air_speed)
475,098
def init_logging(): filename = os.path.join(sys.path[0], 'pyfibot.log') # get root logger logger = logging.getLogger() if False: handler = logging.handlers.RotatingFileHandler(filename, maxBytes=5000*1024, backupCount=20) else: handler = logging.StreamHandler() # time format is same format of strftime formatter = logging.Formatter('%(asctime)-15s %(levelname)-8s %(name)-11s %(message)s') handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.DEBUG)
def init_logging(): filename = os.path.join(sys.path[0], 'pyfibot.log') # get root logger logger = logging.getLogger() if False: handler = logging.handlers.RotatingFileHandler(filename, maxBytes=5000*1024, backupCount=20) else: handler = logging.StreamHandler() # time format is same format of strftime formatter = logging.Formatter('%(asctime)-15s %(levelname)-8s %(name)-11s %(message)s') handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.DEBUG)
475,099