[Otfbot-svn] r124 - in trunk: . modules

allo at BerliOS allo
Mo Jun 25 23:39:52 CEST 2007


Author: allo
Date: 2007-06-25 23:39:51 +0200 (Mon, 25 Jun 2007)
New Revision: 124

Modified:
   trunk/modules/logMod.py
   trunk/otfbot.py
Log:
-bot can now use a serverpassword
-logMod has no exception in psyc-ircgateway-channels (#psyc://server/@room) and safe encoding of logfilename


Modified: trunk/modules/logMod.py
===================================================================
--- trunk/modules/logMod.py	2007-06-25 21:01:16 UTC (rev 123)
+++ trunk/modules/logMod.py	2007-06-25 21:39:51 UTC (rev 124)
@@ -90,7 +90,7 @@
 	def joined(self, channel):
 		self.channels[string.lower(channel)]=1
 		#self.files[string.lower(channel)]=open(string.lower(channel)+".log", "a")
-		self.path[channel]=Template(self.logpath).safe_substitute({'c':channel})
+		self.path[channel]=Template(self.logpath).safe_substitute({'c':channel.replace("/", "_").replace(":", "")}) #replace to handle psyc:// channels
 		file=Template(self.path[channel]).safe_substitute(self.timemap())
 		if not os.path.exists(os.path.dirname(file)):
 			os.mkdir(os.path.dirname(file))

Modified: trunk/otfbot.py
===================================================================
--- trunk/otfbot.py	2007-06-25 21:01:16 UTC (rev 123)
+++ trunk/otfbot.py	2007-06-25 21:39:51 UTC (rev 124)
@@ -647,6 +647,10 @@
 			#for channel in channels:
 			#	if(not getBoolConfig('enabled','unset','main', network)):
 			#		channels.remove(channel)
+			password=getConfig('password', '', 'main', network)
+			if(password!=""):
+				f.protocol.password=unicode(password).encode("iso-8859-1")
+
 			if (getBoolConfig('ssl','False','main',network)):
 				s = ssl.ClientContextFactory()
 				connections[network]=reactor.connectSSL(unicode(network).encode("iso-8859-1"), int(getConfig('port','6697','main',network)), f,s);




Mehr Informationen über die Mailingliste Otfbot-dev