bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def onLoadConfig(self): self._maxLevel = self.config.getint('settings', 'max_level') | def onLoadConfig(self): self._maxLevel = self.config.getint('settings', 'max_level') | 446,600 |
def onEvent(self, event): try: if not event.client: return elif event.client.cid == None: return elif event.client.maxLevel > self._maxLevel: return elif not event.client.connected: return if len(event.data) > 3: if event.type == b3.events.EVT_CLIENT_SAY or \ event.type == b3.events.EVT_CLIENT_TEAM_SAY: raw = ' ' + eve... | def onEvent(self, event): try: if not event.client: return elif event.client.cid == None: return elif event.client.maxLevel > self._maxLevel: return elif not event.client.connected: return if len(event.data) > self._ignoreLength: if event.type == b3.events.EVT_CLIENT_SAY or \ event.type == b3.events.EVT_CLIENT_TEAM_SAY... | 446,601 |
def run(self): """Main worker thread for B3""" self.bot('Start reading...') self.screen.write('Startup Complete : Let\'s get to work!\n\n') self.screen.write('(Please check %s in the B3 root directory for more detailed info)\n' % self.config.getpath('b3', 'logfile')) #self.screen.flush() | def run(self): """Main worker thread for B3""" self.bot('Start reading...') self.screen.write('Startup Complete : Let\'s get to work!\n\n') self.screen.write('(Please check %s in the B3 root directory for more detailed info)\n' % self.config.getpath('b3', 'logfile')) #self.screen.flush() | 446,602 |
def OnPlayerKill(self, action, data): #player.onKill: ['Juxta', '6blBaJlblu'] if not len(data) == 2: return None attacker = self.getClient(data[0]) if not attacker: self.debug('No attacker') return None | def OnPlayerKill(self, action, data): #player.onKill: ['Juxta', '6blBaJlblu'] if not len(data) == 2: return None attacker = self.getClient(data[0]) if not attacker: self.debug('No attacker') return None | 446,603 |
def run(self): """Main worker thread for B3""" self.bot('Start reading...') self.screen.write('Startup Complete : Let\'s get to work!\n\n') self.screen.write('(Please check %s in the B3 root directory for more detailed info)\n' % self.config.getpath('b3', 'logfile')) #self.screen.flush() | def run(self): """Main worker thread for B3""" self.bot('Start reading...') self.screen.write('Startup Complete : Let\'s get to work!\n\n') self.screen.write('(Please check %s in the B3 root directory for more detailed info)\n' % self.config.getpath('b3', 'logfile')) #self.screen.flush() | 446,604 |
def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,605 |
def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,606 |
def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | 446,607 |
def OnPlayerKill(self, action, data): #player.onKill: ['Juxta', '6blBaJlblu'] if not len(data) == 2: return None attacker = self.getClient(data[0]) if not attacker: self.debug('No attacker') return None | def OnPlayerKill(self, action, data): #player.onKill: ['Juxta', '6blBaJlblu'] if not len(data) == 2: return None attacker = self.getClient(data[0]) if not attacker: self.debug('No attacker') return None | 446,608 |
def readBfbc2Event(self): # Wait for packet from server try: packet = self._packetReader.getPacket() while packet is None: try: data = self._serverSocket.recv(1024) if not data: break self._packetReader.append(data) packet = self._packetReader.getPacket() except IncompletePacket: pass except socket.timeout: pass except... | def readBfbc2Event(self): # Wait for packet from server try: try: packet = self._packetReader.getPacket() except IncompletePacket: pass while packet is None: try: data = self._serverSocket.recv(1024) if not data: break self._packetReader.append(data) try: packet = self._packetReader.getPacket() except IncompletePacket:... | 446,609 |
def sync(self): plist = self.getPlayerList(maxRetries=4) mlist = {} | def sync(self): plist = self.getPlayerList() mlist = {} | 446,610 |
def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,611 |
def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,612 |
def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,613 |
def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,614 |
def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | 446,615 |
def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | 446,616 |
def registerCommand(self, plugin, command, level, handler, alias=None, secretLevel=None): if not handler: self.error('Command "%s" registration failed, no handler' % command) return False | def registerCommand(self, plugin, command, level, handler, alias=None, secretLevel=None): if not handler: self.error('Command "%s" registration failed, no handler' % command) return False | 446,617 |
def OnItem(self, action, data, match=None): #Item: 0 pickup_money (5) picked up ($25) #Item: 0 weapon_schofield bought ($18/$20) #Item: 0 weapon_remington58 (7) picked up cid, item = string.split(data, ' ', 1) client = self.getByCidOrJoinPlayer(cid) if client: if 'pickup_money' in item: rePickup_money = re.compile(r"^p... | def OnItem(self, action, data, match=None): #Item: 0 pickup_money (5) picked up ($25) #Item: 0 weapon_schofield bought ($18/$20) #Item: 0 weapon_remington58 (7) picked up cid, item = string.split(data, ' ', 1) client = self.getByCidOrJoinPlayer(cid) if client: if 'pickup_money' in item: rePickup_money = re.compile(r"^p... | 446,618 |
def __init__(self, **kwargs): self._pluginData = {} self.state = b3.STATE_UNKNOWN self._data = {} | def __init__(self, **kwargs): self._pluginData = {} self.state = b3.STATE_UNKNOWN self._data = {} | 446,619 |
def getCvar(self, cvarName): if cvarName not in self._gameServerVars: self.warning('unknown cvar \'%s\'' % cvarName) return None try: words = self.write(('vars.%s' % cvarName,)) except Bfbc2CommandFailedError, err: self.error(err) return self.debug('Get cvar %s = %s', cvarName, words) if words and len(words) == 1: re... | def getCvar(self, cvarName): if cvarName not in self._gameServerVars: self.warning('unknown cvar \'%s\'' % cvarName) return None try: words = self.write(('vars.%s' % cvarName,)) except Bfbc2CommandFailedError, err: self.error(err) return self.debug('Get cvar %s = %s', cvarName, words) if words: if len(words) == 0: re... | 446,620 |
def run(self): """Main worker thread for B3""" self.bot('Start reading...') self.screen.write('Startup Complete : Let\'s get to work!\n\n') self.screen.write('(Please check %s in the B3 root directory for more detailed info)\n' % self.config.getpath('b3', 'logfile')) #self.screen.flush() | def run(self): """Main worker thread for B3""" self.bot('Start reading...') self.screen.write('Startup Complete : Let\'s get to work!\n\n') self.screen.write('(Please check %s in the B3 root directory for more detailed info)\n' % self.config.getpath('b3', 'logfile')) #self.screen.flush() | 446,621 |
def startup(self): # add specific events self.Events.createEvent('EVT_CLIENT_SQUAD_CHANGE', 'Client Squad Change') self.Events.createEvent('EVT_PUNKBUSTER_SCHEDULED_TASK', 'PunkBuster scheduled task') self.Events.createEvent('EVT_PUNKBUSTER_LOST_PLAYER', 'PunkBuster client connection lost') # create the 'Server' clie... | def startup(self): # add specific events self.Events.createEvent('EVT_CLIENT_SQUAD_CHANGE', 'Client Squad Change') self.Events.createEvent('EVT_PUNKBUSTER_SCHEDULED_TASK', 'PunkBuster scheduled task') self.Events.createEvent('EVT_PUNKBUSTER_LOST_PLAYER', 'PunkBuster client connection lost') # create the 'Server' clie... | 446,622 |
def OnPlayerTeamchange(self, action, data): """ player.onTeamChange <soldier name: player name> <team: Team ID> <squad: Squad ID> Effect: Player might have changed team """ client = self.getClient(data[0]) if client: client.team = self.getTeam(data[1]) # .team setter will send team change event client.squad = data[2] | def OnPlayerTeamchange(self, action, data): """ player.onTeamChange <soldier name: player name> <team: Team ID> <squad: Squad ID> Effect: Player might have changed team """ client = self.getClient(data[0]) if client: client.team = self.getTeam(data[1]) # .team setter will send team change event client.squad = int(data... | 446,623 |
def OnServerLevelstarted(self, action, data): """When the level finished loading and started""" if self.changeMap_targetLevel is not None: if self.game.mapName != self.changeMap_targetLevel: # doh! the server just switched map sides instead of changing map !!! DICE please do something :) # try again self.debug("try one... | def OnServerLevelstarted(self, action, data): """When the level finished loading and started""" if self.changeMap_targetLevel is not None: if self.game.mapName != self.changeMap_targetLevel: # doh! the server just switched map sides instead of changing map !!! DICE please do something :) # try again self.debug("try one... | 446,624 |
def getNextMap(self): """Return the name of the next map """ [nextLevelIndex] = self.write(('mapList.nextLevelIndex',)) levelnames = self.write(('mapList.list',)) return self.getEasyName(levelnames[int(nextLevelIndex) % len(levelnames)]) | def getNextMap(self): """Return the name of the next map """ [nextLevelIndex] = self.write(('mapList.nextLevelIndex',)) levelnames = self.write(('mapList.list',)) if levelnames[nextLevelIndex] == self.getMap(): nextLevelIndex = (nextLevelIndex+1)%len(levelnames) return nextLevelIndex | 446,625 |
def getEasyName(self, mapname): """ Change levelname to real name """ if mapname.startswith('Levels/MP_001'): return 'Panama Canal' elif mapname.startswith('Levels/MP_002'): return 'Valparaiso' | def getEasyName(self, mapname): """ Change levelname to real name """ if mapname.startswith('Levels/MP_001'): return 'Panama Canal' elif mapname.startswith('Levels/MP_002'): return 'Valparaiso' | 446,626 |
def rotateMap(self): """Load the next level. If the current game mod plays each level twice to get teams the chance to play both sides, then this rotate a second time to really switch to the next level""" [nextLevelIndex] = self.write(('mapList.nextLevelIndex',)) levelnames = self.write(('mapList.list',)) self.changeMa... | def rotateMap(self): """Load the next map (not level). If the current game mod plays each level twice to get teams the chance to play both sides, then this rotate a second time to really switch to the next level""" [nextLevelIndex] = self.write(('mapList.nextLevelIndex',)) levelnames = self.write(('mapList.list',)) sel... | 446,627 |
def rotateMap(self): """Load the next level. If the current game mod plays each level twice to get teams the chance to play both sides, then this rotate a second time to really switch to the next level""" [nextLevelIndex] = self.write(('mapList.nextLevelIndex',)) levelnames = self.write(('mapList.list',)) self.changeMa... | def rotateMap(self): """Load the next level. If the current game mod plays each level twice to get teams the chance to play both sides, then this rotate a second time to really switch to the next map""" nextIndex = self.getNextMapIndex() if nextIndex == -1: self.write(('admin.runNextLevel',)) else: self.write(('mapLis... | 446,628 |
def changeMap(self, map): """Change to the given map/level If map is of the form 'Levels/MP_001' and 'Levels/MP_001' is a supported level for the current game mod, then this level is loaded. In other cases, this method assumes it is given a 'easy map name' (like 'Port Valdez') and it will do its best to find the leve... | def changeMap(self, map): """Change to the given map 1) determine the level name If map is of the form 'Levels/MP_001' and 'Levels/MP_001' is a supported level for the current game mod, then this level is loaded. In other cases, this method assumes it is given a 'easy map name' (like 'Port Valdez') and it will do its... | 446,629 |
def changeMap(self, map): """Change to the given map/level If map is of the form 'Levels/MP_001' and 'Levels/MP_001' is a supported level for the current game mod, then this level is loaded. In other cases, this method assumes it is given a 'easy map name' (like 'Port Valdez') and it will do its best to find the leve... | def changeMap(self, map): """Change to the given map/level If map is of the form 'Levels/MP_001' and 'Levels/MP_001' is a supported level for the current game mod, then this level is loaded. In other cases, this method assumes it is given a 'easy map name' (like 'Port Valdez') and it will do its best to find the leve... | 446,630 |
def changeMap(self, map): """Change to the given map/level If map is of the form 'Levels/MP_001' and 'Levels/MP_001' is a supported level for the current game mod, then this level is loaded. In other cases, this method assumes it is given a 'easy map name' (like 'Port Valdez') and it will do its best to find the leve... | def changeMap(self, map): """Change to the given map/level If map is of the form 'Levels/MP_001' and 'Levels/MP_001' is a supported level for the current game mod, then this level is loaded. In other cases, this method assumes it is given a 'easy map name' (like 'Port Valdez') and it will do its best to find the leve... | 446,631 |
def changeMap(self, map): """Change to the given map/level If map is of the form 'Levels/MP_001' and 'Levels/MP_001' is a supported level for the current game mod, then this level is loaded. In other cases, this method assumes it is given a 'easy map name' (like 'Port Valdez') and it will do its best to find the leve... | def changeMap(self, map): """Change to the given map/levelIf map is of the form 'Levels/MP_001' and 'Levels/MP_001' is a supported level for the current game mod, then this level is loaded.In other cases, this method assumes it is given a 'easy map name' (like 'Port Valdez') and it will do its best to find the level na... | 446,632 |
def restoreMapList(self, list): self.write(('mapList.clear',)) for l in list: self.write(('mapList.append', l)) self.write(('mapList.save',)) | 446,633 | |
def getEasyName(self, mapname): """ Change levelname to real name """ if mapname == 'Levels/MP_001': return ('Panama Canal') elif mapname == 'Levels/MP_002': return ('Valparaiso') | def getEasyName(self, mapname): """ Change levelname to real name """ if mapname.startswith('Levels/MP_001'): return 'Panama Canal' elif mapname == 'Levels/MP_002': return ('Valparaiso') | 446,634 |
def getEasyName(self, mapname): """ Change levelname to real name """ if mapname == 'Levels/MP_001': return ('Panama Canal') elif mapname == 'Levels/MP_002': return ('Valparaiso') | def getEasyName(self, mapname): """ Change levelname to real name """ if mapname == 'Levels/MP_001': return ('Panama Canal') elif mapname == 'Levels/MP_002': return ('Valparaiso') | 446,635 |
def getMaps(self): """Return the map list TODO""" data = self.write(('mapList.list',)) mapList = [] for index in range(0,len(data)): mapList[index] = self.getEasyName(data[index]) return mapList | def getMaps(self): """Return the map list TODO""" data = self.write(('mapList.list',)) mapList = [] for map in data: mapList.append(self.getEasyName(map)) return mapList | 446,636 |
def startup(self): # add specific events self.Events.createEvent('EVT_PUNKBUSTER_SCHEDULED_TASK', 'PunkBuster scheduled task') self.Events.createEvent('EVT_PUNKBUSTER_LOST_PLAYER', 'PunkBuster client connection lost') if self.config.has_option('server', 'punkbuster') and self.config.getboolean('server', 'punkbuster')... | def startup(self): # add specific events self.Events.createEvent('EVT_PUNKBUSTER_SCHEDULED_TASK', 'PunkBuster scheduled task') self.Events.createEvent('EVT_PUNKBUSTER_LOST_PLAYER', 'PunkBuster client connection lost') if self.config.has_option('server', 'punkbuster') and self.config.getboolean('server', 'punkbuster')... | 446,637 |
def startup(self): # add specific events self.Events.createEvent('EVT_PUNKBUSTER_SCHEDULED_TASK', 'PunkBuster scheduled task') self.Events.createEvent('EVT_PUNKBUSTER_LOST_PLAYER', 'PunkBuster client connection lost') if self.config.has_option('server', 'punkbuster') and self.config.getboolean('server', 'punkbuster')... | def startup(self): # add specific events self.Events.createEvent('EVT_PUNKBUSTER_SCHEDULED_TASK', 'PunkBuster scheduled task') self.Events.createEvent('EVT_PUNKBUSTER_LOST_PLAYER', 'PunkBuster client connection lost') if self.config.has_option('server', 'punkbuster') and self.config.getboolean('server', 'punkbuster')... | 446,638 |
def OnPBLostConnection(self, match, data): """PB notifies us it lost track of a player. This is the only change we have to save the ip of clients. This event is triggered after the OnPlayerLeave, so normaly the client is not connected. Anyway our task here is to save data into db not to connect/disconnect the client ""... | def OnPBLostConnection(self, match, data): """PB notifies us it lost track of a player. This is the only change we have to save the ip of clients. This event is triggered after the OnPlayerLeave, so normaly the client is not connected. Anyway our task here is to save data into db not to connect/disconnect the client ""... | 446,639 |
def getClient(self, cid): """Get a connected client from storage or create it B3 CID <--> BFBC2 character name B3 GUID <--> BFBC2 EA_guid """ # try to get the client from the storage of already authed clients client = self.clients.getByCID(cid) if not client: if cid == 'Server': return self.clients.newClient('Serve... | def getClient(self, cid): """Get a connected client from storage or create it B3 CID <--> BFBC2 character name B3 GUID <--> BFBC2 EA_guid """ # try to get the client from the storage of already authed clients client = self.clients.getByCID(cid) if not client: if cid == 'Server': return self.clients.newClient('Serve... | 446,640 |
def length(self): if self.value == None: return 0 | def length(self): if self.value == None: return 0 | 446,641 |
def __init__(self, **kwargs): self._pluginData = {} self.state = b3.STATE_UNKNOWN self._data = {} self.messagequeue = Queue.Queue() self.messagehandler = threading.Thread(target=self.messagequeueworker) self.messagehandler.setDaemon(True) self.messagehandler.start() | def __init__(self, **kwargs): self._pluginData = {} self.state = b3.STATE_UNKNOWN self._data = {} self.messagequeue = Queue.Queue() self.messagehandler = threading.Thread(target=self.messagequeueworker) self.messagehandler.setDaemon(True) self.messagehandler.start() | 446,642 |
def messagequeueworker(self): while True: msg = self.messagequeue.get() for line in self.console.getWrap(msg, self.console._settings['line_length'], self.console._settings['min_wrap_length']): self.console.message(self, line) time.sleep(self.console._settings['message_delay']) self.messagequeue.task_done() | def messagequeueworker(self): while True: msg = self.messagequeue.get() for line in self.console.getWrap(msg, self.console._settings['line_length'], self.console._settings['min_wrap_length']): self.console.message(self, line) time.sleep(self.console._settings['message_delay']) self.messagequeue.task_done() | 446,643 |
def message(self, msg): self.messagequeue.put(msg) | def message(self, msg): self.messagequeue.put(msg) | 446,644 |
def __init__(self, config=None): if config: self._config = config if self.getB3Path() != "": self._config = self.getB3Path() + "\\conf\\b3.xml" print self._config self.introduction() self.clearscreen() self._outputFile = self.raw_default("Location and name of the configfile", self._config) #Creating Backup self.backupF... | def __init__(self, config=None): if config: self._config = config elif self.getB3Path() != "": self._config = self.getB3Path() + "\\conf\\b3.xml" print self._config self.introduction() self.clearscreen() self._outputFile = self.raw_default("Location and name of the configfile", self._config) #Creating Backup self.backu... | 446,645 |
def unban(self, client, reason='', admin=None, silent=False, *kwargs): if self.PunkBuster: if client.pbid: result = self.PunkBuster.unBanGUID(client) | def unban(self, client, reason='', admin=None, silent=False, *kwargs): if self.PunkBuster: if client.pbid: result = self.PunkBuster.unBanGUID(client) | 446,646 |
def unban(self, client, reason='', admin=None, silent=False, *kwargs): if self.PunkBuster: if client.pbid: result = self.PunkBuster.unBanGUID(client) | def unban(self, client, reason='', admin=None, silent=False, *kwargs): if self.PunkBuster: if client.pbid: result = self.PunkBuster.unBanGUID(client) | 446,647 |
def unban(self, client, reason='', admin=None, silent=False, *kwargs): if self.PunkBuster: if client.pbid: result = self.PunkBuster.unBanGUID(client) | def unban(self, client, reason='', admin=None, silent=False, *kwargs): if self.PunkBuster: if client.pbid: result = self.PunkBuster.unBanGUID(client) | 446,648 |
def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return name = self.stripColors(match.group('name')) cid = int(match.group('cid')) client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return name = self.stripColors(match.group('name')) cid = int(match.group('cid')) client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,649 |
def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele if match is None: return name = self.stripColors(match.group('name')) cid = int(match.group('cid')) client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele if match is None: return name = self.stripColors(match.group('name')) cid = int(match.group('cid')) client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,650 |
def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | 446,651 |
def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return name = self.stripColors(match.group('name')) cid = int(match.group('cid')) client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSay(self, action, data, match=None): #3:53 say: 8 denzel: lol if match is None: return name = self.stripColors(match.group('name')) cid = int(match.group('cid')) client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,652 |
def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele if match is None: return name = self.stripColors(match.group('name')) cid = int(match.group('cid')) client = self.getByCidOrJoinPlayer(match.group('cid')) | def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele if match is None: return name = self.stripColors(match.group('name')) cid = int(match.group('cid')) client = self.getByCidOrJoinPlayer(match.group('cid')) | 446,653 |
def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | def OnSaytell(self, action, data, match=None): #5:39 saytell: 15 16 repelSteeltje: nno #5:39 saytell: 15 15 repelSteeltje: nno | 446,654 |
def getWrap(self, text, length=100, minWrapLen=100): """Returns a sequence of lines for text that fits within the limits """ if not text: return [] maxLength = int(length) if len(text) <= maxLength: return [text] else: lines = [text[:maxLength]] remaining = text[maxLength:] while len(remaining) > 0: lines.append(rema... | def getWrap(self, text, length=SAY_LINE_MAX_LENGTH, minWrapLen=SAY_LINE_MAX_LENGTH): """Returns a sequence of lines for text that fits within the limits """ if not text: return [] maxLength = int(length) if len(text) <= maxLength: return [text] else: lines = [text[:maxLength]] remaining = text[maxLength:] while len(r... | 446,655 |
def startup(self): | def startup(self): | 446,656 |
def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | def display: none; } getHtml(self): display: none; } cssstyle display: none; } = display: none; } """ display: none; } #b3commands display: none; } { display: none; } border-collapse: display: none; } collapse; display: none; } } display: none; } display: none; } #b3commands display: none; } th, display: none; } #b3co... | 446,657 |
def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | 446,658 |
def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | 446,659 |
def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | 446,660 |
def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | def//]]> getHtml(self)://]]> cssstyle//]]> =//]]> """//]]> #b3commands//]]> {//]]> border-collapse://]]> collapse;//]]> }//]]> //]]> #b3commands//]]> th,//]]> #b3commands//]]> td//]]> {//]]> font-family://]]> arial;//]]> border://]]> 2px//]]> solid//]]> black;//]]> padding://]]> 5px;//]]> }//]]> //]]> #b3commands//]]> ... | 446,661 |
def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | def getHtml(self): cssstyle = """ #b3commands { border-collapse: collapse; } #b3commands th, #b3commands td { font-family: arial; border: 2px solid black; padding: 5px; } #b3commands th { font-weight: bold; background-color: lightgray; text-transform: capitalize; } #b3commands td { font-size: 12px; } | 446,662 |
def getHtmlTable(self): text = """ <table id="b3commands"> <thead> <tr><th>plugin</th><th>min level</th><th>max level</th><th>command</th><th>alias</th><th>description</th></tr> </thead> <tbody> %(commandsTablerow)s </tbody> </table> """ def friendlyLevel(level): try: intlevel = int(level) if intlevel <= 0: return '<s... | def getHtmlTable(self): text = """ <table id="b3commands"> <thead> <tr> <th class="b3Plugin">plugin</th> <th class="b3MinLevel">min level</th> <th class="b3MaxLevel">max level</th> <th class="b3Name">command</th> <th class="b3Alias">alias</th> <th class="b3Desc">description</th> </tr> </thead> <tbody> %(commandsTablero... | 446,663 |
def _getCommandsDict(self): if self._maxlevel is not None: self._console.debug('AUTODOC: get commands with level <= %s' % self._maxlevel) seenCommands = set() commands = [] for cmd in self._adminPlugin._commands.values(): if cmd in seenCommands or \ cmd.level is None: continue if self._maxlevel is not None and cmd.leve... | def _getCommandsDict(self): if self._maxlevel is not None: self._console.debug('AUTODOC: get commands with level <= %s' % self._maxlevel) commands = [] for cmd in self._adminPlugin._commands.values(): if cmd in seenCommands or \ cmd.level is None: continue if self._maxlevel is not None and cmd.level[0] > self._maxlevel... | 446,664 |
def _getCommandsDict(self): if self._maxlevel is not None: self._console.debug('AUTODOC: get commands with level <= %s' % self._maxlevel) seenCommands = set() commands = [] for cmd in self._adminPlugin._commands.values(): if cmd in seenCommands or \ cmd.level is None: continue if self._maxlevel is not None and cmd.leve... | def _getCommandsDict(self): if self._maxlevel is not None: self._console.debug('AUTODOC: get commands with level <= %s' % self._maxlevel) seenCommands = set() commands = [] for cmd in self._adminPlugin._commands.values(): if cmd in commands or \ cmd.level is None: continue if self._maxlevel is not None and cmd.level[0]... | 446,665 |
def _getCommandsDict(self): if self._maxlevel is not None: self._console.debug('AUTODOC: get commands with level <= %s' % self._maxlevel) seenCommands = set() commands = [] for cmd in self._adminPlugin._commands.values(): if cmd in seenCommands or \ cmd.level is None: continue if self._maxlevel is not None and cmd.leve... | def _getCommandsDict(self): if self._maxlevel is not None: self._console.debug('AUTODOC: get commands with level <= %s' % self._maxlevel) seenCommands = set() commands = [] for cmd in self._adminPlugin._commands.values(): if cmd in seenCommands or \ cmd.level is None: continue if self._maxlevel is not None and cmd.leve... | 446,666 |
def isunicode(text): # FIXME: rewrite this stupid hack to support other languages alphabet1 = range(ord(u'а'), ord(u'я')) alphabet2 = range(ord(u'А'), ord(u'Я')) uni = False for i in text: letter = ord(i) if letter in alphabet1 or letter in alphabet2: uni = True return uni | def isunicode(text): # FIXME: rewrite this stupid hack to support other languagestry: text.encode(CHARSET) return True except UnicodeEncodeError: return False | 446,667 |
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | 446,668 |
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | 446,669 |
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | 446,670 |
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | 446,671 |
def anti_obusfaction(text): shit = list(re.search(r"&#([0-9]{2}?);", text).groups()) for i in range(len(shit)): shit[i] = int(shit[i]) - 48 # replacing "&#[two digits number];" with "[number - 48]" out = "" i = 0 while i < len(text): if i + 3 < len(text) and text[i] == "&" and text[i+1] == "#": for j in str(shit.pop(0... | def anti_obusfaction(text): shit = list(re.search(r"&#([0-9]{2}?);", text).groups()) for i in range(len(shit)): shit[i] = int(shit[i]) - 48 # replacing "&#[two digits number];" with "[number - 48]" out = "" i = 0 while i < len(text): if i + 3 < len(text) and text[i] == "&" and text[i+1] == "#": for j in str(shit.pop(0... | 446,672 |
def anti_obusfaction(text): shit = list(re.search(r"&#([0-9]{2}?);", text).groups()) for i in range(len(shit)): shit[i] = int(shit[i]) - 48 # replacing "&#[two digits number];" with "[number - 48]" out = "" i = 0 while i < len(text): if i + 3 < len(text) and text[i] == "&" and text[i+1] == "#": for j in str(shit.pop(0... | def anti_obusfaction(text): shit = list(re.search(r"&#([0-9]{2}?);", text).groups()) for i in range(len(shit)): shit[i] = int(shit[i]) - 48 # replacing "&#[two digits number];" with "[number - 48]" out = "" i = 0 while i < len(text): if i + 3 < len(text) and text[i] == "&" and text[i+1] == "#": for j in str(shit.pop(0... | 446,673 |
def anti_obusfaction(text): shit = list(re.search(r"&#([0-9]{2}?);", text).groups()) for i in range(len(shit)): shit[i] = int(shit[i]) - 48 # replacing "&#[two digits number];" with "[number - 48]" out = "" i = 0 while i < len(text): if i + 3 < len(text) and text[i] == "&" and text[i+1] == "#": for j in str(shit.pop(0... | def anti_obusfaction(text): shit = list(re.search(r"&#([0-9]{2}?);", text).groups()) for i in range(len(shit)): shit[i] = int(shit[i]) - 48 # replacing "&#[two digits number];" with "[number - 48]" out = "" i = 0 while i < len(text): if i + 3 < len(text) and text[i] == "&" and text[i+1] == "#": for j in str(shit.pop(0... | 446,674 |
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] print(path) | def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] print(path) | 446,675 |
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] print(path) | def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] print(path) | 446,676 |
def daemonize(): #os.chdir("/") #os.umask(0) #os.setsid() pid = os.fork() if pid > 0: sys.exit(0) # exit second parent #sys.stdin.close() #sys.stdout.close() #sys.stderr.close() log = open(LOG, "a+") ##os.dup2(log.fileno(), sys.stdin.fileno()) os.dup2(log.fileno(), sys.stdout.fileno()) os.dup2(log.fileno(), sys.stder... | def daemonize(): #os.chdir("/") #os.umask(0) #os.setsid() pid = os.fork() if pid > 0: sys.exit(0) # exit second parent #sys.stdin.close() #sys.stdout.close() #sys.stderr.close() log = open(LOG, "a+") ##os.dup2(log.fileno(), sys.stdin.fileno()) os.dup2(log.fileno(), sys.stdout.fileno()) os.dup2(log.fileno(), sys.stder... | 446,677 |
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] | def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] | 446,678 |
def request_text(): page = urllib.request.urlopen("http://www.novgorod.ru/temperature/").read() page = page.decode("cp1251").split("\n") return page[page.index("<LI class=\"first\">Сейчас: <b>") + 1] | def request_text(): page = urllib.request.urlopen("http://www.novgorod.ru/temperature/").read() lines = page.decode("cp1251").split("\n") return lines[lines.index("<LI class=\"first\">Сейчас: <b>") + 1] | 446,679 |
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors | 446,680 |
def isEmbedded(self, name): return ( name == 'embedded_data' or name == 'embedded_data_byte' ) | def isEmbedded(self, name): return ( name == 'embedded_data' or name == 'embedded_data_byte' ) | 446,681 |
def Tag_attr_ubyte(self): new_tag = unpack('B', self.data[self.index])[0] | def Tag_attr_ubyte(self): new_tag = unpack('B', self.data[self.index])[0] | 446,682 |
def singleValueType(self): if ( self.Tag_ubyte() or self.Tag_uint16() or self.Tag_uint32() or \ self.Tag_sint16() or self.Tag_sint32() or self.Tag_real32() ): size = self.size_of_element if ( self.unpack_string == 'f' ): print "%f" % self.unpack(self.unpack_string, self.data[self.index:self.index+size]), else: print "%... | def singleValueType(self): if ( self.Tag_ubyte() or self.Tag_uint16() or self.Tag_uint32() or \ self.Tag_sint16() or self.Tag_sint32() or self.Tag_real32() ): size = self.size_of_element if ( self.unpack_string == 'f' ): print "%f" % self.unpack(self.unpack_string, self.data[self.index:self.index+size]), else: print "%... | 446,683 |
def _readheader(self, inStream): """ Read in a header in some CBF format from a string representing the binary stuff @param inStream: the binary image (without any CIF decorators) @type inStream: python string. """ sep = "\r\n" iSepPos = inStream.find(sep) if iSepPos < 0 or iSepPos > 80: sep = "\n" #switch back to unix... | def _readheader(self, inStream): """ Read in a header in some CBF format from a string representing binary stuff @param inStream: the binary image (without any CIF decorators) @type inStream: python string. """ sep = "\r\n" iSepPos = inStream.find(sep) if iSepPos < 0 or iSepPos > 80: sep = "\n" #switch back to unix re... | 446,684 |
def analyse(stream): """ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers) | def analyse(stream): """ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers) | 446,685 |
def analyse(stream): """ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers) | def analyse(stream): """ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers) | 446,686 |
def analyse(stream): """ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers) | def analyse(stream): """ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers) | 446,687 |
def analyse(stream): """ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers) | def analyse(stream): """ Analyze a stream of char with any length of exception (2,4, or 8 bytes integers) | 446,688 |
def read(self, fname): """ Read in header into self.header and the data into self.data """ self.filename = fname self.header = {} self.resetvals() self.cif.loadCIF(fname, _bKeepComment=True) | def read(self, fname): """ Read in header into self.header and the data into self.data """ self.filename = fname self.header = {} self.resetvals() self.cif.loadCIF(fname, _bKeepComment=True) | 446,689 |
def loadCIF(self, _strFilename, _bKeepComment=False): """Load the CIF file and returns the CIF dictionnary into the object @param _strFilename: the name of the file to open @type _strFilename: string @param _strFilename: the name of the file to open @type _strFilename: string @return the """ if not os.path.isfile(_st... | def loadCIF(self, _strFilename, _bKeepComment=False): """Load the CIF file and returns the CIF dictionnary into the object @param _strFilename: the name of the file to open @type _strFilename: string @param _strFilename: the name of the file to open @type _strFilename: string @return the """ if not os.path.isfile(_st... | 446,690 |
def _readCIF(_strFilename): """ -Check if the filename containing the CIF data exists -read the cif file -removes the comments @param _strFilename: the name of the CIF file @type _strFilename: string @return: a string containing the raw data @rtype: string """ if not os.path.isfile(_strFilename): print "I cannot find ... | def _readCIF(_strFilename): """ -Check if the filename containing the CIF data exists -read the cif file -removes the comments @param _strFilename: the name of the CIF file @type _strFilename: string @return: a string containing the raw data @rtype: string """ if not os.path.isfile(_strFilename): print "I cannot find ... | 446,691 |
def _readCIF(_strFilename): """ -Check if the filename containing the CIF data exists -read the cif file -removes the comments @param _strFilename: the name of the CIF file @type _strFilename: string @return: a string containing the raw data @rtype: string """ if not os.path.isfile(_strFilename): print "I cannot find ... | def _readCIF(_strFilename): """ -Check if the filename containing the CIF data exists -read the cif file -removes the comments @param _strFilename: the name of the CIF file @type _strFilename: string @return: a string containing the raw data @rtype: string """ if not os.path.isfile(_strFilename): print "I cannot find ... | 446,692 |
def _readCIF(_strFilename): """ -Check if the filename containing the CIF data exists -read the cif file -removes the comments @param _strFilename: the name of the CIF file @type _strFilename: string @return: a string containing the raw data @rtype: string """ if not os.path.isfile(_strFilename): print "I cannot find ... | def _readCIF(_strFilename): """ -Check if the filename containing the CIF data exists -read the cif file -removes the comments @param _strFilename: the name of the CIF file @type _strFilename: string @return: a string containing the raw data @rtype: string """ if not os.path.isfile(_strFilename): print "I cannot find ... | 446,693 |
def _readCIF(_strFilename): """ -Check if the filename containing the CIF data exists -read the cif file -removes the comments @param _strFilename: the name of the CIF file @type _strFilename: string @return: a string containing the raw data @rtype: string """ if not os.path.isfile(_strFilename): print "I cannot find ... | def _readCIF(_strFilename): """ -Check if the filename containing the CIF data exists -read the cif file -removes the comments @param _strFilename: the name of the CIF file @type _strFilename: string @return: a string containing the raw data @rtype: string """ if not os.path.isfile(_strFilename): print "I cannot find ... | 446,694 |
def _parseCIF(self, sText): """ -Parses the text of a CIF file -Cut it in fields -Find all the loops and process -Find all the keys and values @param sText: the content of the CIF-file @type sText: string @return: Nothing, the data are incorporated at the CIF object dictionnary @rtype: dictionnary """ loopidx = [] loo... | def _parseCIF(self, sText): """ -Parses the text of a CIF file -Cut it in fields -Find all the loops and process -Find all the keys and values @param sText: the content of the CIF-file @type sText: string @return: Nothing, the data are incorporated at the CIF object dictionary @rtype: dictionary """ loopidx = [] loopl... | 446,695 |
def _analyseOneLoop(lFields, iStart): """Processes one loop in the data extraction of the CIF file @param lFields: list of all the words contained in the cif file @type lFields: list @param iStart: the starting index corresponding to the "loop_" key @type iStart: integer @return: the list of loop dictionnaries, the len... | def _analyseOneLoop(lFields, iStart): """Processes one loop in the data extraction of the CIF file @param lFields: list of all the words contained in the cif file @type lFields: list @param iStart: the starting index corresponding to the "loop_" key @type iStart: integer @return: the list of loop dictionaries, the leng... | 446,696 |
def saveCIF(self, _strFilename="test.cif"): """Transforms the CIF object in string then write it into the given file @param _strFilename: the of the file to be written @type param: string """ | def saveCIF(self, _strFilename="test.cif"): """Transforms the CIF object in string then write it into the given file @param _strFilename: the of the file to be written @type param: string """ | 446,697 |
def saveCIF(self, _strFilename="test.cif"): """Transforms the CIF object in string then write it into the given file @param _strFilename: the of the file to be written @type param: string """ | def saveCIF(self, _strFilename="test.cif"): """Transforms the CIF object in string then write it into the given file @param _strFilename: the of the file to be written @type param: string """ | 446,698 |
def saveCIF(self, _strFilename="test.cif"): """Transforms the CIF object in string then write it into the given file @param _strFilename: the of the file to be written @type param: string """ | def saveCIF(self, _strFilename="test.cif"): """Transforms the CIF object in string then write it into the given file @param _strFilename: the of the file to be written @type param: string """ | 446,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.