From nextgens at freenetproject.org Tue May 1 07:57:39 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 1 May 2007 07:57:39 +0000 (UTC) Subject: [Pyfreenet] r13074 - trunk/apps/pyFreenet Message-ID: <20070501075739.7899D479F14@emu.freenetproject.org> Author: nextgens Date: 2007-05-01 07:57:39 +0000 (Tue, 01 May 2007) New Revision: 13074 Modified: trunk/apps/pyFreenet/refbot.py Log: refbot: allow in between bot exchange by default Modified: trunk/apps/pyFreenet/refbot.py =================================================================== --- trunk/apps/pyFreenet/refbot.py 2007-05-01 05:13:17 UTC (rev 13073) +++ trunk/apps/pyFreenet/refbot.py 2007-05-01 07:57:39 UTC (rev 13074) @@ -183,7 +183,7 @@ else: self.bot2bot_trades_enabled = False else: - self.bot2bot_trades_enabled = False + self.bot2bot_trades_enabled = True needToSave = True if(self.config_version < 2 and (not opts.has_key('bot2bot_trades_only') or (opts.has_key('bot2bot_trades_only') and opts['bot2bot_trades_only'] == 'n'))): self.setup_bot2bot_trades_only( opts ) From pyfreenet at freenetproject.org Tue May 15 20:33:49 2007 From: pyfreenet at freenetproject.org (pyfreenet at freenetproject.org) Date: Tue, 15 May 2007 20:33:49 +0000 (UTC) Subject: [Pyfreenet] *****SPAM***** Ticket number : 61605290102805376 Message-ID: <20070515113349.8547.qmail@dsl-189-136-73-177.prod-infinitum.com.mx> An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://emu.freenetproject.org/pipermail/pyfreenet/attachments/20070515/b67e12c6/attachment.txt -------------- next part -------------- An embedded message was scrubbed... From: Subject: Ticket number : 61605290102805376 Date: Tue, 15 May 2007 20:33:49 +0000 (UTC) Size: 9975 Url: http://emu.freenetproject.org/pipermail/pyfreenet/attachments/20070515/b67e12c6/attachment.eml From zothar at freenetproject.org Sun May 20 14:22:42 2007 From: zothar at freenetproject.org (zothar at freenetproject.org) Date: Sun, 20 May 2007 14:22:42 +0000 (UTC) Subject: [Pyfreenet] r13280 - trunk/apps/pyFreenet Message-ID: <20070520142242.64D7847980D@emu.freenetproject.org> Author: zothar Date: 2007-05-20 14:22:42 +0000 (Sun, 20 May 2007) New Revision: 13280 Modified: trunk/apps/pyFreenet/refbot.py Log: refbot: Clarify various who will trade with and how messages. Modified: trunk/apps/pyFreenet/refbot.py =================================================================== --- trunk/apps/pyFreenet/refbot.py 2007-05-20 02:05:03 UTC (rev 13279) +++ trunk/apps/pyFreenet/refbot.py 2007-05-20 14:22:42 UTC (rev 13280) @@ -799,21 +799,35 @@ if( self.bot2bot_trades_only_enabled ): self.privmsg( self.channel, - "Hi, I'm %s's noderef swap bot. I'm configured to only trade with other bots. Send me the \"help\" command to learn how to run your own ref swapping bot. (%d ref%s to go)" \ + "Hi, I'm %s's noderef swap bot. I'm configured to only trade with other bots and will not trade directly with humans. Send me the \"help\" command to learn how to run your own ref swapping bot. (%d ref%s to go)" \ % ( self.nodenick, refs_to_go, refs_plural_str ) ) elif( self.privmsg_only_enabled ): - self.privmsg( - self.channel, - "Hi, I'm %s's noderef swap bot. I'm configured to only trade refs with humans via private message (requires registering with nickserv, i.e. /ns register ). To swap a ref with me, /msg me with your ref url (%d ref%s to go)" \ - % ( self.nodenick, refs_to_go, refs_plural_str ) - ) + if( self.bot2bot_trades_enabled ): + self.privmsg( + self.channel, + "Hi, I'm %s's noderef swap bot. I'm configured to trade refs with bots and with humans only via private message (requires registering with nickserv, i.e. /ns register ). To swap a ref with me, /msg me with your ref url (%d ref%s to go)" \ + % ( self.nodenick, refs_to_go, refs_plural_str ) + ) + else: + self.privmsg( + self.channel, + "Hi, I'm %s's noderef swap bot. I'm configured to only trade refs with humans via private message (requires registering with nickserv, i.e. /ns register ) and will not trade with bots. To swap a ref with me, /msg me with your ref url (%d ref%s to go)" \ + % ( self.nodenick, refs_to_go, refs_plural_str ) + ) else: - self.privmsg( - self.channel, - "Hi, I'm %s's noderef swap bot. To swap a ref with me, /msg me or say %s: your_ref_url (%d ref%s to go)" \ - % ( self.nodenick, self.nick, refs_to_go, refs_plural_str ) - ) + if( self.bot2bot_trades_enabled ): + self.privmsg( + self.channel, + "Hi, I'm %s's noderef swap bot. I'm configured to trade with humans or bots. To swap a ref with me, /msg me or say %s: your_ref_url (%d ref%s to go)" \ + % ( self.nodenick, self.nick, refs_to_go, refs_plural_str ) + ) + else: + self.privmsg( + self.channel, + "Hi, I'm %s's noderef swap bot. I'm configured to trade with humans, but not with bots. To swap a ref with me, /msg me or say %s: your_ref_url (%d ref%s to go)" \ + % ( self.nodenick, self.nick, refs_to_go, refs_plural_str ) + ) if(self.greet_interval > 0 and not self.bot2bot_trades_only_enabled): self.after(self.greet_interval, self.greetChannel) @@ -1313,7 +1327,7 @@ """ if(cmd.startswith("http://")): if( self.bot.bot2bot_trades_only_enabled ): - replyfunc("Sorry, I'm configured to only trade refs with other bots. Send me the \"help\" command to learn how to run your own ref swapping bot.") + replyfunc("Sorry, I'm configured to only trade refs with other bots and to not trade directly with humans. Send me the \"help\" command to learn how to run your own ref swapping bot.") return True if( self.bot.privmsg_only_enabled and not is_from_privmsg ): replyfunc = self.privmsg @@ -1345,7 +1359,7 @@ def cmd_addref(self, replyfunc, is_from_privmsg, args): if( self.bot.bot2bot_trades_only_enabled ): - replyfunc("Sorry, I'm configured to only trade refs with other bots. Send me the \"help\" command to learn how to run your own ref swapping bot.") + replyfunc("Sorry, I'm configured to only trade refs with other bots and to not trade directly with humans. Send me the \"help\" command to learn how to run your own ref swapping bot.") return if( self.bot.privmsg_only_enabled and not is_from_privmsg ): replyfunc = self.privmsg @@ -1454,10 +1468,10 @@ def cmd_getref(self, replyfunc, is_from_privmsg, args): if( self.bot.bot2bot_trades_only_enabled ): - replyfunc("Sorry, I'm configured to only trade refs with other bots. Send me the \"help\" command to learn how to run your own ref swapping bot.") + replyfunc("Sorry, I'm configured to only trade refs with other bots and to not trade directly with humans. Send me the \"help\" command to learn how to run your own ref swapping bot.") return if( self.bot.privmsg_only_enabled and not is_from_privmsg ): - replyfunc("Sorry, I'm configured to only trade refs using private messages. Use the /msg command to send me a private message, after registering with nickserv if needed (i.e. /ns register ).") + replyfunc("Sorry, I'm configured to trade refs with humans only using private messages. Use the /msg command to send me a private message, after registering with nickserv if needed (i.e. /ns register ).") return replyfunc("My ref is at %s" % self.bot.refurl) @@ -1466,10 +1480,10 @@ def cmd_getrefdirect(self, replyfunc, is_from_privmsg, args): if( self.bot.bot2bot_trades_only_enabled and not self.bot.bots.has_key( self.peernick )): - replyfunc("Sorry, I'm configured to only trade refs with other bots. Send me the \"help\" command to learn how to run your own ref swapping bot.") + replyfunc("Sorry, I'm configured to only trade refs with other bots and to not trade directly with humans. Send me the \"help\" command to learn how to run your own ref swapping bot.") return if( self.bot.privmsg_only_enabled and not is_from_privmsg ): - replyfunc("Sorry, I'm configured to only trade refs using private messages. Use the /msg command to send me a private message, after registering with nickserv if needed (i.e. /ns register ).") + replyfunc("Sorry, I'm configured to trade refs with humans only using private messages. Use the /msg command to send me a private message, after registering with nickserv if needed (i.e. /ns register ).") return nodeRefKeys = self.bot.nodeRef.keys() nodeRefKeys.sort() From zothar at freenetproject.org Sun May 20 14:38:37 2007 From: zothar at freenetproject.org (zothar at freenetproject.org) Date: Sun, 20 May 2007 14:38:37 +0000 (UTC) Subject: [Pyfreenet] r13281 - trunk/apps/pyFreenet Message-ID: <20070520143837.132F547A08B@emu.freenetproject.org> Author: zothar Date: 2007-05-20 14:38:36 +0000 (Sun, 20 May 2007) New Revision: 13281 Modified: trunk/apps/pyFreenet/refbot.py Log: refbot: separating _configured from _enabled to simplify _enabled checks. Modified: trunk/apps/pyFreenet/refbot.py =================================================================== --- trunk/apps/pyFreenet/refbot.py 2007-05-20 14:22:42 UTC (rev 13280) +++ trunk/apps/pyFreenet/refbot.py 2007-05-20 14:38:36 UTC (rev 13281) @@ -159,61 +159,61 @@ self.setup_bot2bot( opts ) if(opts.has_key('bot2bot')): if( opts['bot2bot'] == 'y' ): - self.bot2bot_enabled = True + self.bot2bot_configured = True else: - self.bot2bot_enabled = False + self.bot2bot_configured = False else: - self.bot2bot_enabled = True + self.bot2bot_configured = True needToSave = True # Not implemented yet - **FIXME** # **FIXME** Needs config_version check and old config_version upgrading #if(opts.has_key('bot2bot_announces')): # if( opts['bot2bot_announce'] == 'y' ): - # self.bot2bot_announces_enabled = True + # self.bot2bot_announces_configured = True # else: - # self.bot2bot_announces_enabled = False + # self.bot2bot_announces_configured = False #else: - # self.bot2bot_announces_enabled = False + # self.bot2bot_announces_configured = False # needToSave = True if(self.config_version < 1 and (not opts.has_key('bot2bot_trades') or (opts.has_key('bot2bot_trades') and opts['bot2bot_trades'] == 'n'))): self.setup_bot2bot_trades( opts ) if(opts.has_key('bot2bot_trades')): if( opts['bot2bot_trades'] == 'y' ): - self.bot2bot_trades_enabled = True + self.bot2bot_trades_configured = True else: - self.bot2bot_trades_enabled = False + self.bot2bot_trades_configured = False else: - self.bot2bot_trades_enabled = True + self.bot2bot_trades_configured = True needToSave = True if(self.config_version < 2 and (not opts.has_key('bot2bot_trades_only') or (opts.has_key('bot2bot_trades_only') and opts['bot2bot_trades_only'] == 'n'))): self.setup_bot2bot_trades_only( opts ) if(opts.has_key('bot2bot_trades_only')): if( opts['bot2bot_trades_only'] == 'y' ): - self.bot2bot_trades_only_enabled = True + self.bot2bot_trades_only_configured = True else: - self.bot2bot_trades_only_enabled = False + self.bot2bot_trades_only_configured = False else: - self.bot2bot_trades_only_enabled = False + self.bot2bot_trades_only_configured = False needToSave = True - if(not self.bot2bot_enabled and self.bot2bot_trades_only_enabled): + if(not self.bot2bot_configured and self.bot2bot_trades_only_configured): print "bot2bot communication is disabled, but trading with other bots only is enabled. This does not make sense. Quitting." my_exit( 1 ); - if(not self.bot2bot_trades_enabled and self.bot2bot_trades_only_enabled): + if(not self.bot2bot_trades_configured and self.bot2bot_trades_only_configured): print "bot2bot ref trading is disabled, but trading with other bots only is enabled. This does not make sense. Quitting." my_exit( 1 ); if(self.config_version < 3 and (not opts.has_key('privmsg_only') or (opts.has_key('privmsg_only') and opts['privmsg_only'] == 'y'))): self.setup_privmsg_only( opts ) self.refurl = opts['refurl'] - if('' == self.refurl and not self.bot2bot_trades_only_enabled): + if('' == self.refurl and not self.bot2bot_trades_only_configured): print "configured to trade with humans using a noderef url, but we don't know a noderef url. This does not make sense. Quitting." my_exit( 1 ); if(opts.has_key('privmsg_only')): if( opts['privmsg_only'] == 'y' ): - self.privmsg_only_enabled = True + self.privmsg_only_configured = True else: - self.privmsg_only_enabled = False + self.privmsg_only_configured = False else: - self.privmsg_only_enabled = True + self.privmsg_only_configured = True needToSave = True if(opts.has_key('ircchannel')): self.chan = opts['ircchannel'] @@ -285,6 +285,15 @@ # for internal use shadow of MiniBot configs self.irc_host = kw[ 'host' ] self.irc_port = kw[ 'port' ] + + self.bot2bot_enabled = self.bot2bot_configured; + self.bot2bot_trades_enabled = self.bot2bot_trades_configured; + self.bot2bot_trades_only_enabled = self.bot2bot_trades_only_configured; + self.privmsg_only_enabled = self.privmsg_only_configured; + if( not self.bot2bot_enabled and self.bot2bot_trades_enabled ): + self.bot2bot_trades_enabled = False; + if( not self.bot2bot_trades_enabled and self.bot2bot_trades_only_enabled ): + self.bot2bot_trades_only_enabled = False; # finally construct the parent MiniBot.__init__(self, **kw) @@ -632,24 +641,24 @@ f.write(fmt % ("spaminterval", repr(self.spam_interval))) f.write(fmt % ("refsperrun", repr(self.number_of_refs_to_collect))) f.write(fmt % ("refs", repr(self.refs))) - if(self.bot2bot_enabled): + if(self.bot2bot_configured): f.write(fmt % ("bot2bot", repr('y'))) else: f.write(fmt % ("bot2bot", repr('n'))) # Not implemented yet - **FIXME** - #if(self.bot2bot_announces_enabled): + #if(self.bot2bot_announces_configured): # f.write(fmt % ("bot2bot_announces", repr('y'))) #else: # f.write(fmt % ("bot2bot_announces", repr('n'))) - if(self.bot2bot_trades_enabled): + if(self.bot2bot_trades_configured): f.write(fmt % ("bot2bot_trades", repr('y'))) else: f.write(fmt % ("bot2bot_trades", repr('n'))) - if(self.bot2bot_trades_only_enabled): + if(self.bot2bot_trades_only_configured): f.write(fmt % ("bot2bot_trades_only", repr('y'))) else: f.write(fmt % ("bot2bot_trades_only", repr('n'))) - if(self.privmsg_only_enabled): + if(self.privmsg_only_configured): f.write(fmt % ("privmsg_only", repr('y'))) else: f.write(fmt % ("privmsg_only", repr('n'))) @@ -1143,7 +1152,7 @@ elif( self.bots[ botNick ].has_key( "ref" )): pass; # Assume it's currently being sent else: - if( self.bot2bot_enabled and self.bot2bot_trades_enabled ): + if( self.bot2bot_trades_enabled ): if( self.check_bot_peer_has_option( botNick, "bot2bot_trades" )): self.after(random.randint(15, 90), self.sendGetRefDirect, botNick) # Ask for their ref to be sent directly after 15-90 seconds else: @@ -1395,7 +1404,7 @@ def cmd_dorefswapallow(self, replyfunc, is_from_privmsg, args): # NOTE: We'll not have asked if from our perspective we didn't want to swap, but we don't want to add a ref for a bot we don't think we can respond to (because they disconnected or something) # NOTE: Also, we don't want anybody to try to "cheat" the "negotiation" scheme - if( self.bot.bot2bot_enabled and self.bot.bot2bot_trades_enabled ): + if( self.bot.bot2bot_trades_enabled ): if( self.bot.check_bot_peer_has_option( self.peernick, "bot2bot_trades" )): if( self.bot.bots[ self.peernick ].has_key( "ref" ) and self.bot.bots[ self.peernick ].has_key( "ref_terminated" ) and self.bot.bots[ self.peernick ].has_key( "ref_is_good" )): self.bot.addref( "(from bot: %s)" % ( self.peernick ), replyfunc, self.peernick, self.bot.bots[ self.peernick ][ "ref" ], "allow" ) @@ -1426,7 +1435,7 @@ #@-node:cmd_dorefswapfailed #@+node:cmd_dorefswaprequest def cmd_dorefswaprequest(self, replyfunc, is_from_privmsg, args): - if( self.bot.bot2bot_enabled and self.bot.bot2bot_trades_enabled ): + if( self.bot.bot2bot_trades_enabled ): if( self.bot.check_bot_peer_has_option( self.peernick, "bot2bot_trades" )): if( self.bot.bots[ self.peernick ].has_key( "ref" ) and self.bot.bots[ self.peernick ].has_key( "ref_terminated" ) and self.bot.bots[ self.peernick ].has_key( "ref_is_good" )): # NOTE: Later we may have some criterion for rejecting the request other than we don't have their ref and we don't trade refs or we don't do bot2bot at all @@ -1450,7 +1459,7 @@ self.bot.addBotIdentity( self.peernick, peerIdentity ); log("** botIdentities: %s" % ( self.bot.botIdentities.keys() )) if( not self.bot.check_bot_peer_is_connected( self.peernick )): - if( self.bot.bot2bot_enabled and self.bot.bot2bot_trades_enabled ): + if( self.bot.bot2bot_trades_enabled ): if( self.bot.check_bot_peer_has_option( self.peernick, "bot2bot_trades" )): self.bot.check_identity_with_node( peerIdentity ) @@ -1503,7 +1512,7 @@ #@-node:cmd_havepeer #@+node:cmd_haveref def cmd_haveref(self, replyfunc, is_from_privmsg, args): - if( self.bot.bot2bot_enabled and self.bot.bot2bot_trades_enabled ): + if( self.bot.bot2bot_trades_enabled ): if( self.bot.check_bot_peer_has_option( self.peernick, "bot2bot_trades" )): if( self.bot.bots[ self.peernick ].has_key( "ref" ) and self.bot.bots[ self.peernick ].has_key( "ref_terminated" ) and self.bot.bots[ self.peernick ].has_key( "ref_is_good" )): self.after(random.randint(7, 20), self.bot.sendDoRefSwapRequest, self.peernick) # Ask to swap refs with them after 7-20 seconds @@ -1558,7 +1567,7 @@ if( not self.bot.botIdentities.has_key( peerIdentity )): self.bot.addBotIdentity( self.peernick, peerIdentity ) log("** botIdentities: %s" % ( self.bot.botIdentities.keys() )) - if( self.bot.bot2bot_enabled and self.bot.bot2bot_trades_enabled ): + if( self.bot.bot2bot_trades_enabled ): if( self.bot.check_bot_peer_has_option( self.peernick, "bot2bot_trades" )): self.bot.check_identity_with_node( peerIdentity ) From zothar at freenetproject.org Sun May 20 21:13:48 2007 From: zothar at freenetproject.org (zothar at freenetproject.org) Date: Sun, 20 May 2007 21:13:48 +0000 (UTC) Subject: [Pyfreenet] r13283 - trunk/apps/pyFreenet Message-ID: <20070520211348.931734796D1@emu.freenetproject.org> Author: zothar Date: 2007-05-20 21:13:48 +0000 (Sun, 20 May 2007) New Revision: 13283 Modified: trunk/apps/pyFreenet/refbot.py Log: refbot: serialize cmd_getrefdirect replies which should help/fix excess flood problems when a bot2bot trader joins a channel with a lot of other bot2bot traders. Modified: trunk/apps/pyFreenet/refbot.py =================================================================== --- trunk/apps/pyFreenet/refbot.py 2007-05-20 17:19:18 UTC (rev 13282) +++ trunk/apps/pyFreenet/refbot.py 2007-05-20 21:13:48 UTC (rev 13283) @@ -9,6 +9,7 @@ #@+node:imports import StringIO import base64 +import math import os import random import select @@ -437,6 +438,8 @@ self.peerUpdaterThreads = [] self.peer_update_interval = 60 self.api_options = [] + self.nextWhenTime = 0; + self.sendRefDirectLock = threading.Lock() if(self.bot2bot_enabled): self.api_options.append( "bot2bot" ); # Not implemented yet - **FIXME** @@ -1277,6 +1280,33 @@ return resp #@-node:prompt + #@+node:sendrefdirect + def sendrefdirect(self, peernick, is_bot ): + + nodeRefKeys = self.nodeRef.keys() + nodeRefKeys.sort() + log( "** sendrefdirect(): sendRefDirectLock.acquire() before processing peernick: %s" % ( peernick )); + self.sendRefDirectLock.acquire( 1 ); + # Spread out the lines of the ref so we don't trigger the babbler detector of a receiving refbot + nextWhen = 0; + now = long( math.floor( time.time() )); + if( self.nextWhenTime > now): + nextWhen = self.nextWhenTime - now; + else: + self.nextWhenTime = now; + beginningNextWhenTime = self.nextWhenTime; + log( "** DEBUG: before: nextWhen: %d nextWhenTime: %d" % ( nextWhen, self.nextWhenTime )); + for nodeRefKey in nodeRefKeys: + self.after( nextWhen, self.privmsg, peernick, "refdirect %s=%s" % ( nodeRefKey, self.nodeRef[ nodeRefKey ] )) + delay = random.randint(7,14) # 7-14 seconds between each line + nextWhen += delay; + self.nextWhenTime += delay; + self.after( nextWhen, self.privmsg, peernick, "refdirect End" ) + log( "** DEBUG: after: nextWhen: %d nextWhenTime: %d beginningNextWhenTime: %d diff: %d" % ( nextWhen, self.nextWhenTime, beginningNextWhenTime, self.nextWhenTime - beginningNextWhenTime )); + log( "** sendrefdirect(): sendRefDirectLock.release() after processing peernick: %s" % ( peernick )); + self.sendRefDirectLock.release(); + + #@-node:sendrefdirect #@+node:url_is_known_pastebin def url_is_known_pastebin(self, url): @@ -1494,14 +1524,7 @@ if( self.bot.privmsg_only_enabled and not is_from_privmsg ): replyfunc("Sorry, I'm configured to trade refs with humans only using private messages. Use the /msg command to send me a private message, after registering with nickserv if needed (i.e. /ns register ).") return - nodeRefKeys = self.bot.nodeRef.keys() - nodeRefKeys.sort() - # Spread out the lines of the ref so we don't trigger the babbler detector of a receiving refbot - nextWhen = 0; - for nodeRefKey in nodeRefKeys: - self.after( nextWhen, self.privmsg, "refdirect %s=%s" % ( nodeRefKey, self.bot.nodeRef[ nodeRefKey ] )) - nextWhen += random.randint(7,14) # 7-14 seconds between each line - self.after( nextWhen, self.privmsg, "refdirect End" ) + self.bot.sendrefdirect( self.peernick, self.bot.bots.has_key( self.peernick )); #@-node:cmd_getrefdirect #@+node:cmd_havepeer From zothar at freenetproject.org Sun May 20 22:00:48 2007 From: zothar at freenetproject.org (zothar at freenetproject.org) Date: Sun, 20 May 2007 22:00:48 +0000 (UTC) Subject: [Pyfreenet] r13286 - trunk/apps/pyFreenet Message-ID: <20070520220048.146F53882E0@emu.freenetproject.org> Author: zothar Date: 2007-05-20 22:00:47 +0000 (Sun, 20 May 2007) New Revision: 13286 Modified: trunk/apps/pyFreenet/fcp_to_rrdtool_bridge.py Log: pyfcp: Added boolean handling to fcp_to_rrdtool_bridge.py: 1.0 for true and 0.0 for false Modified: trunk/apps/pyFreenet/fcp_to_rrdtool_bridge.py =================================================================== --- trunk/apps/pyFreenet/fcp_to_rrdtool_bridge.py 2007-05-20 21:51:09 UTC (rev 13285) +++ trunk/apps/pyFreenet/fcp_to_rrdtool_bridge.py 2007-05-20 22:00:47 UTC (rev 13286) @@ -102,13 +102,18 @@ except KeyError, msg: datum_string = "0"; field_count += 1; - datum = float( datum_string ); - try: - test_datum = int( datum ); - except ValueError, msg: - test_datum = None; - if( test_datum == datum ): - datum = test_datum; + if( "true" == datum_string ): + datum = 1.0; + elif( "false" == datum_string ): + datum = 0.0; + else: + datum = float( datum_string ); + try: + test_datum = int( datum ); + except ValueError, msg: + test_datum = None; + if( test_datum == datum ): + datum = test_datum; sys.stdout.write( ":%s" % ( datum )); sys.stdout.write( "\n" ); sys.stdout.flush(); From nextgens at freenetproject.org Tue May 29 11:20:41 2007 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Tue, 29 May 2007 11:20:41 +0000 (UTC) Subject: [Pyfreenet] r13388 - trunk/apps/pyFreenet Message-ID: <20070529112041.131D04798FC@emu.freenetproject.org> Author: nextgens Date: 2007-05-29 11:20:40 +0000 (Tue, 29 May 2007) New Revision: 13388 Modified: trunk/apps/pyFreenet/refbot.py Log: pyFreenet: fix http://ash-fox.quickfox.org/temp/noderefbottraceback.txt Modified: trunk/apps/pyFreenet/refbot.py =================================================================== --- trunk/apps/pyFreenet/refbot.py 2007-05-29 03:19:17 UTC (rev 13387) +++ trunk/apps/pyFreenet/refbot.py 2007-05-29 11:20:40 UTC (rev 13388) @@ -1071,7 +1071,7 @@ required_ref_fields = [ "dsaGroup.g", "dsaGroup.p", "dsaGroup.q", "dsaPubKey.y", "identity", "location", "myName", "sig" ]; for require_ref_field in required_ref_fields: if(not ref_fieldset.has_key(require_ref_field)): - log("** bot using nick '%s' gave us a ref missing the required '%d' field." % ( botNick, require_ref_field )); + log("** bot using nick '%s' gave us a ref missing the required '%s' field." % ( botNick, require_ref_field )); del self.bots[ botNick ][ "ref" ] del self.bots[ botNick ][ "ref_terminated" ] return