예제 #1
0
파일: MyST.py 프로젝트: binho/myservertalks
class MyST:

	def __init__(self):
		self.config = MySTConfig()

		if not self.config.get('config', 'account', 'user'):
			print 'MyServerTalks is not configured. Try to setup config.ini'
			sys.exit(1)

		# Get user and pass from MyST jabber user
		self.user     = self.config.get('config', 'account', 'user')
		self.password = self.config.get('config', 'account', 'pass')
		
		self.user_handler = MySTUserHandler(self.config)
		
		print 'MyServerTalks! '+MySTBase.getVersion()+' running...\n'
		MySTLog.log('MyServerTalks! '+MySTBase.getVersion()+' running...')

	# Connect MyST
	def connect(self):
		self.conn = MySTConnection(MySTModuleManager(self.config, self.user_handler))
		self.conn.connect(self.user, self.password)

	# Process informations and check connection state
	def looping(self):
		self.conn.loop()
예제 #2
0
파일: MyST.py 프로젝트: binho/myservertalks
	def connect(self):
		self.conn = MySTConnection(MySTModuleManager(self.config, self.user_handler))
		self.conn.connect(self.user, self.password)