Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(565)  |  Call(565)  |  Derive(0)  |  Import(0)
Log a debug message to the main log.
        

src/b/i/big-brother-bot-HEAD/b3/plugins/ftpytail.py   big-brother-bot(Download)
            # get B3 actual locally opened game log
            self.lgame_log = os.path.normpath(os.path.expanduser(self.console.input.name))
            self.debug('Local Game Log is %s' % self.lgame_log)
 
        if self.console.config.get('server','game_log')[0:6] == 'ftp://' :
                remoteSize = ftp.size(os.path.basename(self.url_path))
                if remoteSize < self._remoteFileOffset:
                    self.debug("remote file rotation detected")
                    self._remoteFileOffset = 0
                if remoteSize > self._remoteFileOffset:
                    if  (remoteSize - self._remoteFileOffset) > self._maxGap:
                        self.debug('gap between local and remote file too large (%s bytes)', (remoteSize - self._remoteFileOffset))
                        self.debug('downloading only the last %s bytes' % self._maxGap)
                    if self.console._paused:
                        self.console.unpause()
                        self.debug('Unpausing')
 
            except ftplib.all_errors, e:

src/b/3/b3-1.9.2/b3/plugins/tk.py   b3(Download)
                self._grudge_enable = self.config.getboolean('settings', 'grudge_enable')
            except:
                self.debug('Using default value (%s) for grudge_enable', self._grudge_enable)
            try:
                self._grudge_level = self.config.getint('settings','grudge_level')
            except:
                self.debug('Using default value (%s) for grudge_level', self._grudge_level)
            self._cronTab_tkhalflife = b3.cron.OneTimeCronTab(self.halveTKPoints, second=sec, minute=min)
            self.console.cron + self._cronTab_tkhalflife
            self.debug('TK Crontab started')
 
 
            self._maxLevel = int(lev)
 
            self.debug('tk max level is %s', self._maxLevel)
 
            self._maxPoints = self.config.getint('settings', 'max_points')
        except:
            self._private_messages = True
        self.debug('Send messages privately ? %s' % self._private_messages)
 
        try:

src/b/i/big-brother-bot-HEAD/b3/plugins/tk.py   big-brother-bot(Download)
                self._grudge_enable = self.config.getboolean('settings', 'grudge_enable')
            except:
                self.debug('Using default value (%s) for grudge_enable', self._grudge_enable)
            try:
                self._grudge_level = self.config.getint('settings','grudge_level')
            except:
                self.debug('Using default value (%s) for grudge_level', self._grudge_level)
            self._cronTab_tkhalflife = b3.cron.OneTimeCronTab(self.halveTKPoints, second=sec, minute=min)
            self.console.cron + self._cronTab_tkhalflife
            self.debug('TK Crontab started')
 
 
            self._maxLevel = int(lev)
 
            self.debug('tk max level is %s', self._maxLevel)
 
            self._maxPoints = self.config.getint('settings', 'max_points')
        except:
            self._private_messages = True
        self.debug('Send messages privately ? %s' % self._private_messages)
 
        try:

src/b/3/b3-plugin-chatlogger-HEAD/extplugins/chatlogger.py   b3-plugin-chatlogger(Download)
        try:
            self._save2db = self.config.getboolean('general', 'save_to_database')
            self.debug('save chat to database : %s', 'enabled' if self._save2db else 'disabled')
        except ConfigParser.NoOptionError:
            self._save2db = True
        try:
            self._save2file = self.config.getboolean('general', 'save_to_file')
            self.debug('save chat to file : %s', 'enabled' if self._save2file else 'disabled')
        except ConfigParser.NoOptionError:
            self._save2file = False
    def loadConfig_database(self):
        try:
            self._db_table = self.config.get('database', 'db_table')
            self.debug('Using table (%s) to store log', self._db_table)
        except:
            self._db_table = 'chatlog'
            self.debug('Using default value (%s) for db_table', self._db_table)
        try:
            self._db_table_cmdlog = self.config.get('database', 'db_table_cmdlog')
            self.debug('Using table (%s) to store command log', self._db_table_cmdlog)
        except:
            self._db_table_cmdlog = 'cmdlog'

src/b/3/b3-plugin-telnet-HEAD/extplugins/telnet/__init__.py   b3-plugin-telnet(Download)
        me[client.cid] = client
        me.resetIndex()
        self.debug('Telnet Client Connected: [%s] %s - %s', client.cid, client.name, client.ip)
        return client
 

