Hello community, here is the log from the commit of package kajongg for openSUSE:Factory checked in at 2013-10-03 15:49:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kajongg (Old) and /work/SRC/openSUSE:Factory/.kajongg.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "kajongg" Changes: -------- --- /work/SRC/openSUSE:Factory/kajongg/kajongg.changes 2013-09-09 11:09:58.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kajongg.new/kajongg.changes 2013-10-03 15:49:51.000000000 +0200 @@ -1,0 +2,7 @@ +Sat Sep 28 15:38:58 UTC 2013 - tittiatcoke@gmail.com + +- Update to 4.11.2 + * KDE 4.11.2 bugfix release + * See http://www.kde.org/announcements/announce-4.11.2.php + +------------------------------------------------------------------- Old: ---- kajongg-4.11.1.tar.xz New: ---- kajongg-4.11.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kajongg.spec ++++++ --- /var/tmp/diff_new_pack.JpajTG/_old 2013-10-03 15:49:52.000000000 +0200 +++ /var/tmp/diff_new_pack.JpajTG/_new 2013-10-03 15:49:52.000000000 +0200 @@ -25,7 +25,7 @@ License: GPL-2.0+ Group: Amusements/Games/Board/Puzzle Url: http://www.kde.org -Version: 4.11.1 +Version: 4.11.2 Release: 0 Source0: kajongg-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ kajongg-4.11.1.tar.xz -> kajongg-4.11.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kajongg-4.11.1/src/client.py new/kajongg-4.11.2/src/client.py --- old/kajongg-4.11.1/src/client.py 2013-08-28 19:10:33.000000000 +0200 +++ new/kajongg-4.11.2/src/client.py 2013-09-26 21:26:19.000000000 +0200 @@ -20,6 +20,8 @@ from PyQt4.QtCore import QTimer from twisted.spread import pb +from twisted.internet import reactor +from twisted.internet.task import deferLater from twisted.internet.defer import Deferred, succeed, DeferredList from twisted.python.failure import Failure from util import logDebug, logException, logWarning, Duration @@ -287,8 +289,34 @@ def ask(self, move, answers): """this is where the robot AI should go. sends answer and one parameter to server""" + delay = 0.0 + delayStep = 0.1 + def delayed(result, delay): + """try again, may we chow now?""" + noClaimCount = 0 + delay += delayStep + for move in self.game.lastMoves(): + # latest move first + if move.message == Message.Discard: + break + elif move.message == Message.PopupMsg and move.msg == 'No Claim': + noClaimCount += 1 + if noClaimCount == 2: + # everybody said "I am not interested", so we claim chow now + return result + elif move.message == Message.PopupMsg and move.msg in ('Pung', 'Kong'): + # somebody said Pung or Kong, so we suppress our Chow + return + if delay < self.game.ruleset.claimTimeout * 0.95: + # one of those slow humans is still thinking + return deferLater(reactor, delayStep, delayed, result, delay) + return result self.computeSayable(move, answers) - return succeed(self.intelligence.selectAnswer(answers)) + result = self.intelligence.selectAnswer(answers) + if result[0] == Message.Chow: + # wait to see if somebody says Pung or Kong + return deferLater(reactor, delayStep, delayed, result, delay) + return succeed(result) def thatWasMe(self, player): """returns True if player == myself""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kajongg-4.11.1/src/game.py new/kajongg-4.11.2/src/game.py --- old/kajongg-4.11.1/src/game.py 2013-08-28 19:10:33.000000000 +0200 +++ new/kajongg-4.11.2/src/game.py 2013-09-26 21:26:19.000000000 +0200 @@ -733,6 +733,8 @@ elif without: if move.message not in without: yield move + else: + yield move def throwDices(self): """sets random living and kongBox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kajongg-4.11.1/src/message.py new/kajongg-4.11.2/src/message.py --- old/kajongg-4.11.1/src/message.py 2013-06-28 19:42:24.000000000 +0200 +++ new/kajongg-4.11.2/src/message.py 2013-09-26 21:26:19.000000000 +0200 @@ -134,7 +134,7 @@ return '<br><br>'.join(txt), warn, '' class MessagePung(PungChowMessage, ServerMessage): - """somebody said pung""" + """somebody said pung and gets the tile""" def __init__(self): PungChowMessage.__init__(self, name=m18ncE('kajongg','Pung'), @@ -147,7 +147,7 @@ return client.claimed(move) class MessageKong(NotifyAtOnceMessage, ServerMessage): - """somebody said kong""" + """somebody said kong and gets the tile""" def __init__(self): NotifyAtOnceMessage.__init__(self, name=m18ncE('kajongg','Kong'), @@ -182,7 +182,7 @@ return client.declared(move) class MessageChow(PungChowMessage, ServerMessage): - """somebody said chow""" + """somebody said chow and gets the tile""" def __init__(self): PungChowMessage.__init__(self, name=m18ncE('kajongg','Chow'), @@ -206,7 +206,7 @@ table.pickTile() class MessageMahJongg(NotifyAtOnceMessage, ServerMessage): - """somebody sayd mah jongg""" + """somebody sayd mah jongg and wins""" sendScore = True def __init__(self): NotifyAtOnceMessage.__init__(self, @@ -544,10 +544,10 @@ """returns text and warning flag for button and text for tile for button and text for tile""" return m18n('Confirm that you saw the message'), False, '' -class MessageNoClaim(ClientMessage): - """A player does not claim""" +class MessageNoClaim(NotifyAtOnceMessage, ServerMessage): + """A player explicitly says he will not claim a tile""" def __init__(self): - ClientMessage.__init__(self, + NotifyAtOnceMessage.__init__(self, name=m18ncE('kajongg','No Claim'), shortcut=m18ncE('kajongg game dialog:Key for No claim', 'N')) def toolTip(self, dummyButton, dummyTile): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kajongg-4.11.1/src/playfield.py new/kajongg-4.11.2/src/playfield.py --- old/kajongg-4.11.1/src/playfield.py 2013-08-28 19:10:33.000000000 +0200 +++ new/kajongg-4.11.2/src/playfield.py 2013-09-26 21:26:19.000000000 +0200 @@ -23,7 +23,7 @@ from util import logError, m18n, m18nc, isAlive, logWarning from common import WINDS, LIGHTSOURCES, InternalParameters, Preferences import cgitb, tempfile, webbrowser -from twisted.internet.defer import succeed +from twisted.internet.defer import succeed, fail from twisted.python.failure import Failure class MyHook(cgitb.Hook): @@ -408,10 +408,11 @@ def popupMsg(self, msg): """shows a yellow message from player""" - self.speak(msg.lower()) - yellow = self.front.message - yellow.setText(' '.join([unicode(yellow.msg), m18nc('kajongg', msg)])) - yellow.setVisible(True) + if msg != 'No Claim': + self.speak(msg.lower()) + yellow = self.front.message + yellow.setText(' '.join([unicode(yellow.msg), m18nc('kajongg', msg)])) + yellow.setVisible(True) def hidePopup(self): """hide the yellow message from player""" @@ -616,7 +617,7 @@ return self.abortGame() else: self.actionAutoPlay.setChecked(demoMode) - return succeed(None) # just continue + return fail(None) # just continue if not self.game: self.startingGame = False return succeed(None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kajongg-4.11.1/src/rule.py new/kajongg-4.11.2/src/rule.py --- old/kajongg-4.11.1/src/rule.py 2013-08-28 19:10:33.000000000 +0200 +++ new/kajongg-4.11.2/src/rule.py 2013-09-26 21:26:19.000000000 +0200 @@ -568,7 +568,7 @@ Query.dbhandle.transaction() self.remove() if not Query('INSERT INTO %s(id,name,hash,description) VALUES(?,?,?,?)' % self.__rulesetTable(), - list([self.rulesetId, english(self.name), self.hash, self.description])).success: + list([self.rulesetId, english(self.name).decode('utf-8'), self.hash, self.description])).success: Query.dbhandle.rollback() return False result = Query('INSERT INTO %s(ruleset, name, list, position, definition, ' -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org