Exemplo n.º 1
0
 def __init__(self):
     CConfigurable.__init__(self, '/etc/rsdn-irc-bot/storage.conf')
     self.pool = psycopg2.pool.ThreadedConnectionPool(int(self.config['pool']['min_connections']), 
                                                      int(self.config['pool']['max_connections']), 
                                                      database = self.config['database'], 
                                                      user     = self.config['user'], 
                                                      password = self.config['password'], 
                                                      host     = self.config['host'], 
                                                      port     = self.config['port'])
     self.debug = self.config['debug'] == 'true'
Exemplo n.º 2
0
 def __init__(self):
     Thread.__init__(self)
     CConfigurable.__init__(self, '/etc/rsdn-irc-bot/rsdn.conf')
     self._terminate                    = False
     self.timer_sync_forums_list        = Timer.CTimer(int(self.config['timers']['sync_forum_list']), self.sync_forums_list)
     self.timer_sync_rsdn_data          = Timer.CTimer(int(self.config['timers']['sync_data'])      , self.sync_forums_data)
     self.forums                        = dict()
     self._missed_rsdn_messages_mids    = []
     self._missed_rsdn_members_uids     = []
     self.max_broken_per_sync_iteration = int(self.config['limits']['max_broken_messages_per_iteration'])
     self.min_broken_per_sync_iteration = int(self.config['limits']['min_broken_messages_per_iteration'])
Exemplo n.º 3
0
 def __init__(self):
     CConfigurable.__init__(self, '/etc/rsdn-irc-bot/bot.conf')
     Irc.CIrc.__init__(  self,
                     self.config['connection']['host'], 
                     int(self.config['connection']['port']), 
                     self.config['auth']['nick'], 
                     self.config['auth']['ident'], 
                     self.config['auth']['hostname'], 
                     self.config['auth']['realname'],
                     self.config['debug']['irc'] == 'true')
     self.operators = self.config['operators']
     self._channels_list_observe_timer = Timer.CTimer(int(self.config['timers']['channels_list_observe']), self.request_channels)
     self.commander = Commander.CCommander()
     self.bot_channels = self.config['debug']['channels']+self.config['channels'].values()
     self.debug = self.config['debug']['bot'] == 'true'
     self.channel_topics = dict()
     self.store_channel_topic(self.config['channels']['log'], u'Лог работы робота')
     self.store_channel_topic(self.config['channels']['notifications'], u'Все сообщения о активности на RSDN')
     self.log_channel = None
     self.notifications_channel = None