Пример #1
0
	def run(self):
		while 1:
			Options, name, msg = ircQueue.get()
			# NOTE: This msgtext is broken on IPv6 and should not be used
			#  Reload codes really needs to be cleaned up
			#  Better way would be to have plugger pick up !reload and signal main
			msgtext = msg.partition(':')[2].partition(':')[2]
			if self.reinit or msgtext.strip() in ["!reload", "+!reload"]:
				try:
					reload(plugger)
					self.ninja = plugger.pluggerThread()
					if not self.reinit:
						self.sendRaw(name, "PRIVMSG " + Options['debugchannel'] + " :["+self.name+"] Plugger reloaded. I am commanding other threads to reload now.\r\n")
						for noodle in fts:
							noodle.america(self.name, Options['debugchannel'], name)
					else:
						self.sendRaw(self.skynet, "PRIVMSG " + self.commander + " :["+self.name+"] Plugger reloaded.\r\n")
						self.reinit = False
				except:
					self.sendRaw(name, "PRIVMSG " + Options['debugchannel'] + " :["+self.name+"] Plugger reload FAILED\r\n")
			try:
				self.ninja.run(msg, Options, name, plugger.pluggar('plugins.conf'), zomgthefiles) #not a real thread...
			except:
				self.sendRaw(name, "PRIVMSG " + Options['debugchannel'] + " :["+self.name+"] Core caught an unhandled exception in plugger. I'd tell you more, but some asshole decided to delete backtrace code from core.\r\n")
			if self.ninja.out.strip():
				self.sendRaw(self.ninja.network, self.ninja.out)
			if self.ninja.log.strip():
				self.log(self.ninja.network, self.ninja.log)
			ircQueue.task_done()
Пример #2
0
	def __init__(self, name):
		self.reinit = False
		self.commander = '#b0tcage'
		self.skynet = 'freenode'
		self.ninja = plugger.pluggerThread()
		threading.Thread.__init__(self, name=name)