src/b/3/b3-1.9.2/b3/plugins/status.py   b3(Download)
        try:
            self._svarTable = self.config.get('settings', 'svar_table')
            self.debug('Using custom table for saving server svars: %s' % self._svarTable)
        except:
            self.debug('Using default table for saving server svars: %s' % self._svarTable)
        try:
            self._clientTable = self.config.get('settings', 'client_table')
            self.debug('Using custom table for saving current clients: %s' % self._clientTable)
        except:
            self.debug('Using default table for saving current clients: %s' % self._clientTable)
    def writeXML(self, xml):
        if self._ftpstatus == True:
            self.debug('Uploading XML status to FTP server')
            ftp=FTP(self._ftpinfo['host'],self._ftpinfo['user'],passwd=self._ftpinfo['password'])
            ftp.cwd(os.path.dirname(self._ftpinfo['path']))

src/b/i/big-brother-bot-HEAD/b3/plugins/status.py   big-brother-bot(Download)
        try:
            self._svarTable = self.config.get('settings', 'svar_table')
            self.debug('Using custom table for saving server svars: %s' % self._svarTable)
        except:
            self.debug('Using default table for saving server svars: %s' % self._svarTable)
        try:
            self._clientTable = self.config.get('settings', 'client_table')
            self.debug('Using custom table for saving current clients: %s' % self._clientTable)
        except:
            self.debug('Using default table for saving current clients: %s' % self._clientTable)
    def writeXML(self, xml):
        if self._ftpstatus == True:
            self.debug('Uploading XML status to FTP server')
            ftp=FTP(self._ftpinfo['host'],self._ftpinfo['user'],passwd=self._ftpinfo['password'])
            ftp.cwd(os.path.dirname(self._ftpinfo['path']))

src/b/3/b3-1.9.2/b3/plugins/publist.py   b3(Download)
    def onLoadConfig(self):
        try:
            self._secondUrl = self.config.get('settings', 'url')
            self.debug('Using second url : %s' % self._secondUrl)
        except:
            pass
 
        try:
            self._initial_heartbeat_delay_minutes = self.config.getint('settings', 'delay')
            self.debug('delay : %s' % self._initial_heartbeat_delay_minutes)
        rmin = random.randint(0,59)
        rhour = random.randint(0,23)
        self.debug("publist will send heartbeat at %02d:%02d every day" % (rhour,rmin))
        self._cronTab = b3.cron.PluginCronTab(self, self.update, 0, rmin, rhour, '*', '*', '*')
        self.console.cron + self._cronTab
    def update(self):
        """send an upate heartbeat to B3 master server"""
        self.debug('Sending heartbeat to B3 master...')
        socket.setdefaulttimeout(10)
 
                    info.update({'bannerUrl': cvarBannerUrl.value})
            except Exception, err:
                self.debug(err)
 
        self.debug(info)

src/b/3/b3-1.9.2/b3/plugins/sftpytail.py   b3(Download)
            logext = 'games_mp_' + logext + '_' + str(self._port) + '.log'
            self.lgame_log = os.path.normpath(os.path.expanduser(logext))
            self.debug('Local Game Log is %s' % self.lgame_log)
 
        if self.console.config.get('server','game_log')[0:7] == 'sftp://' :
                    self._remoteFileOffset = remoteSize
                if remoteSize < self._remoteFileOffset:
                    self.debug("remote file rotation detected")
                    self._remoteFileOffset = 0
                if remoteSize > self._remoteFileOffset:
                    #self.debug('RETR from remote offset %s. (expecting to read at least %s bytes)' % (self._remoteFileOffset, remoteSize - self._remoteFileOffset))
                    if not rfile:
                        self.debug('opening remote game log file %s for reading' % self.sftpconfig['path'])
                        rfile = sftp.open(self.sftpconfig['path'], 'r')
                    rfile.seek(self._remoteFileOffset)
                    self.debug('reading remote game log file from offset %s' % self._remoteFileOffset)
                    if self.console._paused:
                        self.console.unpause()
                        self.debug('Unpausing')
            except paramiko.SSHException, e:
                self.debug(str(e))

src/b/i/big-brother-bot-HEAD/b3/plugins/publist.py   big-brother-bot(Download)
    def onLoadConfig(self):
        try:
            self._secondUrl = self.config.get('settings', 'url')
            self.debug('Using second url : %s' % self._secondUrl)
        except:
            pass
 
        try:
            self._initial_heartbeat_delay_minutes = self.config.getint('settings', 'delay')
            self.debug('delay : %s' % self._initial_heartbeat_delay_minutes)
        rmin = random.randint(0,59)
        rhour = random.randint(0,23)
        self.debug("publist will send heartbeat at %02d:%02d every day" % (rhour,rmin))
        self._cronTab = b3.cron.PluginCronTab(self, self.update, 0, rmin, rhour, '*', '*', '*')
        self.console.cron + self._cronTab
    def update(self):
        """send an upate heartbeat to B3 master server"""
        self.debug('Sending heartbeat to B3 master...')
        socket.setdefaulttimeout(10)
 
                    info.update({'bannerUrl': cvarBannerUrl.value})
            except Exception, err:
                self.debug(err)
 
        self.debug(info)

Previous  1 | 2 | 3 | 4  Next