bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,500 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,501 |
def __str__(self): return 'table=%d requests=%d outstanding=%d completed=%d callback=%s(%s)' % \ (self.table.tableid, len(self.requests), self.outstanding, self.completed, self.callbackMethod, ','.join([str(x) for x in self.__callbackArgs] if self.__callbackArgs else '')) | def __str__(self): return 'table=%d %s requests=%d outstanding=%d completed=%d callback=%s(%s)' % \ (self.table.tableid, self.calledBy, len(self.requests), self.outstanding, self.completed, self.callbackMethod, ','.join([str(x) for x in self.__callbackArgs] if self.__callbackArgs else '')) | 457,502 |
def add(self, deferred, player): """add deferred for player to this block""" assert not self.callbackMethod assert not self.completed request = Request(deferred, player) self.requests.append(request) self.outstanding += 1 deferred.addCallback(self.__gotAnswer, request).addErrback(self.__failed, request) | def __addRequest(self, deferred, player): """add deferred for player to this block""" assert not self.callbackMethod assert not self.completed request = Request(deferred, player) self.requests.append(request) self.outstanding += 1 deferred.addCallback(self.__gotAnswer, request).addErrback(self.__failed, request) | 457,503 |
def tell(self, about, receivers, command, **kwargs): """send info about player 'about' to players 'receivers'""" if not isinstance(receivers, list): receivers = list([receivers]) assert receivers, 'DeferredBlock.tell(%s) has no receiver % command' game = self.table.game or self.table.preparedGame aboutName = about.name... | def tell(self, about, receivers, command, **kwargs): """send info about player 'about' to players 'receivers'""" if not isinstance(receivers, list): receivers = list([receivers]) assert receivers, 'DeferredBlock.tell(%s) has no receiver % command' game = self.table.game or self.table.preparedGame aboutName = about.name... | 457,504 |
def data(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::data() """ # Invalid index should return an invalid qvariant assert( not self.model.data(QtCore.QModelIndex(), QtCore.Qt.DisplayRole).isValid()) | def data(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::data() """ # Invalid index should return an invalid qvariant assert( not self.model.data(QtCore.QModelIndex(), QtCore.Qt.DisplayRole).isValid()) | 457,505 |
def rowsAboutToBeInserted(self, parent, start, end): """ Store what is about to be inserted to make sure it actually happens """ c = {} c['parent'] = parent c['oldSize'] = self.model.rowCount(parent) c['last'] = self.model.data(model.index(start-1, 0, parent)) c['next'] = self.model.data(model.index(start, 0, parent)) ... | def rowsAboutToBeInserted(self, parent, start, end): """ Store what is about to be inserted to make sure it actually happens """ c = {} c['parent'] = parent c['oldSize'] = self.model.rowCount(parent) c['last'] = self.model.data(model.index(start-1, 0, parent)) c['next'] = self.model.data(model.index(start, 0, parent)) ... | 457,506 |
def rowsInserted(self, parent, start, end): """ Confirm that what was said was going to happen actually did """ c = insert.pop() assert(c['parent'] == parent) assert(c['oldSize'] + (end - start + 1) == self.model.rowCount(parent)) assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) | def rowsInserted(self, parent, start, end): """ Confirm that what was said was going to happen actually did """ c = self.insert.pop() assert(c['parent'] == parent) assert(c['oldSize'] + (end - start + 1) == self.model.rowCount(parent)) assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) | 457,507 |
def rowsInserted(self, parent, start, end): """ Confirm that what was said was going to happen actually did """ c = insert.pop() assert(c['parent'] == parent) assert(c['oldSize'] + (end - start + 1) == self.model.rowCount(parent)) assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) | def rowsInserted(self, parent, start, end): """ Confirm that what was said was going to happen actually did """ c = insert.pop() assert(c['parent'] == parent) assert(c['oldSize'] + (end - start + 1) == self.model.rowCount(parent)) assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) | 457,508 |
def rowsAboutToBeRemoved(self, parent, start, end): """ Store what is about to be inserted to make sure it actually happens """ c = {} c['parent'] = parent c['oldSize'] = self.model.rowCount(parent) c['last'] = self.model.data(model.index(start-1, 0, parent)) c['next'] = self.model.data(model.index(end+1, 0, parent)) r... | def rowsAboutToBeRemoved(self, parent, start, end): """ Store what is about to be inserted to make sure it actually happens """ c = {} c['parent'] = parent c['oldSize'] = self.model.rowCount(parent) c['last'] = self.model.data(model.index(start-1, 0, parent)) c['next'] = self.model.data(model.index(end+1, 0, parent)) r... | 457,509 |
def rowsRemoved(self, parent, start, end): """ Confirm that what was said was going to happen actually did """ c = remove.pop() assert(c['parent'] == parent) assert(c['oldSize'] - (end - start + 1) == self.model.rowCount(parent)) assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) assert(c['next'... | def rowsRemoved(self, parent, start, end): """ Confirm that what was said was going to happen actually did """ c = self.remove.pop() assert(c['parent'] == parent) assert(c['oldSize'] - (end - start + 1) == self.model.rowCount(parent)) assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) assert(c['... | 457,510 |
def rowsRemoved(self, parent, start, end): """ Confirm that what was said was going to happen actually did """ c = remove.pop() assert(c['parent'] == parent) assert(c['oldSize'] - (end - start + 1) == self.model.rowCount(parent)) assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) assert(c['next'... | def rowsRemoved(self, parent, start, end): """ Confirm that what was said was going to happen actually did """ c = remove.pop() assert(c['parent'] == parent) assert(c['oldSize'] - (end - start + 1) == self.model.rowCount(parent)) assert(c['last'] == self.model.data(model.index(start-1, 0, c['parent']))) assert(c['next'... | 457,511 |
def speak(what): """this is what the user of this module will call.""" print 'speak:', what if not Sound.enabled: print 'no sound enabled' return if Sound.__hasogg123 is None: if not which('ogg123'): print 'no ogg123' Sound.enabled = False # checks again at next reenable logWarning(m18n('No voices will be heard because... | def speak(what): """this is what the user of this module will call.""" if not Sound.enabled: print 'no sound enabled' return if Sound.__hasogg123 is None: if not which('ogg123'): print 'no ogg123' Sound.enabled = False # checks again at next reenable logWarning(m18n('No voices will be heard because the program ogg123 i... | 457,512 |
def speak(what): """this is what the user of this module will call.""" print 'speak:', what if not Sound.enabled: print 'no sound enabled' return if Sound.__hasogg123 is None: if not which('ogg123'): print 'no ogg123' Sound.enabled = False # checks again at next reenable logWarning(m18n('No voices will be heard because... | def speak(what): """this is what the user of this module will call.""" print 'speak:', what if not Sound.enabled: return if Sound.__hasogg123 is None: if not which('ogg123'): print 'no ogg123' Sound.enabled = False # checks again at next reenable logWarning(m18n('No voices will be heard because the program ogg123 is mi... | 457,513 |
def speak(what): """this is what the user of this module will call.""" print 'speak:', what if not Sound.enabled: print 'no sound enabled' return if Sound.__hasogg123 is None: if not which('ogg123'): print 'no ogg123' Sound.enabled = False # checks again at next reenable logWarning(m18n('No voices will be heard because... | def speak(what): """this is what the user of this module will call.""" print 'speak:', what if not Sound.enabled: print 'no sound enabled' return if Sound.__hasogg123 is None: if not which('ogg123'): Sound.enabled = False # checks again at next reenable logWarning(m18n('No voices will be heard because the program ogg12... | 457,514 |
def startLocalServer(): """start a local server""" try: HumanClient.serverProcess = subprocess.Popen(['kajonggserver']) syslogMessage(m18n('started the local kajongg server: pid=%d') % HumanClient.serverProcess.pid) except Exception as exc: logException(exc) | def startLocalServer(): """start a local server""" try: HumanClient.serverProcess = subprocess.Popen(['kajonggserver']) syslogMessage(m18n('started the local kajongg server: pid=<numid>%1</numid>', HumanClient.serverProcess.pid)) except Exception as exc: logException(exc) | 457,515 |
def stopLocalServer(): if HumanClient.serverProcess: syslogMessage(m18n('stopped the local kajongg server: pid=%d') % HumanClient.serverProcess.pid) HumanClient.serverProcess.kill() HumanClient.serverProcess = None | def stopLocalServer(): if HumanClient.serverProcess: syslogMessage(m18n('stopped the local kajongg server: pid=<numid>%1</numid>', HumanClient.serverProcess.pid)) HumanClient.serverProcess.kill() HumanClient.serverProcess = None | 457,516 |
def sorry(dummy, *args): """just output to stdout""" print ' '.join(args) | def sorry(dummy, *args): """just output to stdout""" print ' '.join(args) | 457,517 |
def updateCurrentTime(self, value): self.steps += 1 QParallelAnimationGroup.updateCurrentTime(self, value) | def updateCurrentTime(self, value): self.steps += 1 QParallelAnimationGroup.updateCurrentTime(self, value) | 457,518 |
def __init__(self): self.appName = str("kajongg") self.catalog = str('') self.homePage = str('http://www.kde-apps.org/content/show.php/kajongg?content=103206') self.bugEmail = str('wolfgang@rohdewald.de') self.version = str('0.4.0') self.programName = ki18n ("Kajongg") self.description = ki18n ("Mah J... | def __init__(self): self.appName = str("kajongg") self.catalog = str('0') self.homePage = str('http://www.kde-apps.org/content/show.php/kajongg?content=103206') self.bugEmail = str('wolfgang@rohdewald.de') self.version = str('0.4.0') self.programName = ki18n ("Kajongg") self.description = ki18n ("Mah ... | 457,519 |
def __init__(self): self.appName = str("kajongg") self.catalog = str('') self.homePage = str('http://www.kde-apps.org/content/show.php/kajongg?content=103206') self.bugEmail = str('wolfgang@rohdewald.de') self.version = str('0.4.0') self.programName = ki18n ("Kajongg") self.description = ki18n ("Mah J... | def __init__(self): self.appName = str("kajongg") self.catalog = str('') self.homePage = str('http://www.kde-apps.org/content/show.php/kajongg?content=103206') self.version = str('0.4.0') self.programName = ki18n ("Kajongg") self.description = ki18n ("Mah Jongg - the ancient Chinese board game for 4 play... | 457,520 |
def __init__(self): self.appName = str("kajongg") self.catalog = str('') self.homePage = str('http://www.kde-apps.org/content/show.php/kajongg?content=103206') self.bugEmail = str('wolfgang@rohdewald.de') self.version = str('0.4.0') self.programName = ki18n ("Kajongg") self.description = ki18n ("Mah J... | def __init__(self): self.appName = str("kajongg") self.catalog = str('') self.homePage = str('http://www.kde-apps.org/content/show.php/kajongg?content=103206') self.bugEmail = str('wolfgang@rohdewald.de') self.version = str('0.4.0') self.programName = ki18n ("Kajongg") self.description = ki18n ("Mah J... | 457,521 |
def __radd__(self, other): """allows sum() to work""" if isinstance(other, Score): return self.__add__(self, other) else: self.points += other return self | def __radd__(self, other): """allows sum() to work""" if isinstance(other, Score): return self.__add__(self, other) else: self.points += other return self | 457,522 |
def testScoring(): """some simple tests""" testScore = Score(points=3) testScore.unit = 1 assert testScore.doubles == 3 assert testScore.value == 3 sc1 = Score(points=10, limitPoints=500) sc2 = Score(limits=1, limitPoints=500) assert int(sc1) == 10 assert int(sc2) == 500 scsum = sc1 + sc2 assert isinstance(scsum, Scor... | def testScoring(): """some simple tests""" testScore = Score(points=3) testScore.unit = 1 assert testScore.doubles == 3 assert testScore.value == 3 sc1 = Score(points=10, limitPoints=500) sc2 = Score(limits=1, limitPoints=500) assert int(sc1) == 10 assert int(sc2) == 500 assert isinstance(scsum, Score) assert int(scsu... | 457,523 |
def callRemote(self, user, *args, **kwargs): """if we still have a connection, call remote, otherwise clean up""" legalTypes = (int, long, basestring, float, list, type(None)) for arg in args: if not isinstance(arg, legalTypes): raise Exception('callRemote got illegal arg: %s %s' (arg, type(arg))) for keyword, arg in k... | def callRemote(self, user, *args, **kwargs): """if we still have a connection, call remote, otherwise clean up""" legalTypes = (int, long, basestring, float, list, type(None)) for arg in args: if not isinstance(arg, legalTypes): raise Exception('callRemote got illegal arg: %s %s' % (arg, type(arg))) for keyword, arg in... | 457,524 |
def callRemote(self, user, *args, **kwargs): """if we still have a connection, call remote, otherwise clean up""" legalTypes = (int, long, basestring, float, list, type(None)) for arg in args: if not isinstance(arg, legalTypes): raise Exception('callRemote got illegal arg: %s %s' (arg, type(arg))) for keyword, arg in k... | def callRemote(self, user, *args, **kwargs): """if we still have a connection, call remote, otherwise clean up""" legalTypes = (int, long, basestring, float, list, type(None)) for arg in args: if not isinstance(arg, legalTypes): raise Exception('callRemote got illegal arg: %s %s' (arg, type(arg))) for keyword, arg in k... | 457,525 |
def __init__(self, deferred, parent=None): QDialog.__init__(self, parent) self.setAttribute(Qt.WA_DeleteOnClose) self.deferred = deferred layout = QVBoxLayout(self) buttonBox = QDialogButtonBox() layout.addWidget(buttonBox) self.okButton = buttonBox.addButton(m18n("&Ready for next hand?"), QDialogButtonBox.AcceptRole) ... | def __init__(self, deferred, parent=None): QDialog.__init__(self, parent) self.setAttribute(Qt.WA_DeleteOnClose) self.deferred = deferred layout = QVBoxLayout(self) buttonBox = QDialogButtonBox() layout.addWidget(buttonBox) self.okButton = buttonBox.addButton(m18n("&Ready for next hand?"), QDialogButtonBox.AcceptRole) ... | 457,526 |
def claimTile(self, player, claim, meldTiles, nextMessage): """a player claims a tile for pung, kong or chow. meldTiles contains the claimed tile, concealed""" claimedTile = player.game.lastDiscard.element if player.game.lastDiscard else None hasTiles = meldTiles[:] concKong = claimedTile not in meldTiles if not concKo... | def claimTile(self, player, claim, meldTiles, nextMessage): """a player claims a tile for pung, kong or chow. meldTiles contains the claimed tile, concealed""" claimedTile = player.game.lastDiscard.element if player.game.lastDiscard else None hasTiles = meldTiles[:] concKong = claimedTile not in meldTiles if not concKo... | 457,527 |
def claimTile(self, player, claim, meldTiles, nextMessage): """a player claims a tile for pung, kong or chow. meldTiles contains the claimed tile, concealed""" claimedTile = player.game.lastDiscard.element if player.game.lastDiscard else None hasTiles = meldTiles[:] concKong = claimedTile not in meldTiles if not concKo... | def claimTile(self, player, claim, meldTiles, nextMessage): """a player claims a tile for pung, kong or chow. meldTiles contains the claimed tile, concealed""" claimedTile = player.game.lastDiscard.element if player.game.lastDiscard else None hasTiles = meldTiles[:] concKong = claimedTile not in meldTiles if not concKo... | 457,528 |
def claimMahJongg(self, msg): """a player claims mah jongg. Check this and if correct, tell all.""" player = msg.player concealedMelds, withDiscard, lastMeld = msg.args # pylint: disable=E1103 # (pylint ticket 8774) lastMove = self.game.lastMoves(without=[Message.PopupMsg]).next() robbedTheKong = lastMove.message == Me... | def claimMahJongg(self, msg): """a player claims mah jongg. Check this and if correct, tell all.""" player = msg.player concealedMelds, withDiscard, lastMeld = msg.args # pylint: disable=E1103 # (pylint ticket 8774) lastMove = self.game.lastMoves(without=[Message.PopupMsg]).next() robbedTheKong = lastMove.message == Me... | 457,529 |
def claimMahJongg(self, msg): """a player claims mah jongg. Check this and if correct, tell all.""" player = msg.player concealedMelds, withDiscard, lastMeld = msg.args # pylint: disable=E1103 # (pylint ticket 8774) lastMove = self.game.lastMoves(without=[Message.PopupMsg]).next() robbedTheKong = lastMove.message == Me... | def claimMahJongg(self, msg): """a player claims mah jongg. Check this and if correct, tell all.""" player = msg.player concealedMelds, withDiscard, lastMeld = msg.args # pylint: disable=E1103 # (pylint ticket 8774) lastMove = self.game.lastMoves(without=[Message.PopupMsg]).next() robbedTheKong = lastMove.message == Me... | 457,530 |
def testScoring(): """some simple tests""" testScore = Score(points=3) testScore.unit = 1 assert testScore.doubles == 3 assert testScore.value == 3 | def testScoring(): """some simple tests""" testScore = Score(points=3) testScore.unit = 1 assert testScore.doubles == 3 assert testScore.value == 3 | 457,531 |
def logWarning(msg, prio=syslog.LOG_WARNING, isServer=False): """writes info message to syslog and to stdout""" if isinstance(msg, Exception): msg = ' '.join(str(x) if isinstance(x, int) else x for x in msg.args) if isinstance(msg, str): msg = unicode(msg, 'utf-8') elif not isinstance(msg, unicode): msg = unicode(str(m... | def logWarning(msg, prio=syslog.LOG_WARNING, isServer=False): """writes info message to syslog and to stdout""" if isinstance(msg, Exception): msg = ' '.join(str(x) if isinstance(x, int, NoneType) else x for x in msg.args) if isinstance(msg, str): msg = unicode(msg, 'utf-8') elif not isinstance(msg, unicode): msg = uni... | 457,532 |
def __init__(self, name, definition, points = 0, doubles = 0, limits = 0, parameter = None): self.actions = {} self.variants = [] self.name = name self.score = Score(points, doubles, limits) self._definition = None self.prevDefinition = None self.parName = '' self.parameter = '' self.parType = None for parType in [int,... | def __init__(self, name, definition, points = 0, doubles = 0, limits = 0, parameter = None, debug=False): self.actions = {} self.variants = [] self.name = name self.score = Score(points, doubles, limits) self._definition = None self.prevDefinition = None self.parName = '' self.parameter = '' self.parType = None for par... | 457,533 |
def appliesToHand(self, hand, melds): """does the rule apply to this hand?""" result = any(variant.appliesToHand(hand, melds) for variant in self.variants) return result | def appliesToHand(self, hand, melds): """does the rule apply to this hand?""" result = any(variant.appliesToHand(hand, melds, self.debug) for variant in self.variants) return result | 457,534 |
def appliesToHand(self, hand, melds): """does this regex match?""" meldStr = melds if melds else '' if isinstance(self, RegexIgnoringCase): checkStr = meldStr.lower() + ' ' + hand.mjStr else: checkStr = meldStr + ' ' + hand.mjStr str2 = ' ,,, '.join((checkStr, checkStr)) if InternalParameters.profileRegex: self.timeSum... | def appliesToHand(self, hand, melds, debug=False): """does this regex match?""" meldStr = melds if melds else '' if isinstance(self, RegexIgnoringCase): checkStr = meldStr.lower() + ' ' + hand.mjStr else: checkStr = meldStr + ' ' + hand.mjStr str2 = ' ,,, '.join((checkStr, checkStr)) if InternalParameters.profileRegex:... | 457,535 |
def appliesToHand(self, hand, melds): """does this regex match?""" meldStr = melds if melds else '' if isinstance(self, RegexIgnoringCase): checkStr = meldStr.lower() + ' ' + hand.mjStr else: checkStr = meldStr + ' ' + hand.mjStr str2 = ' ,,, '.join((checkStr, checkStr)) if InternalParameters.profileRegex: self.timeSum... | def appliesToHand(self, hand, melds): """does this regex match?""" meldStr = melds if melds else '' if isinstance(self, RegexIgnoringCase): checkStr = meldStr.lower() + ' ' + hand.mjStr else: checkStr = meldStr + ' ' + hand.mjStr str2 = ' ,,, '.join((checkStr, checkStr)) if InternalParameters.profileRegex: self.timeSum... | 457,536 |
def robTile(self, tileName): """used for robbing the kong""" tileName = tileName.lower() for meld in self.exposedMelds: if tileName in meld.pairs: self.exposedMelds.remove(meld) state = meld.state newPairs = meld.pairs[:] newPairs.remove(tileName) newMeld = Meld(newPairs) newMeld.state = state if state == CONCEALED: pr... | def robTile(self, tileName): """used for robbing the kong""" tileName = tileName.lower() for meld in self.exposedMelds: if tileName in meld.pairs: self.exposedMelds.remove(meld) state = meld.state newPairs = meld.pairs[:] newPairs.remove(tileName) newMeld = Meld(newPairs) newMeld.state = state self.exposedMelds.append(... | 457,537 |
def abortGame(self, callback=None): """if a game is active, abort it""" if self.game: if self.game.client: return self.game.client.abortGame(callback) else: self.game.close() callback() return True | def abortGame(self, callback=None): """if a game is active, abort it""" if self.game: if self.game.client: return self.game.client.abortGame(callback) else: self.game.close() if callback: callback() return True | 457,538 |
def appliesToHand(hand, dummyMelds, dummyDebug=False): """see class docstring""" # pylint: disable-msg=R0911 # pylint: disable-msg=R0912 lastMeld = hand.mjStr.split(' L') if len(lastMeld) < 2: # no last meld specified: return False lastMeld = lastMeld[1].split()[0] lastTile = lastMeld[:2] lastMeld = Meld(lastMeld[2:]) ... | def appliesToHand(hand, dummyMelds, dummyDebug=False): """see class docstring""" # pylint: disable-msg=R0911 # pylint: disable-msg=R0912 lastMeld = hand.mjStr.split(' L') if len(lastMeld) < 2: # no last meld specified: return False lastMeld = lastMeld[1].split()[0] lastTile = lastMeld[:2] lastMeld = Meld(lastMeld[2:]) ... | 457,539 |
def __str__(self): return '%s: result=%s answer:%s/%s args:%s' % (self.player, self.result, type(self.answer), self.answer, self.args) | def __str__(self): return '%s: result=%s answer:%s/%s args:%s' % (self.player, self.result, type(self.answer), self.answer, self.args) | 457,540 |
def refresh(self): """update some actions, all auxiliary windows and the statusbar""" game = self.game for action in [self.actionScoreGame, self.actionPlayGame]: action.setEnabled(not bool(game)) self.actionAbortGame.setEnabled(bool(game)) scoring = bool(game and game.isScoringGame()) self.selectorBoard.setVisible(scor... | def refresh(self): """update some actions, all auxiliary windows and the statusbar""" game = self.game for action in [self.actionScoreGame, self.actionPlayGame]: action.setEnabled(not bool(game)) self.actionAbortGame.setEnabled(bool(game)) scoring = bool(game and game.isScoringGame()) self.selectorBoard.setVisible(scor... | 457,541 |
def ask(self, move, answers, callback=None): """server sends move. We ask the user. answers is a list with possible answers, the default answer being the first in the list.""" if not InternalParameters.field: return Client.ask(self, move, answers) deferred = Deferred() if callback: deferred.addCallback(callback) deferr... | def ask(self, move, answers, callback=None): """server sends move. We ask the user. answers is a list with possible answers, the default answer being the first in the list.""" if not InternalParameters.field: return Client.ask(self, move, answers, callback) deferred = Deferred() if callback: deferred.addCallback(callba... | 457,542 |
def start(self): """start animation for this group""" QParallelAnimationGroup.start(self, QAbstractAnimation.KeepWhenStopped) InternalParameters.field.centralScene.focusRect.hide() # TODO: why don't all animations end? self.timer.start(min(self.duration*10, 2000)) | def start(self): """start animation for this group""" QParallelAnimationGroup.start(self, QAbstractAnimation.KeepWhenStopped) InternalParameters.field.centralScene.focusRect.hide() # TODO: why don't all animations end? self.timer.start(min(self.duration*10, 2000)) | 457,543 |
def fset(self, value): self.assertSingleUnit() uName = Score.unitNames[self.unit] self.__setattr__(uName, type(self.__getattr__(uName))(value)) | def fset(self, value): self.assertSingleUnit() uName = Score.unitNames[self.unit] self.__setattr__(uName, type(self.__getattr__(uName))(value)) | 457,544 |
def placeInField(self): """place the dialog at bottom or to the right depending on space. #TODO: We still have some magic numbers here""" field = self.client.game.field cwi = field.centralWidget() view = field.centralView geometry = self.geometry() btnHeight = 28 vertical = view.width() > view.height() * 1.2 if vertica... | def placeInField(self): """place the dialog at bottom or to the right depending on space. #TODO: We still have some magic numbers here""" field = self.client.game.field cwi = field.centralWidget() view = field.centralView geometry = self.geometry() btnHeight = 28 vertical = view.width() > view.height() * 1.2 if vertica... | 457,545 |
def placeInField(self): """place the dialog at bottom or to the right depending on space. #TODO: We still have some magic numbers here""" field = self.client.game.field cwi = field.centralWidget() view = field.centralView geometry = self.geometry() btnHeight = 28 vertical = view.width() > view.height() * 1.2 if vertica... | def placeInField(self): """place the dialog at bottom or to the right depending on space. #TODO: We still have some magic numbers here""" field = self.client.game.field cwi = field.centralWidget() view = field.centralView geometry = self.geometry() btnHeight = self.buttons[0].height() vertical = view.width() > view.hei... | 457,546 |
def __init__(self): self.appName = str("kajongg") self.catalog = str('0') self.homePage = str('http://www.kde-apps.org/content/show.php/kajongg?content=103206') self.version = str('0.4.0') self.programName = ki18n ("Kajongg") self.description = ki18n ("Mah Jongg - the ancient Chinese board game for 4 pla... | def __init__(self): self.appName = str("kajongg") self.catalog = "" self.homePage = str('http://www.kde-apps.org/content/show.php/kajongg?content=103206') self.version = str('0.4.0') self.programName = ki18n ("Kajongg") self.description = ki18n ("Mah Jongg - the ancient Chinese board game for 4 players")... | 457,547 |
def tableHasField(dbhandle, table, field): """does the table contain a column named field?""" query = QSqlQuery(dbhandle) query.exec_('select * from %s' % table) record = query.record() for idx in range(record.count()): if record.fieldName(idx) == field: return True | def tableHasField(dbhandle, table, field): """does the table contain a column named field?""" query = QSqlQuery(dbhandle) query.exec_('select * from %s' % table) record = query.record() for idx in range(record.count()): if record.fieldName(idx) == field: return True | 457,548 |
def __addManualRules(self): """those are actually winner rules but in the kajongg scoring mode they must be selected manually""" # applicable only if we have a concealed meld and a declared kong: self.winnerRules.append(Rule('Last Tile Taken from Dead Wall', r' M..e||M /(....)*[A-Z].* -(....)*.4.* %.* M..w.* L[A-Z]||Al... | def __addManualRules(self): """those are actually winner rules but in the kajongg scoring mode they must be selected manually""" # applicable only if we have a concealed meld and a declared kong: self.winnerRules.append(Rule('Last Tile Taken from Dead Wall', r' M..e||M /(....)*[A-Z].* -(....)*.4.* %.* M..w.* L[A-Z]||Al... | 457,549 |
def computeHash(self, name=None): """compute the hash for this ruleset using all rules""" if name is None: name = self.name rules = [] for ruleList in self.ruleLists: rules.extend(ruleList) result = md5(name.encode('utf-8')) result.update(self.description.encode('utf-8')) for rule in sorted(rules, key=Ruleset.ruleKey):... | def computeHash(self, name=None): """compute the hash for this ruleset using all rules""" if name is None: name = self.name rules = [] for ruleList in self.ruleLists: rules.extend(ruleList) result = md5(name.encode('utf-8')) result.update(self.description.encode('utf-8')) for rule in sorted(rules, key=Ruleset.ruleKey):... | 457,550 |
def __init__(self, points=0, doubles=0, limits=0): if not isinstance(points, int): raise Exception('Score: points is not an integer') self.points = points self.doubles = doubles self.limits = limits | def __init__(self, points=0, doubles=0, limits=0): if not isinstance(points, int): raise Exception('Score: points is not an integer') self.points = points self.doubles = doubles self.limits = limits | 457,551 |
def __init__(self, element, xoffset = 0, yoffset = 0, level=0): QGraphicsSvgItem.__init__(self) if isinstance(element, Tile): xoffset, yoffset, level = element.xoffset, element.yoffset, element.level element = element.element self.focusable = True self.__board = None self.element = element self.__selected = False self.... | def __init__(self, element, xoffset = 0, yoffset = 0, level=0): QGraphicsSvgItem.__init__(self) if isinstance(element, Tile): xoffset, yoffset, level = element.xoffset, element.yoffset, element.level element = element.element self.focusable = True self.__board = None self.element = element self.__selected = False self.... | 457,552 |
def kajonggServer(): """start the server""" from twisted.internet import reactor from optparse import OptionParser InternalParameters.isServer = True parser = OptionParser() parser.add_option('', '--port', dest='port', help=m18n('the server will listen on PORT'), metavar='PORT', default=8149) parser.add_option('', '--s... | def kajonggServer(): """start the server""" from twisted.internet import reactor from optparse import OptionParser InternalParameters.isServer = True parser = OptionParser() parser.add_option('', '--port', dest='port', help=m18n('the server will listen on PORT'), metavar='PORT', default=8149) parser.add_option('', '--s... | 457,553 |
def kajonggServer(): """start the server""" from twisted.internet import reactor from optparse import OptionParser InternalParameters.isServer = True parser = OptionParser() parser.add_option('', '--port', dest='port', help=m18n('the server will listen on PORT'), metavar='PORT', default=8149) parser.add_option('', '--s... | def kajonggServer(): """start the server""" from twisted.internet import reactor from optparse import OptionParser InternalParameters.isServer = True parser = OptionParser() parser.add_option('', '--port', dest='port', help=m18n('the server will listen on PORT'), metavar='PORT', default=8149) parser.add_option('', '--s... | 457,554 |
def __findDangerousTiles(self): """update the list of dangerous tile""" # TODO: this is hardwired for the german CC rules, introduce options dangerousTiles = [] expMeldCount = len(self.exposedMelds) if expMeldCount >= 2: if expMeldCount == 3: if all(x in elements.greenHandTiles for x in self.visibleTiles): dangerousTil... | def __findDangerousTiles(self): """update the list of dangerous tile""" # TODO: this is hardwired for the german CC rules, introduce options dangerousTiles = [] expMeldCount = len(self.exposedMelds) if expMeldCount >= 2: if expMeldCount == 3: if all(x in elements.greenHandTiles for x in self.visibleTiles): dangerousTil... | 457,555 |
def quit(self): """exit the application""" print 'ich bin quit' if self.reactorStopped: util.StateSaver.saveAll() self.app.quit() sys.exit(0) if self.game: self.game.close(self.gameClosed) else: self.gameClosed() | def quit(self): """exit the application""" if self.reactorStopped: util.StateSaver.saveAll() self.app.quit() sys.exit(0) if self.game: self.game.close(self.gameClosed) else: self.gameClosed() | 457,556 |
def lastSource(): # pylint: disable-msg=E0202 """the name id of this player""" def fget(self): # pylint: disable-msg=W0212 return self.__lastSource def fset(self, lastSource): # pylint: disable-msg=W0212 self.__lastSource = lastSource if lastSource == 'd' and not self.game.wall.living: self.__lastSource = 'Z' if lastSo... | def lastSource(): # pylint: disable-msg=E0202 """the source of the last tile the player got""" def fget(self): # pylint: disable-msg=W0212 return self.__lastSource def fset(self, lastSource): # pylint: disable-msg=W0212 self.__lastSource = lastSource if lastSource == 'd' and not self.game.wall.living: self.__lastSource... | 457,557 |
def showEvent(self, dummyEvent): """only now get the data set. Not doing this in__init__ would eventually make it easier to subclass from some generic TableEditor class""" self.setQuery() MJTableView.initView() self.selectionChanged() | def showEvent(self, dummyEvent): """only now get the data set. Not doing this in__init__ would eventually make it easier to subclass from some generic TableEditor class""" self.setQuery() self.view.initView() self.selectionChanged() | 457,558 |
def __init__(self, player, args): self.player = player if isinstance(args, tuple): print 'Answer: args is tuple:', args answer = args[0] if isinstance(args[1], tuple): self.args = list(args[1]) else: self.args = list([args[1]]) else: answer = args self.args = None if answer is not None: self.answer = Message.byName(ans... | def __init__(self, player, args): self.player = player if isinstance(args, tuple): answer = args[0] if isinstance(args[1], tuple): self.args = list(args[1]) else: self.args = list([args[1]]) else: answer = args self.args = None if answer is not None: self.answer = Message.byName(answer) else: self.answer = None print s... | 457,559 |
def __init__(self, player, args): self.player = player if isinstance(args, tuple): print 'Answer: args is tuple:', args answer = args[0] if isinstance(args[1], tuple): self.args = list(args[1]) else: self.args = list([args[1]]) else: answer = args self.args = None if answer is not None: self.answer = Message.byName(ans... | def __init__(self, player, args): self.player = player if isinstance(args, tuple): print 'Answer: args is tuple:', args answer = args[0] if isinstance(args[1], tuple): self.args = list(args[1]) else: self.args = list([args[1]]) else: answer = args self.args = None if answer is not None: self.answer = Message.byName(ans... | 457,560 |
def processAnswer(self, msg): """process a single answer coming from a player""" player, answer, args = msg.player, msg.answer, msg.args if not isinstance(answer, Message): print 'answer is not a message:', type(answer), answer if InternalParameters.showTraffic: debugMessage('%s ANSWER: %s %s' % (player, answer, args))... | def processAnswer(self, msg): """process a single answer coming from a player""" player, answer, args = msg.player, msg.answer, msg.args if InternalParameters.showTraffic: debugMessage('%s ANSWER: %s %s' % (player, answer, args)) if answer in [Message.Discard, Message.Bonus, Message.OriginalCall]: if player != self.gam... | 457,561 |
def syncHandBoard(self): pass | def syncHandBoard(self, tileName=None): pass | 457,562 |
def clientAction(self, dummyClient, move): """mirror the mahjongg action locally. Check if the balances are correct.""" move.player.declaredMahJongg(move.source, move.withDiscard, move.lastTile, move.lastMeld) if move.player.balance != move.winnerBalance: logException('Game %d: WinnerBalance is different for %s! player... | def clientAction(self, client, move): """mirror the mahjongg action locally. Check if the balances are correct.""" move.player.declaredMahJongg(move.source, move.withDiscard, move.lastTile, move.lastMeld) if move.player.balance != move.winnerBalance: logException('Game %d: WinnerBalance is different for %s! player:%d, ... | 457,563 |
def clientAction(self, dummyClient, move): """mirror the mahjongg action locally. Check if the balances are correct.""" move.player.declaredMahJongg(move.source, move.withDiscard, move.lastTile, move.lastMeld) if move.player.balance != move.winnerBalance: logException('Game %d: WinnerBalance is different for %s! player... | def clientAction(self, dummyClient, move): """mirror the mahjongg action locally. Check if the balances are correct.""" move.player.declaredMahJongg(move.source, move.withDiscard, move.lastTile, move.lastMeld) if move.player.balance != move.winnerBalance: logException('Game %d: WinnerBalance is different for %s! player... | 457,564 |
def removeLastDiscard(self): """removes the last diiscard again""" self.lastDiscarded.board = None self.lastDiscarded = None | def removeLastDiscard(self): """removes the last diiscard again""" self.lastDiscarded.board = None self.lastDiscarded = None | 457,565 |
def computeVisibleTiles(self): """returns a dict of all tiles (lowercase) with a count how often they appear in the discardboard or exposed. We might optimize this by replacing this method by a list which is always updated as needed but not now""" tiles = [x.element for x in self.field.discardBoard.allTiles()] for play... | def computeVisibleTiles(self): """returns a dict of all tiles (lowercase) with a count how often they appear in the discardboard or exposed. We might optimize this by replacing this method by a list which is always updated as needed but not now""" tiles = [x.element for x in self.field.discardBoard.allTiles()] for play... | 457,566 |
def saveHand(self): """save hand to data base, update score table and balance in status line""" if self.field: visibleTiles = dict() for tile, count in self.field.discardBoard.visibleTiles.items(): visibleTiles[tile] = count for player in self.players: for tile, count in player.visibleTiles.items(): visibleTiles[tile] ... | def saveHand(self): """save hand to data base, update score table and balance in status line""" self.__payHand() self.__saveScores() self.handctr += 1 if self.winner and self.winner.wind == 'E': self.eastMJCount += 1 | 457,567 |
def allFinished(self): """all animations have finished. Cleanup and callback""" self.fixAllBoards() if self == ParallelAnimationGroup.current: ParallelAnimationGroup.current = None ParallelAnimationGroup.running = [] perSecond = self.steps * 1000.0 / self.duration() if perSecond < 50: kprint('%d steps for %d animations... | def allFinished(self): """all animations have finished. Cleanup and callback""" self.fixAllBoards() if self == ParallelAnimationGroup.current: ParallelAnimationGroup.current = None ParallelAnimationGroup.running = [] # if we have a deferred, callback now assert self.deferred if self.deferred: self.deferred.callback... | 457,568 |
def __init__(self): """self.servers is a list of tuples containing server and last playername""" QDialog.__init__(self, None) self.setWindowTitle(m18n('Login') + ' - Kajongg') self.setupUi() | def __init__(self): """self.servers is a list of tuples containing server and last playername""" QDialog.__init__(self, None) self.setWindowTitle(m18n('Login') + ' - Kajongg') self.setupUi() | 457,569 |
def __init__(self): """self.servers is a list of tuples containing server and last playername""" QDialog.__init__(self, None) self.setWindowTitle(m18n('Login') + ' - Kajongg') self.setupUi() | def __init__(self): """self.servers is a list of tuples containing server and last playername""" QDialog.__init__(self, None) self.setWindowTitle(m18n('Login') + ' - Kajongg') self.setupUi() | 457,570 |
def clientLoggedOut(self, result): for player in self.players: player.clearHand() if player.handBoard: player.handBoard.hide() player.handBoard = None if self.field: self.field.setWindowTitle('kmj') self.removeWall() self.field.game = None self.field.refresh() | def clientLoggedOut(self, result=None): for player in self.players: player.clearHand() if player.handBoard: player.handBoard.hide() player.handBoard = None if self.field: self.field.setWindowTitle('kmj') self.removeWall() self.field.game = None self.field.refresh() | 457,571 |
def quit2(): """2nd stage: twisted reactor is already stopped""" StateSaver.saveAll() InternalParameters.app.quit() | def quit2(): """2nd stage: twisted reactor is already stopped""" StateSaver.saveAll() InternalParameters.app.quit() | 457,572 |
def remote_abort(self, tableid, message, *args): """the server aborted this game""" if self.table and self.table.tableid == tableid: # translate ROBOT to Roboter: args = [m18nc('kajongg', x) for x in args] logWarning(m18n(message, *args)) if self.game: self.game.close() if InternalParameters.autoPlay: if InternalParame... | def remote_abort(self, tableid, message, *args): """the server aborted this game""" if self.table and self.table.tableid == tableid: # translate ROBOT to Roboter: args = [m18nc('kajongg', x) for x in args] logWarning(m18n(message, *args)) if self.game: self.game.close() if InternalParameters.autoPlay: if InternalParame... | 457,573 |
def remote_gameOver(self, tableid, message, *args): """the server aborted this game""" if self.table and self.table.tableid == tableid: logWarning(m18n(message, *args)) if self.game: self.game.rotateWinds() self.game.close() if InternalParameters.autoPlay: InternalParameters.field.quit() | def remote_gameOver(self, tableid, message, *args): """the server aborted this game""" if self.table and self.table.tableid == tableid: logWarning(m18n(message, *args)) if self.game: self.game.rotateWinds() self.game.close() if InternalParameters.autoPlay: InternalParameters.field.quit() | 457,574 |
def __init__(self, table, temp=False): self.garbageCollection() self.table = table self.requests = [] self.callbackMethod = None self.__callbackArgs = None self.outstanding = 0 self.completed = False if not temp: DeferredBlock.blocks.append(self) | def __init__(self, table, temp=False): if not temp: self.garbageCollection() self.table = table self.requests = [] self.callbackMethod = None self.__callbackArgs = None self.outstanding = 0 self.completed = False if not temp: DeferredBlock.blocks.append(self) | 457,575 |
def setFields(self, kvlist): entries = {} for (keyId, field), value in kvlist: entries.setdefault(keyId, {})[field] = value for jobId, kvdict in entries.items(): system_id = kvdict.get('system', None) if system_id: index = kvlist.index(((jobId, 'system'), system_id)) kvlist.pop(index) cu = self._db.cursor() cu.execute(... | def setFields(self, kvlist): entries = {} for (keyId, field), value in kvlist: entries.setdefault(keyId, {})[field] = value for jobId, kvdict in entries.items(): system_id = kvdict.get('system', None) if kvdict.has_key('system'): index = kvlist.index(((jobId, 'system'), system_id)) kvlist.pop(index) cu = self._db.curso... | 457,576 |
def setFields(self, kvlist): entries = {} for (keyId, field), value in kvlist: entries.setdefault(keyId, {})[field] = value for jobId, kvdict in entries.items(): system_id = kvdict.get('system', None) if system_id: index = kvlist.index(((jobId, 'system'), system_id)) kvlist.pop(index) cu = self._db.cursor() cu.execute(... | def setFields(self, kvlist): entries = {} for (keyId, field), value in kvlist: entries.setdefault(keyId, {})[field] = value for jobId, kvdict in entries.items(): system_id = kvdict.get('system', None) if system_id: index = kvlist.index(((jobId, 'system'), system_id)) kvlist.pop(index) cu = self._db.cursor() cu.execute(... | 457,577 |
def rand_key(): key=str() for i in range(1,KEY_LEN): key += "%02x"%( random.randint( 0, 255) ) return key | def rand_key(): key=str() for i in range(0,KEY_LEN): key += "%02x"%( random.randint( 0, 255) ) return key | 457,578 |
def rand_key(): key=str() for i in range(1,KEY_LEN): key += "%02x"%( random.randint( 0, 255) ) return key | def rand_key(): key=str() for i in range(1,KEY_LEN): key += "%02x"%( random.randint( 0, 255) ) return key | 457,579 |
def __init__(self, app, testmode): self.app = app self.testmode = testmode self.paused = False | def __init__(self, app, testmode): self.app = app self.testmode = testmode self.paused = False | 457,580 |
def choose_robot_debug(self): rname = self.ag.checkedAction().text() self.debug_robot = rname | def choose_robot_debug(self): rname = self.ag.checkedAction().text() self.debug_robot = rname | 457,581 |
def dbopen(): global dbversion if dbversion == ':memory:': return global conn fname = fullpath() try: conn = sqlite3.connect(fname) except sqlite3.OperationalError: print 'Cannot find dbfile. Working in :memory:' conn = sqlite3.connect(':memory:') dbversion = ':memory:' conn.row_factory = sqlite3.Row global c c = co... | def dbopen(): global dbversion if dbversion == ':memory:': return global conn fname = fullpath() try: conn = sqlite3.connect(fname) except sqlite3.OperationalError: print 'Cannot find dbfile. Working in :memory:' conn = sqlite3.connect(':memory:') dbversion = ':memory:' conn.row_factory = sqlite3.Row global c c = co... | 457,582 |
def dbcheck(): fname = fullpath() if not os.path.exists(fname): initialize() print 'stats database initialized' if not dbcheckver(): print 'ERROR: Database version mismatch.' return False else: return True | def dbcheck(): fname = fullpath() if fname != '/:::NONEXISTANT:::' and not os.path.exists(fname): initialize() print 'stats database initialized' if not dbcheckver(): print 'ERROR: Database version mismatch.' return False else: return True | 457,583 |
def from_param(cls, value): if not 0 <= value <= SIZE_T_MAX: raise ValueError("value too large to fit in a C size_t") return ctypes.c_size_t(value) | def from_param(cls, value): if not 0 <= value <= SIZE_T_MAX: raise ValueError("value too large to fit in a C size_t") return ctypes.c_size_t(value) | 457,584 |
def convert_to_rounding_mode(result, func, args): return _inv_rounding_mode_dict[result] | def convert_to_rounding_mode(result, func, args): return _inv_rounding_mode_dict[result] | 457,585 |
def convert_to_rounding_mode(result, func, args): return _inv_rounding_mode_dict[result] | def convert_to_rounding_mode(result, func, args): return _inv_rounding_mode_dict[result] | 457,586 |
def convert_to_rounding_mode(result, func, args): return _inv_rounding_mode_dict[result] | def convert_to_rounding_mode(result, func, args): return _inv_rounding_mode_dict[result] | 457,587 |
def test_hashable(self): # create equal but non-identical contexts c1 = Context(emin=-999, emax=999, precision=100, subnormalize=True, rounding='RoundTowardPositive') c2 = (Context(emax=999, emin=-999, rounding='RoundTowardPositive') + Context(precision=100, subnormalize=True)) self.asssertEqual(hash(c1), hash(c2)) | def test_hashable(self): # create equal but non-identical contexts c1 = Context(emin=-999, emax=999, precision=100, subnormalize=True, rounding='RoundTowardPositive') c2 = (Context(emax=999, emin=-999, rounding='RoundTowardPositive') + Context(precision=100, subnormalize=True)) self.asssertEqual(hash(c1), hash(c2)) | 457,588 |
def remquo2(r, x, y, rnd): """Set r to the value of x-ny, and also return low bits of quotient n. Returns a pair (ternary, q).""" q = ctypes.c_long() ternary = mpfr.mpfr_remquo(r, ctypes.byref(q), x, y, rnd) return ternary, q | def remquo2(r, x, y, rnd): """Set r to the value of x-ny, and also return low bits of quotient n. Returns a pair (ternary, q).""" q = ctypes.c_long() ternary = mpfr.mpfr_remquo(r, ctypes.byref(q), x, y, rnd) return ternary, q | 457,589 |
def test_hash(self): # equal values should hash equal pos0 = BigFloat('0') neg0 = BigFloat('-0') self.assertEqual(hash(pos0), hash(neg0)) | def test_hash(self): # equal values should hash equal pos0 = BigFloat('0') neg0 = BigFloat('-0') self.assertEqual(hash(pos0), hash(neg0)) | 457,590 |
def test_hash(self): # equal values should hash equal pos0 = BigFloat('0') neg0 = BigFloat('-0') self.assertEqual(hash(pos0), hash(neg0)) | def test_hash(self): # equal values should hash equal pos0 = BigFloat('0') neg0 = BigFloat('-0') self.assertEqual(hash(pos0), hash(neg0)) | 457,591 |
def main(): setup( name='bigfloat', version='0.1.2', description=DESCRIPTION, long_description=LONG_DESCRIPTION, author='Mark Dickinson', author_email='dickinsm@gmail.com', url='http://bitbucket.org/dickinsm/bigfloat', classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Academic Free License (... | def main(): setup( name='bigfloat', version='0.1.2', description=DESCRIPTION, long_description=LONG_DESCRIPTION, author='Mark Dickinson', author_email='dickinsm@gmail.com', url='http://bitbucket.org/dickinsm/bigfloat', classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Academic Free License (... | 457,592 |
def __str__(self): if self.adminRemoved: retval = u'%s (%s) was removed from %s (%s) on %s (%s) by %s (%s).' % ( self.instanceUserInfo.name, self.instanceUserInfo.id, self.groupInfo.name, self.groupInfo.id, self.siteInfo.name, self.siteInfo.id, self.userInfo.name, self.userInfo.id) else: retval = u'%s (%s) left %s (%s)... | def __str__(self): if self.adminRemoved: retval = u'%s (%s) was removed from %s (%s) on %s (%s) by %s (%s).' % ( self.instanceUserInfo.name, self.instanceUserInfo.id, self.groupInfo.name, self.groupInfo.id, self.siteInfo.name, self.siteInfo.id, self.userInfo.name, self.userInfo.id) else: retval = u'%s (%s) left %s (%s)... | 457,593 |
def _lookupMAC(self, mac): """ Queries the database for the given MAC address and returns the IP and associated details if the MAC is known. @type mac: basestring @param mac: The MAC address to lookup. @rtype: tuple(11)|None @return: (ip:basestring, hostname:basestring|None, gateway:basestring|None, subnet_mask:bases... | def _lookupMAC(self, mac): """ Queries the database for the given MAC address and returns the IP and associated details if the MAC is known. @type mac: basestring @param mac: The MAC address to lookup. @rtype: tuple(11)|None @return: (ip:basestring, hostname:basestring|None, gateway:basestring|None, subnet_mask:bases... | 457,594 |
def __init__(self): """ Constructs the broker. """ self._connection_details = { 'database': conf.POSTGRESQL_DATABASE, 'user': conf.POSTGRESQL_USERNAME, 'password': conf.POSTGRESQL_PASSWORD, } if not conf.MYSQL_HOST is None: self._connection_details['host'] = conf.POSTGRESQL_HOST self._connection_details['port'] = conf.... | def __init__(self): """ Constructs the broker. """ self._connection_details = { 'database': conf.POSTGRESQL_DATABASE, 'user': conf.POSTGRESQL_USERNAME, 'password': conf.POSTGRESQL_PASSWORD, } if not conf.POSTGRESQL_HOST is None: self._connection_details['host'] = conf.POSTGRESQL_HOST self._connection_details['port'] = ... | 457,595 |
def correctlink(self, lien, current, currentdir, proto): """Transform relatives urls in absolutes ones""" # No leading or trailing whitespaces lien = lien.strip() if lien == "": return current | def correctlink(self, lien, current, currentdir, proto): """Transform relatives urls in absolutes ones""" # No leading or trailing whitespaces lien = lien.strip() if lien == "": return current | 457,596 |
def getPeer(self): """Return the network address of the server that delivered this Response. This will always be a socket_object.getpeername() return value, which is normally a (ip_address, port) tuple.""" return self.peer | def getPeer(self): """Return the network address of the server that delivered this Response. This will always be a socket_object.getpeername() return value, which is normally a (ip_address, port) tuple.""" return self.peer | 457,597 |
def __init__(self, root): error_str = "" self.myls = lswww.lswww(root) self.root = self.myls.root self.server = urlparse.urlparse(self.root)[1] self.myls.verbosity(1) socket.setdefaulttimeout(self.timeout) | def __init__(self, root): error_str = "" self.myls = lswww.lswww(root) self.root = self.myls.root self.server = urlparse.urlparse(self.root)[1] self.myls.verbosity(1) socket.setdefaulttimeout(self.timeout) | 457,598 |
def __init__(self, root): error_str = "" self.myls = lswww.lswww(root) self.root = self.myls.root self.server = urlparse.urlparse(self.root)[1] self.myls.verbosity(1) socket.setdefaulttimeout(self.timeout) | def __init__(self, root): error_str = "" self.myls = lswww.lswww(root) self.root = self.myls.root self.server = urlparse.urlparse(self.root)[1] self.myls.verbosity(1) socket.setdefaulttimeout(self.timeout) | 457,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.