bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def __init__(self): if util.PREF: logException(Exception('PREF is not None')) util.PREF = self KConfigSkeleton.__init__(self) self.addString('General', 'tilesetName', 'default') self.addString('General', 'windTilesetName', 'traditional') self.addString('General', 'backgroundName', 'default') self.addBool('General', 'de... | def __init__(self): if util.PREF: logException(Exception('PREF is not None')) util.PREF = self KConfigSkeleton.__init__(self) self.addString('General', 'tilesetName', 'default') self.addString('General', 'windTilesetName', 'traditional') self.addString('General', 'backgroundName', 'default') self.addBool('General', 'de... | 457,400 |
def kajonggServer(): """start the server""" from twisted.internet import reactor from optparse import OptionParser parser = OptionParser() parser.add_option('', '--port', dest='port', help=m18n('the server will listen on PORT'), metavar='PORT', default=8149) parser.add_option('', '--showtraffic', dest='showtraffic', ac... | def kajonggServer(): """start the server""" from twisted.internet import reactor from optparse import OptionParser parser = OptionParser() parser.add_option('', '--port', dest='port', help=m18n('the server will listen on PORT'), metavar='PORT', default=8149) parser.add_option('', '--showtraffic', dest='showtraffic', ac... | 457,401 |
def __str__(self): answers = ','.join(str(self.answers)) return '%s: answers:%s' % (self.player, answers) | def __str__(self): answers = ','.join(str(self.answers)) return '%s: answers:%s' % (self.player, answers) | 457,402 |
def __str__(self): return '%s answers: %s: %s' % (self.player, self.answer, self.args) | def __str__(self): return '%s answers: %s: %s' % (self.player, self.answer, self.args) | 457,403 |
def tell(self, about, receivers, command, **kwargs): """send info about player 'about' to players 'receivers'""" if not isinstance(receivers, list): receivers = list([receivers]) for receiver in receivers: if command != Message.PopupMsg: self.table.lastMove = Move(about, command, kwargs) if InternalParameters.showTraff... | def tell(self, about, receivers, command, **kwargs): """send info about player 'about' to players 'receivers'""" if not isinstance(receivers, list): receivers = list([receivers]) for receiver in receivers: if command != Message.PopupMsg: self.table.lastMove = Move(about, command, kwargs) if InternalParameters.showTraff... | 457,404 |
def explain(self): return [x[0].explain() for x in self.usedRules] | def explain(self): return [x[0].explain() for x in self.usedRules] | 457,405 |
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:... | 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,406 |
def startLocalServer(useSocket): """start a local server""" try: args = ' '.join([ '--showtraffic' if InternalParameters.showTraffic else '', '--socket=%s' % socketName() if useSocket else '']).lstrip() cmd = './kajonggserver.py' if not os.path.exists(cmd): cmd = 'kajonggserver' if args: process = subprocess.Popen([cm... | def startLocalServer(useSocket): """start a local server""" try: cmd = './kajonggserver.py' if not os.path.exists(cmd): cmd = 'kajonggserver' if args: process = subprocess.Popen([cmd, args]) else: process = subprocess.Popen([cmd]) syslogMessage(m18n('started the local kajongg server: pid=<numid>%1</numid> %2', process.... | 457,407 |
def startLocalServer(useSocket): """start a local server""" try: args = ' '.join([ '--showtraffic' if InternalParameters.showTraffic else '', '--socket=%s' % socketName() if useSocket else '']).lstrip() cmd = './kajonggserver.py' if not os.path.exists(cmd): cmd = 'kajonggserver' if args: process = subprocess.Popen([cm... | def startLocalServer(useSocket): """start a local server""" try: args = ' '.join([ '--showtraffic' if InternalParameters.showTraffic else '', '--socket=%s' % socketName() if useSocket else '']).lstrip() cmd = './kajonggserver.py' if not os.path.exists(cmd): cmd = 'kajonggserver' args = [cmd] if InternalParameters.show... | 457,408 |
def startLocalServer(useSocket): """start a local server""" try: args = ' '.join([ '--showtraffic' if InternalParameters.showTraffic else '', '--socket=%s' % socketName() if useSocket else '']).lstrip() cmd = './kajonggserver.py' if not os.path.exists(cmd): cmd = 'kajonggserver' if args: process = subprocess.Popen([cm... | def startLocalServer(useSocket): """start a local server""" try: args = ' '.join([ '--showtraffic' if InternalParameters.showTraffic else '', '--socket=%s' % socketName() if useSocket else '']).lstrip() cmd = './kajonggserver.py' if not os.path.exists(cmd): cmd = 'kajonggserver' if args: process = subprocess.Popen([cm... | 457,409 |
def setData(self, index, value, role=Qt.EditRole): """change data in the model""" if not index.isValid(): return False try: dirty = False column = index.column() item = index.internalPointer() data = item.content if role == Qt.EditRole: if isinstance(data, Ruleset) and column == 0: name = str(value.toString()) oldName ... | def setData(self, index, value, role=Qt.EditRole): """change data in the model""" if not index.isValid(): return False try: dirty = False column = index.column() item = index.internalPointer() data = item.content if role == Qt.EditRole: if isinstance(data, Ruleset) and column == 0: name = str(value.toString()) oldName ... | 457,410 |
def setData(self, index, value, role=Qt.EditRole): """change data in the model""" if not index.isValid(): return False try: dirty = False column = index.column() item = index.internalPointer() data = item.content if role == Qt.EditRole: if isinstance(data, Ruleset) and column == 0: name = str(value.toString()) oldName ... | def setData(self, index, value, role=Qt.EditRole): """change data in the model""" if not index.isValid(): return False try: dirty = False column = index.column() item = index.internalPointer() data = item.content if role == Qt.EditRole: if isinstance(data, Ruleset) and column == 0: name = str(value.toString()) oldName ... | 457,411 |
def setData(self, index, value, role=Qt.EditRole): """change data in the model""" if not index.isValid(): return False try: dirty = False column = index.column() item = index.internalPointer() data = item.content if role == Qt.EditRole: if isinstance(data, Ruleset) and column == 0: name = str(value.toString()) oldName ... | def setData(self, index, value, role=Qt.EditRole): """change data in the model""" if not index.isValid(): return False try: dirty = False column = index.column() item = index.internalPointer() data = item.content if role == Qt.EditRole: if isinstance(data, Ruleset) and column == 0: name = str(value.toString()) oldName ... | 457,412 |
def fset(self, definition): """setter for definition""" assert not isinstance(definition, QString) prevDefinition = self.definition self._definition = definition if not definition: return # may happen with special programmed rules variants = definition.split('||') if self.parType: self.parName = variants[0] variants =... | deffset(self,definition):"""setterfordefinition"""assertnotisinstance(definition,QString)prevDefinition=self.definitionself._definition=definitionifnotdefinition:return#mayhappenwithspecialprogrammedrulesvariants=definition.split('||')ifself.parType:self.parName=variants[0]variants=variants[1:]self.actions={}self.varia... | 457,413 |
def computeHandContent(self, withTile=None): if len(self.concealedMelds) and len(self.concealedTiles): print 'player.hand:', self, 'exposedMelds:', for meld in self.exposedMelds: print meld.joined, print print 'player.hand:', self, 'concealedMelds:', for meld in self.concealedMelds: print meld.joined, print print 'play... | def computeHandContent(self, withTile=None): assert not (self.concealedMelds and self.concealedTiles) prevLastTile = self.lastTile if withTile: self.lastTile = withTile try: melds = [''.join(self.concealedTiles)] if withTile: melds[0] += withTile melds.extend(x.joined for x in self.exposedMelds) melds.extend(x.joined f... | 457,414 |
def cleanPlayerTable(dbhandle): """remove now unneeded columns host, password and make names unique""" playerCounts = IntDict() names = {} keep = {} for nameId, name in Query('select id,name from player', dbHandle=dbhandle).records: playerCounts[name] += 1 names[int(nameId)] = name for name, counter in defaultdict.item... | def cleanPlayerTable(dbhandle): """remove now unneeded columns host, password and make names unique""" playerCounts = IntDict() names = {} keep = {} for nameId, name in Query('select id,name from player', dbHandle=dbhandle).records: playerCounts[name] += 1 names[int(nameId)] = name for name, counter in defaultdict.item... | 457,415 |
def __addParameterRules(self): """as the name says""" self.parameterRules.append(Rule('Points Needed for Mah Jongg', 'intminMJPoints||Amandatory', parameter=0)) self.parameterRules.append(Rule('Points for a Limit Hand', 'intlimit||Amandatory', parameter=500)) self.parameterRules.append(Rule('Claim Timeout', 'intclaimTi... | def __addParameterRules(self): """as the name says""" self.parameterRules.append(Rule('Points Needed for Mah Jongg', 'intminMJPoints||Amandatory', parameter=0)) self.parameterRules.append(Rule('Points for a Limit Hand', 'intlimit||Amandatory', parameter=500)) self.parameterRules.append(Rule('Claim Timeout', 'intclaimTi... | 457,416 |
def kajonggToggleAction(self, name, icon, shortcut=None, actionData=None): """a checkable action""" res = self.kajonggAction(name, icon, shortcut=shortcut, actionData=actionData) res.setCheckable(True) self.connect(res, SIGNAL('toggled(bool)'), self.toggleWidget) return res | def kajonggToggleAction(self, name, icon, shortcut=None, actionData=None): """a checkable action""" res = self.kajonggAction(name, icon, shortcut=shortcut, actionData=actionData) res.setCheckable(True) self.connect(res, SIGNAL('toggled(bool)'), self.__toggleWidget) return res | 457,417 |
def toggleWidget(self, checked): """user has toggled widget visibility with an action""" action = self.sender() actionData = action.data().toPyObject() if checked: if isinstance(actionData, type): actionData = actionData(self.game) action.setData(QVariant(actionData)) if isinstance(actionData, ScoringDialog): self.scor... | def __toggleWidget(self, checked): """user has toggled widget visibility with an action""" action = self.sender() actionData = action.data().toPyObject() if checked: if isinstance(actionData, type): actionData = actionData(self.game) action.setData(QVariant(actionData)) if isinstance(actionData, ScoringDialog): self.sc... | 457,418 |
def askSwap(self, swappers): # TODO: make this a class """ask the user if two players should change seats""" # do not make this a staticmethod because we do not want # to import PlayField in game.py mbox = QMessageBox() mbox.setWindowTitle(m18n("Swap Seats") + ' - Kajongg') mbox.setText("By the rules, %s and %s should ... | @staticmethod def askSwap(swappers): # TODO: make this a class """ask the user if two players should change seats""" # do not make this a staticmethod because we do not want # to import PlayField in game.py mbox = QMessageBox() mbox.setWindowTitle(m18n("Swap Seats") + ' - Kajongg') mbox.setText("By the rules, %s and %s... | 457,419 |
def loadRules(self): """define the rules""" self.__addPenaltyRules() self.__addHandRules() self.__addManualRules() self.__addParameterRules() self.winnerRules.append(Rule('Last Tile Completes Pair of 2..8', r' L(.[2-8])\1\1\b', points=2)) self.winnerRules.append(Rule('Last Tile Completes Pair of Terminals or Honors', r... | def loadRules(self): """define the rules""" self.__addPenaltyRules() self.__addHandRules() self.__addManualRules() self.__addParameterRules() self.winnerRules.append(Rule('Last Tile Completes Pair of 2..8', r' L(.[2-8])\1\1\b', points=2)) self.winnerRules.append(Rule('Last Tile Completes Pair of Terminals or Honors', r... | 457,420 |
def speak(what): """this is what the user of this module will call.""" debugMessage('sound.speak:' + what) if not Sound.enabled: return if Sound.__hasogg123 is None: if not which('ogg123'): Sound.enabled = False # checks again at next reenable logWarning(m18n('No sound because the program ogg123 is missing')) return S... | def speak(what): """this is what the user of this module will call.""" if not Sound.enabled: return if Sound.__hasogg123 is None: if not which('ogg123'): Sound.enabled = False # checks again at next reenable logWarning(m18n('No sound because the program ogg123 is missing')) return Sound.__hasogg123 = True if Sound.__pr... | 457,421 |
def __extractArchive(self): """if we have an unextracted archive, extract it""" if self.voiceDirectory.startswith('MD5'): archiveDirectory = self.archiveDirectory() archiveName = self.archiveName() if not os.path.exists(archiveDirectory) and os.path.exists(archiveName): print 'extracting', archiveName tarFile = tarfile... | def __extractArchive(self): """if we have an unextracted archive, extract it""" if self.voiceDirectory.startswith('MD5'): archiveDirectory = self.archiveDirectory() archiveName = self.archiveName() if not os.path.exists(archiveDirectory) and os.path.exists(archiveName): tarFile = tarfile.open(archiveName) os.mkdir(arch... | 457,422 |
def speak(self, text): """text must be a sound filename without extension""" print 'voice.speak:', text if not self.voiceDirectory.startswith('MD5') \ and not self.voiceDirectory.startswith('ROBOT'): # we have not been able to convert the player name into a voice archive return self.__extractArchive() Sound.speak(self.... | def speak(self, text): """text must be a sound filename without extension""" if not self.voiceDirectory.startswith('MD5') \ and not self.voiceDirectory.startswith('ROBOT'): # we have not been able to convert the player name into a voice archive return self.__extractArchive() Sound.speak(self.localTextName(text)) | 457,423 |
def __exchangeSeats(self): """execute seat exchanges according to the rules""" windPairs = self.shiftRules.split(',')[self.roundsFinished-1] while len(windPairs): windPair = windPairs[0:2] windPairs = windPairs[2:] swappers = list(self.players[windPair[x]] for x in (0, 1)) if self.belongsToPlayer(): # we are a client i... | def __exchangeSeats(self): """execute seat exchanges according to the rules""" windPairs = self.shiftRules.split(',')[self.roundsFinished-1] while len(windPairs): windPair = windPairs[0:2] windPairs = windPairs[2:] swappers = list(self.players[windPair[x]] for x in (0, 1)) if self.belongsToPlayer(): # we are a client i... | 457,424 |
def deal(self): """every player gets 13 tiles (including east)""" self.throwDices() fnCount = self.livingWall.count('fn') + self.kongBox.count('fn') assert fnCount ==1, '%s %s'% (self.livingWall, self.kongBox) for player in self.players: player.clearHand() while len(player.concealedTiles) != 13: self.dealTile(player)... | def deal(self): """every player gets 13 tiles (including east)""" self.throwDices() for player in self.players: player.clearHand() while len(player.concealedTiles) != 13: self.dealTile(player) player.syncHandBoard() | 457,425 |
def clientLoggedOut(self, result=None): """logged off from server, clean up""" for player in self.players: player.clearHand() if player.handBoard: player.handBoard.hide() player.handBoard = None if self.field: self.field.setWindowTitle('kajongg') self.removeWall() self.field.game = None self.field.refresh() | def clientLoggedOut(self, result=None): """logged off from server, clean up""" for player in self.players: player.clearHand() if player.handBoard: player.handBoard.hide() player.handBoard = None if self.field: self.field.setWindowTitle('Kajongg') self.removeWall() self.field.game = None self.field.refresh() | 457,426 |
def clientAction(self, client, move): if move.tile != move.player.lastTile: client.invalidateOriginalCall(move.player) client.game.hasDiscarded(move.player, move.tile) if not client.thatWasMe(move.player): if client.game.IAmNext(): client.ask(move, [Message.NoClaim, Message.Chow, Message.Pung, Message.Kong, Message.Mah... | def clientAction(self, client, move): if move.tile != move.player.lastTile: client.invalidateOriginalCall(move.player) client.game.hasDiscarded(move.player, move.tile) if not client.thatWasMe(move.player): if client.game.IAmNext(): client.ask(move, [Message.NoClaim, Message.Chow, Message.Pung, Message.Kong, Message.Mah... | 457,427 |
def scoringString(self): """helper for HandBoard.__str__""" if self.concealedMelds: parts = [x.joined for x in self.concealedMelds + self.exposedMelds] else: parts = [''.join(x.element for x in self.concealedTiles)] parts.extend([x.joined for x in self.exposedMelds]) parts.extend(self.bonusTiles) return ' '.join(parts) | def scoringString(self): """helper for HandBoard.__str__""" if self.concealedMelds: parts = [x.joined for x in self.concealedMelds + self.exposedMelds] else: parts = [''.join(self.concealedTiles)] parts.extend([x.joined for x in self.exposedMelds]) parts.extend(self.bonusTiles) return ' '.join(parts) | 457,428 |
def __init__(self, cmdList, args=None, dbHandle=None): """we take a list of sql statements. Only the last one is allowed to be a select statement. Do prepared queries by passing a single query statement in cmdList and the parameters in args. If args is a list of lists, execute the prepared query for every sublist. If d... | def __init__(self, cmdList, args=None, dbHandle=None): """we take a list of sql statements. Only the last one is allowed to be a select statement. Do prepared queries by passing a single query statement in cmdList and the parameters in args. If args is a list of lists, execute the prepared query for every sublist. If d... | 457,429 |
def __init__(self, cmdList, args=None, dbHandle=None): """we take a list of sql statements. Only the last one is allowed to be a select statement. Do prepared queries by passing a single query statement in cmdList and the parameters in args. If args is a list of lists, execute the prepared query for every sublist. If d... | def __init__(self, cmdList, args=None, dbHandle=None): """we take a list of sql statements. Only the last one is allowed to be a select statement. Do prepared queries by passing a single query statement in cmdList and the parameters in args. If args is a list of lists, execute the prepared query for every sublist. If d... | 457,430 |
def __init__(self, cmdList, args=None, dbHandle=None): """we take a list of sql statements. Only the last one is allowed to be a select statement. Do prepared queries by passing a single query statement in cmdList and the parameters in args. If args is a list of lists, execute the prepared query for every sublist. If d... | def __init__(self, cmdList, args=None, dbHandle=None): """we take a list of sql statements. Only the last one is allowed to be a select statement. Do prepared queries by passing a single query statement in cmdList and the parameters in args. If args is a list of lists, execute the prepared query for every sublist. If d... | 457,431 |
def exposeMeld(self, meldTiles, called=None): """exposes a meld with meldTiles: removes them from concealedTileNames, adds the meld to exposedMelds and returns it called: we got the last tile for the meld from discarded, otherwise from the wall""" game = self.game game.activePlayer = self allMeldTiles = meldTiles[:] if... | defself.concealedTileNames.remove(allMeldTiles[3]) exposeMeld(self,self.concealedTileNames.remove(allMeldTiles[3]) meldTiles,self.concealedTileNames.remove(allMeldTiles[3]) called=None):self.concealedTileNames.remove(allMeldTiles[3]) """exposesself.concealedTileNames.remove(allMeldTiles[3]) aself.concealedTileNames.rem... | 457,432 |
def isCalling(self): """the hand is calling if it only needs one tile for mah jongg. Returns the tile needed for MJ or None""" if self.handLenOffset(): return None # here we assume things about the possible structure of a # winner hand. Recheck this when supporting new exotic hands. if len(self.melds) > 7: # only possi... | def isCalling(self): """the hand is calling if it only needs one tile for mah jongg. Returns the tile needed for MJ or None""" if self.handLenOffset(): return None # here we assume things about the possible structure of a # winner hand. Recheck this when supporting new exotic hands. if len(self.melds) > 7: # only possi... | 457,433 |
def isCalling(self): """the hand is calling if it only needs one tile for mah jongg. Returns the tile needed for MJ or None""" if self.handLenOffset(): return None # here we assume things about the possible structure of a # winner hand. Recheck this when supporting new exotic hands. if len(self.melds) > 7: # only possi... | def isCalling(self): """the hand is calling if it only needs one tile for mah jongg. Returns the tile needed for MJ or None""" if self.handLenOffset(): return None # here we assume things about the possible structure of a # winner hand. Recheck this when supporting new exotic hands. if len(self.melds) > 7: # only possi... | 457,434 |
def kajonggServer(): """start the server""" from twisted.internet import reactor from optparse import OptionParser parser = OptionParser() parser.add_option('', '--port', dest='port', help=m18n('the server will listen on PORT'), metavar='PORT', default=8149) parser.add_option('', '--showtraffic', dest='showtraffic', ac... | def kajonggServer(): """start the server""" from twisted.internet import reactor from optparse import OptionParser parser = OptionParser() parser.add_option('', '--port', dest='port', help=m18n('the server will listen on PORT'), metavar='PORT', default=8149) parser.add_option('', '--showtraffic', dest='showtraffic', ac... | 457,435 |
def __meldFromTile(self, tile): """returns a meld, lets user choose between possible meld types""" if isinstance(tile.board, HandBoard): meld = tile.board.meldWithTile(tile) assert meld if not self.lowerHalf and len(meld) == 4 and meld.state == CONCEALED: pair0 = meld.pairs[0].lower() meldVariants = [Meld(pair0*4), Mel... | def __meldFromTile(self, tile): """returns a meld, lets user choose between possible meld types""" if isinstance(tile.board, HandBoard): meld = tile.board.meldWithTile(tile) assert meld if not self.lowerHalf and len(meld) == 4 and meld.state == CONCEALED: pair0 = meld.pairs[0].lower() meldVariants = [Meld(pair0*4), Mel... | 457,436 |
def __init__(self, *what): print 'new saver' StateSaver.savers.append(self) self.widgets = [] for widget in what: name = unicode(widget.objectName()) if not name: if widget.parentWidget(): name = unicode(widget.parentWidget().objectName()+widget.__class__.__name__) else: name = unicode(widget.__class__.__name__) self.w... | def __init__(self, *what): StateSaver.savers.append(self) self.widgets = [] for widget in what: name = unicode(widget.objectName()) if not name: if widget.parentWidget(): name = unicode(widget.parentWidget().objectName()+widget.__class__.__name__) else: name = unicode(widget.__class__.__name__) self.widgets.append((wid... | 457,437 |
def __init__(self, player): self.meldDistance = 0.0 self.rowDistance = 0.2 Board.__init__(self, 22.7, 2.0 + self.rowDistance, player.game.field.tileset) self.tileDragEnabled = False self.player = player self.selector = player.game.field.selectorBoard self.setParentItem(player.front) self.setAcceptDrops(True) self.upper... | def __init__(self, player): self.exposedMeldDistance = 0.3 self.concealedMeldDistance = 0.0 self.rowDistance = 0.2 Board.__init__(self, 22.7, 2.0 + self.rowDistance, player.game.field.tileset) self.tileDragEnabled = False self.player = player self.selector = player.game.field.selectorBoard self.setParentItem(player.fro... | 457,438 |
def fget(self): return bool(self.meldDistance) | def fget(self): return bool(self.meldDistance) | 457,439 |
def fset(self, spaceMelds): if spaceMelds != self.spaceMelds: self.meldDistance = 0.3 if spaceMelds else 0.0 self._reload(self.tileset, self._lightSource) self.placeTiles() | def fset(self, spaceMelds): if spaceMelds != self.spaceMelds: self.concealedMeldDistance = self.exposedMeldDistance if spaceMelds else 0.0 self._reload(self.tileset, self._lightSource) self.placeTiles() | 457,440 |
def placeTiles(self): """place all tiles in HandBoard""" self.__removeForeignTiles() flowerY = 0 seasonY = 1.0 + self.rowDistance upperLen = self.__lineLength(self.upperMelds) + self.meldDistance lowerLen = self.__lineLength(self.lowerMelds) + self.meldDistance if upperLen + len(self.flowers) > self.width and lowerLen ... | def placeTiles(self): """place all tiles in HandBoard""" self.__removeForeignTiles() flowerY = 0 seasonY = 1.0 + self.rowDistance upperLen = self.__lineLength(self.upperMelds) + self.exposedMeldDistance lowerLen = self.__lineLength(self.lowerMelds) + self.concealedMeldDistance if upperLen + len(self.flowers) > self.wid... | 457,441 |
def placeTiles(self): """place all tiles in HandBoard""" self.__removeForeignTiles() flowerY = 0 seasonY = 1.0 + self.rowDistance upperLen = self.__lineLength(self.upperMelds) + self.meldDistance lowerLen = self.__lineLength(self.lowerMelds) + self.meldDistance if upperLen + len(self.flowers) > self.width and lowerLen ... | def placeTiles(self): """place all tiles in HandBoard""" self.__removeForeignTiles() flowerY = 0 seasonY = 1.0 + self.rowDistance upperLen = self.__lineLength(self.upperMelds) + self.meldDistance lowerLen = self.__lineLength(self.lowerMelds) + self.meldDistance if upperLen + len(self.flowers) > self.width and lowerLen ... | 457,442 |
def placeTiles(self): """place all tiles in HandBoard""" self.__removeForeignTiles() flowerY = 0 seasonY = 1.0 + self.rowDistance upperLen = self.__lineLength(self.upperMelds) + self.meldDistance lowerLen = self.__lineLength(self.lowerMelds) + self.meldDistance if upperLen + len(self.flowers) > self.width and lowerLen ... | def placeTiles(self): """place all tiles in HandBoard""" self.__removeForeignTiles() flowerY = 0 seasonY = 1.0 + self.rowDistance upperLen = self.__lineLength(self.upperMelds) + self.meldDistance lowerLen = self.__lineLength(self.lowerMelds) + self.meldDistance if upperLen + len(self.flowers) > self.width and lowerLen ... | 457,443 |
def isUpper(self, first=None, last=None): """use first and last as for ranges""" if first is not None: if last is None: return self[first].istitle() else: assert last is None first, last = 0, len(self) return all(self[x].istitle() for x in range(first, last)) | def isUpper(self, first=None, last=None): """use first and last as for ranges""" if first is not None: if last is None: return self[first].istitle() else: assert last is None first, last = 0, len(self) return all(self[x].istitle() for x in range(first, last)) | 457,444 |
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 tile 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 tile specified: return False lastMeld = lastMeld[1].split()[0] lastTile = lastMeld[:2] lastMeld = Meld(lastMeld[2:]) ... | 457,445 |
def __init__(self, player): self.isHandBoard = True self.exposedMeldDistance = 0.2 self.concealedMeldDistance = 0.0 self.rowDistance = 0 Board.__init__(self, 15.4, 2.0 + self.rowDistance, InternalParameters.field.tileset) self.tileDragEnabled = False self.player = player self.setParentItem(player.front) self.setAcceptD... | def __init__(self, player): self.exposedMeldDistance = 0.2 self.concealedMeldDistance = 0.0 self.rowDistance = 0 Board.__init__(self, 15.4, 2.0 + self.rowDistance, InternalParameters.field.tileset) self.tileDragEnabled = False self.player = player self.setParentItem(player.front) self.setAcceptDrops(True) self.upperMel... | 457,446 |
def setWind(self, name, roundsFinished): """change the wind""" self.name = name if isinstance(roundsFinished, bool): self.prevailing = roundsFinished else: self.prevailing = name == WINDS[roundsFinished] self.setBrush(ROUNDWINDCOLOR if self.prevailing else QColor('white')) windtilenr = {'N':1, 'S':2, 'E':3, 'W':4} self... | def setWind(self, name, roundsFinished): """change the wind""" self.name = name if isinstance(roundsFinished, bool): self.prevailing = roundsFinished else: self.prevailing = name == WINDS[roundsFinished] self.setBrush(ROUNDWINDCOLOR if self.prevailing else QColor('white')) windtilenr = {'N':1, 'S':2, 'E':3, 'W':4} self... | 457,447 |
def __init__(self, tableList, callback): Client.__init__(self) self.root = None self.tableList = tableList self.connector = None self.table = None self.readyHandQuestion = None self.loginDialog = LoginDialog() if InternalParameters.autoPlay: self.loginDialog.accept() else: if not self.loginDialog.exec_(): raise Excepti... | def __init__(self, tableList, callback): Client.__init__(self) self.root = None self.tableList = tableList self.connector = None self.table = None self.readyHandQuestion = None self.loginDialog = LoginDialog() if InternalParameters.autoPlay: self.loginDialog.accept() else: if not self.loginDialog.exec_(): raise Excepti... | 457,448 |
def __init__(self, tableList, callback): Client.__init__(self) self.root = None self.tableList = tableList self.connector = None self.table = None self.readyHandQuestion = None self.loginDialog = LoginDialog() if InternalParameters.autoPlay: self.loginDialog.accept() else: if not self.loginDialog.exec_(): raise Excepti... | def __init__(self, tableList, callback): Client.__init__(self) self.root = None self.tableList = tableList self.connector = None self.table = None self.readyHandQuestion = None self.loginDialog = LoginDialog() if InternalParameters.autoPlay: self.loginDialog.accept() else: if not self.loginDialog.exec_(): raise Excepti... | 457,449 |
def sorry(*args): """just output to stdout""" print args | def sorry(none, *args): """just output to stdout""" print args | 457,450 |
def sorry(*args): """just output to stdout""" print args | def sorry(*args): """just output to stdout""" print args | 457,451 |
def __init__(self, swappers): QMessageBox.__init__(self) self.setWindowTitle(m18n("Swap Seats") + ' - Kajongg') self.setText("By the rules, %s and %s should now exchange their seats. " % \ (swappers[0].name, swappers[1].name)) yesAnswer = QPushButton("&Exchange") self.addButton(yesAnswer, QMessageBox.YesRole) noAnswer ... | def __init__(self, swappers): QMessageBox.__init__(self) self.setWindowTitle(m18n("Swap Seats") + ' - Kajongg') self.setText("By the rules, %s and %s should now exchange their seats. " % \ (swappers[0].name, swappers[1].name)) yesAnswer = QPushButton("&Exchange") self.addButton(yesAnswer, QMessageBox.YesRole) noAnswer ... | 457,452 |
def __init__(self, _model, parent): """ Connect to all of the models signals, Whenever anything happens recheck everything. """ QtCore.QObject.__init__(self,parent) self._model = _model self.model = sip.cast(_model, QtCore.QAbstractItemModel) self.insert = [] self.remove = [] self.fetchingMore = False assert(self.model... | def __init__(self, _model, parent): """ Connect to all of the models signals, Whenever anything happens recheck everything. """ QtCore.QObject.__init__(self, parent) self._model = _model self.model = sip.cast(_model, QtCore.QAbstractItemModel) self.insert = [] self.remove = [] self.fetchingMore = False assert(self.mode... | 457,453 |
def __init__(self, _model, parent): """ Connect to all of the models signals, Whenever anything happens recheck everything. """ QtCore.QObject.__init__(self,parent) self._model = _model self.model = sip.cast(_model, QtCore.QAbstractItemModel) self.insert = [] self.remove = [] self.fetchingMore = False assert(self.model... | def __init__(self, _model, parent): """ Connect to all of the models signals, Whenever anything happens recheck everything. """ QtCore.QObject.__init__(self,parent) self._model = _model self.model = sip.cast(_model, QtCore.QAbstractItemModel) self.insert = [] self.remove = [] self.fetchingMore = False assert(self.model... | 457,454 |
def __init__(self, _model, parent): """ Connect to all of the models signals, Whenever anything happens recheck everything. """ QtCore.QObject.__init__(self,parent) self._model = _model self.model = sip.cast(_model, QtCore.QAbstractItemModel) self.insert = [] self.remove = [] self.fetchingMore = False assert(self.model... | def __init__(self, _model, parent): """ Connect to all of the models signals, Whenever anything happens recheck everything. """ QtCore.QObject.__init__(self,parent) self._model = _model self.model = sip.cast(_model, QtCore.QAbstractItemModel) self.insert = [] self.remove = [] self.fetchingMore = False assert(self.model... | 457,455 |
def __init__(self, _model, parent): """ Connect to all of the models signals, Whenever anything happens recheck everything. """ QtCore.QObject.__init__(self,parent) self._model = _model self.model = sip.cast(_model, QtCore.QAbstractItemModel) self.insert = [] self.remove = [] self.fetchingMore = False assert(self.model... | def __init__(self, _model, parent): """ Connect to all of the models signals, Whenever anything happens recheck everything. """ QtCore.QObject.__init__(self,parent) self._model = _model self.model = sip.cast(_model, QtCore.QAbstractItemModel) self.insert = [] self.remove = [] self.fetchingMore = False assert(self.model... | 457,456 |
def nonDestructiveBasicTest(self): """ nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense. """ assert(self.model.buddy(QtCore.QModelIndex()) == QtCore.QModelIndex()) self.model.canFetchMore(QtCore.QMode... | def nonDestructiveBasicTest(self): """ nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense. """ assert(self.model.buddy(QtCore.QModelIndex()) == QtCore.QModelIndex()) self.model.canFetchMore(QtCore.QMode... | 457,457 |
def nonDestructiveBasicTest(self): """ nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense. """ assert(self.model.buddy(QtCore.QModelIndex()) == QtCore.QModelIndex()) self.model.canFetchMore(QtCore.QMode... | def nonDestructiveBasicTest(self): """ nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense. """ assert(self.model.buddy(QtCore.QModelIndex()) == QtCore.QModelIndex()) self.model.canFetchMore(QtCore.QMode... | 457,458 |
def nonDestructiveBasicTest(self): """ nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense. """ assert(self.model.buddy(QtCore.QModelIndex()) == QtCore.QModelIndex()) self.model.canFetchMore(QtCore.QMode... | def nonDestructiveBasicTest(self): """ nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense. """ assert(self.model.buddy(QtCore.QModelIndex()) == QtCore.QModelIndex()) self.model.canFetchMore(QtCore.QMode... | 457,459 |
def rowCount(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::rowCount() and hasChildren() | def rowCount(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::rowCount() and hasChildren() | 457,460 |
def rowCount(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::rowCount() and hasChildren() | def rowCount(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::rowCount() and hasChildren() | 457,461 |
def columnCount(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::columnCount() and hasChildren() """ # check top row topidx = self.model.index(0,0,QtCore.QModelIndex()) assert(self.model.columnCount(topidx) >= 0) | def columnCount(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::columnCount() and hasChildren() """ # check top row topidx = self.model.index(0, 0, QtCore.QModelIndex()) assert(self.model.columnCount(topidx) >= 0) | 457,462 |
def columnCount(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::columnCount() and hasChildren() """ # check top row topidx = self.model.index(0,0,QtCore.QModelIndex()) assert(self.model.columnCount(topidx) >= 0) | def columnCount(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::columnCount() and hasChildren() """ # check top row topidx = self.model.index(0,0,QtCore.QModelIndex()) assert(self.model.columnCount(topidx) >= 0) | 457,463 |
def hasIndex(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::hasIndex() """ # Make sure that invalid values returns an invalid index assert(self.model.hasIndex(-2,-2) == False) assert(self.model.hasIndex(-2,0) == False) assert(self.model.hasIndex(0,-2) == False) | def hasIndex(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::hasIndex() """ # Make sure that invalid values returns an invalid index assert(self.model.hasIndex(-2,-2) == False) assert(self.model.hasIndex(-2,0) == False) assert(self.model.hasIndex(0,-2) == False) | 457,464 |
def hasIndex(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::hasIndex() """ # Make sure that invalid values returns an invalid index assert(self.model.hasIndex(-2,-2) == False) assert(self.model.hasIndex(-2,0) == False) assert(self.model.hasIndex(0,-2) == False) | def hasIndex(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::hasIndex() """ # Make sure that invalid values returns an invalid index assert(self.model.hasIndex(-2,-2) == False) assert(self.model.hasIndex(-2,0) == False) assert(self.model.hasIndex(0,-2) == False) | 457,465 |
def hasIndex(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::hasIndex() """ # Make sure that invalid values returns an invalid index assert(self.model.hasIndex(-2,-2) == False) assert(self.model.hasIndex(-2,0) == False) assert(self.model.hasIndex(0,-2) == False) | def hasIndex(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::hasIndex() """ # Make sure that invalid values returns an invalid index assert(self.model.hasIndex(-2,-2) == False) assert(self.model.hasIndex(-2,0) == False) assert(self.model.hasIndex(0,-2) == False) | 457,466 |
def index(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::index() """ # Make sure that invalid values returns an invalid index assert(self.model.index(-2,-2, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self.model.index(-2,0, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self... | def index(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::index() """ # Make sure that invalid values returns an invalid index assert(self.model.index(-2,-2, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self.model.index(-2,0, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self... | 457,467 |
def index(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::index() """ # Make sure that invalid values returns an invalid index assert(self.model.index(-2,-2, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self.model.index(-2,0, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self... | def index(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::index() """ # Make sure that invalid values returns an invalid index assert(self.model.index(-2,-2, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self.model.index(-2,0, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self... | 457,468 |
def index(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::index() """ # Make sure that invalid values returns an invalid index assert(self.model.index(-2,-2, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self.model.index(-2,0, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self... | def index(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::index() """ # Make sure that invalid values returns an invalid index assert(self.model.index(-2,-2, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self.model.index(-2,0, QtCore.QModelIndex()) == QtCore.QModelIndex()) assert(self... | 457,469 |
def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | 457,470 |
def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | 457,471 |
def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | 457,472 |
def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | 457,473 |
def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | def parent(self): """ Tests self.model's implementation of QtCore.QAbstractItemModel::parent() """ # Make sure the self.model wont crash and will return an invalid QtCore.QModelIndex # when asked for the parent of an invalid index assert(self.model.parent(QtCore.QModelIndex()) == QtCore.QModelIndex()) | 457,474 |
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,475 |
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,476 |
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,477 |
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,478 |
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,479 |
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,480 |
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,481 |
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,482 |
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,483 |
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,484 |
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(self.model.index(start-1, 0, parent)) c['next'] = self.model.data(self.model.index(start, 0,... | def rowsAboutToBeInserted(self, parent, start, dummyEnd): """ 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(self.model.index(start-1, 0, parent)) c['next'] = self.model.data(self.model.index(star... | 457,485 |
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(self.model.index(start-1, 0, parent)) c['next'] = self.model.data(self.model.index(start, 0,... | 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(self.model.index(start-1, 0, parent)) c['next'] = self.model.data(self.model.index(start, 0,... | 457,486 |
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(self.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(self.model.index(start-1, 0, c['parent']))) | 457,487 |
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(self.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(self.model.index(start-1, 0, c['parent']))) | 457,488 |
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(self.model.index(start-1, 0, parent)) c['next'] = self.model.data(self.model.index(end+1, 0, ... | 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(self.model.index(start-1, 0, parent)) c['next'] = self.model.data(self.model.index(end+1, 0, ... | 457,489 |
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(self.model.index(start-1, 0, c['parent']))) asser... | 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(self.model.index(start-1, 0, c['parent']))) asser... | 457,490 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,491 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,492 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,493 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,494 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,495 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,496 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,497 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,498 |
def checkChildren(self, parent, depth = 0): """ Called from parent() test. | def checkChildren(self, parent, depth = 0): """ Called from parent() test. | 457,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.