# Path: halibot/halconfigurer.py
# class HalConfigurer():
# 
# 	def __init__(self, options={}):
# 		self.options = options
# 
# 	def option(self, option_type, key, **kwargs):
# 		opt = option_type(key, **kwargs)
# 
# 		# Override the default if the option is already set
# 		if key in self.options:
# 			opt.default = self.options[key]
# 
# 		val = opt.configure()
# 		if val != None:
# 			self.options[key] = val
# 
# 	def optionString(self, key, **kwargs):
# 		self.option(Option.String, key, **kwargs)
# 
# 	def optionInt(self, key, **kwargs):
# 		self.option(Option.Int, key, **kwargs)
# 
# 	def optionNumber(self, key, **kwargs):
# 		self.option(Option.Number, key, **kwargs)
# 
# 	def optionBoolean(self, key, **kwargs):
# 		self.option(Option.Boolean, key, **kwargs)
# 
# 	def configure(self):
# 		pass # pragma: no cover
# 
# Path: halibot/message.py
# class MalformedMsgException(Exception): 'Bad message object'


import logging
import asyncio
import inspect
import copy
from threading import Thread
from collections import defaultdict
from .halconfigurer import HalConfigurer
from .message import MalformedMsgException
				r[name] = to.sync_replies.pop(msg.uuid)
		return r

	async def _receive(self, msg):
		try:
			fname = 'receive_' + msg.type
			if hasattr(self, fname) and callable(getattr(self, fname)):
				# Type specific receive function
				getattr(self, fname)(msg)
			else:
				# Generic receive function
				self.receive(msg)
		except Exception as e:
			self.log.error("Exception in message receive", exc_info=True)

	def receive(self, msg):
		pass

	def receive_help(self, msg):
		if hasattr(self, 'topics'):
			if msg.body == []:
				# Retrieve available topics
				self.reply(msg, body=list(self.topics.keys()))
			else:
				# Retrieve help text for topic
				key = '/'.join(msg.body)
				if key in self.topics:
					t = self.topics[key]
					self.reply(msg, body=t() if callable(t) else t)


# Path: halibot/halconfigurer.py
# class HalConfigurer():
# 
# 	def __init__(self, options={}):
# 		self.options = options
# 
# 	def option(self, option_type, key, **kwargs):
# 		opt = option_type(key, **kwargs)
# 
# 		# Override the default if the option is already set
# 		if key in self.options:
# 			opt.default = self.options[key]
# 
# 		val = opt.configure()
# 		if val != None:
# 			self.options[key] = val
# 
# 	def optionString(self, key, **kwargs):
# 		self.option(Option.String, key, **kwargs)
# 
# 	def optionInt(self, key, **kwargs):
# 		self.option(Option.Int, key, **kwargs)
# 
# 	def optionNumber(self, key, **kwargs):
# 		self.option(Option.Number, key, **kwargs)
# 
# 	def optionBoolean(self, key, **kwargs):
# 		self.option(Option.Boolean, key, **kwargs)
# 
# 	def configure(self):
# 		pass # pragma: no cover
# 
# Path: halibot/message.py
# class MalformedMsgException(Exception): 'Bad message object'


# Path: halibot/halobject.py
import logging
import asyncio
import inspect
import copy
from threading import Thread
from collections import defaultdict
from .halconfigurer import HalConfigurer
from .message import MalformedMsgException

				r[name] = to.sync_replies.pop(msg.uuid)
		return r

	async def _receive(self, msg):
		try:
			fname = 'receive_' + msg.type
			if hasattr(self, fname) and callable(getattr(self, fname)):
				# Type specific receive function
				getattr(self, fname)(msg)
			else:
				# Generic receive function
				self.receive(msg)
		except Exception as e:
			self.log.error("Exception in message receive", exc_info=True)

	def receive(self, msg):
		pass

	def receive_help(self, msg):
		if hasattr(self, 'topics'):
			if msg.body == []:
				# Retrieve available topics
				self.reply(msg, body=list(self.topics.keys()))
			else:
				# Retrieve help text for topic
				key = '/'.join(msg.body)
				if key in self.topics:
					t = self.topics[key]
					self.reply(msg, body=t() if callable(t) else t)


	class Configurer(HalConfigurer):