pychess.ic package

Submodules

pychess.ic.FICSConnection module

pychess.ic.FICSObjects module

exception pychess.ic.FICSObjects.AlreadyExistException

Bases: Exception

class pychess.ic.FICSObjects.FICSAdjournedGame(wplayer, bplayer, our_color=None, length=None, time=None, rated=False, game_type=None, private=False, minutes=None, inc=None, result=7, reason=None, board=None, relation=None, gameno=None)

Bases: pychess.ic.FICSObjects.FICSGame

display_time
opponent
class pychess.ic.FICSObjects.FICSBoard(wms, bms, fen=None, pgn=None)

Bases: object

class pychess.ic.FICSObjects.FICSChallenge(index, player, minutes, inc, rated, color, game_type, adjourned=False)

Bases: pychess.ic.FICSObjects.FICSSoughtMatch

class pychess.ic.FICSObjects.FICSChallenges(connection)

Bases: GObject

clear()
onChallengeIssued(om, challenge)
onChallengeRemoved(om, index)
onPlayingGame(bm, game)
start()
class pychess.ic.FICSObjects.FICSGame(wplayer, bplayer, gameno=None, game_type=None, rated=False, minutes=None, inc=None, result=None, reason=None, board=None, private=False, relation=None)

Bases: pychess.ic.FICSObjects.FICSMatch

get_private()
set_private(private)
update(game)
display_text
private = <GObjectMock name='mock.property()' id='139752463286904'>
supported
class pychess.ic.FICSObjects.FICSGames(connection)

Bases: GObject

game_ended(game)
get(game, create=True, emit=True)
get_game_by_gameno(gameno)
items()
keys()
onAdjournmentsList(adm, adjournments)
onCurGameEnded(bm, game)
onHistoryList(adm, history)
onJournalList(adm, journal)
start()
values()
class pychess.ic.FICSObjects.FICSHistoryGame(wplayer, bplayer, time=None, rated=False, game_type=None, private=False, minutes=None, inc=None, result=None, reason=None, board=None, relation=None, wrating=None, brating=None, gameno=None, history_no=None)

Bases: pychess.ic.FICSObjects.FICSGame

display_time
class pychess.ic.FICSObjects.FICSJournalGame(wplayer, bplayer, our_color=None, time=None, rated=False, game_type=None, private=False, minutes=None, inc=None, result=None, reason=None, board=None, relation=None, wrating=None, brating=None, gameno=None, journal_no=None)

Bases: pychess.ic.FICSObjects.FICSGame

display_time
class pychess.ic.FICSObjects.FICSMatch(minutes, inc, rated, game_type)

Bases: GObject

display_rated
display_timecontrol
sortable_time
class pychess.ic.FICSObjects.FICSPlayer(name, online=False, status=10, game=None, titles=None)

Bases: GObject

display_titles(long=False)
getIcon(size=16, gametype=None)
classmethod getIconByRating(rating, size=16)
getMarkup(gametype=None, big=True, long_titles=True)
getRatingByGameType(game_type)
getRatingForCurrentGame()
getRatingMean()
getStrength()
get_game()
get_online()
get_status()
get_titles()
isAdmin()
isAvailableForGame()
isComputer()
isGuest()
isObservable()
isTitled()
long_name(game_type=None)
restore_previous_status()
set_game(game)
set_online(online)
set_status(status)
set_titles(titles)
atomic
blitz
bughouse
crazyhouse
display_online
display_status
game = <GObjectMock name='mock.property()' id='139752463286904'>
lightning
losers
online = <GObjectMock name='mock.property()' id='139752463286904'>
standard
status = <GObjectMock name='mock.property()' id='139752463286904'>
suicide
titles = <GObjectMock name='mock.property()' id='139752463286904'>
wild
class pychess.ic.FICSObjects.FICSPlayers(connection)

Bases: GObject

get(name)
get_online_playernames()
items()
keys()
online_changed(player, prop)
player_disconnected(name)
start()
values()
class pychess.ic.FICSObjects.FICSSeek(index, player, minutes, inc, rated, color, game_type, rmin=0, rmax=9999, automatic=True, formula=False)

Bases: pychess.ic.FICSObjects.FICSSoughtMatch

class pychess.ic.FICSObjects.FICSSeeks(connection)

Bases: GObject

clear()
onAddSeek(glm, seek)
onClearSeeks(glm)
onCurGameEnded(bm, game)
onRemoveSeek(glm, index)
start()
class pychess.ic.FICSObjects.FICSSoughtMatch(index, player, minutes, inc, rated, color, game_type)

Bases: pychess.ic.FICSObjects.FICSMatch

player_rating

This returns self.player’s rating for the type of match being sought. If self.player doesn’t have a rating for the type of match being sought, this returns 0. If the match is untimed we use self.player’s standard time-control rating if they have one.

pychess.ic.FICSObjects.get_challenge_tooltip_text(challenge)
pychess.ic.FICSObjects.get_player_tooltip_text(player, show_status=True)
pychess.ic.FICSObjects.get_rating_range_display_text(rmin=0, rmax=9999)
pychess.ic.FICSObjects.get_seek_tooltip_text(seek)
pychess.ic.FICSObjects.get_soughtmatch_tooltip_text(sought)
pychess.ic.FICSObjects.make_sensitive_if_available(button, player)
pychess.ic.FICSObjects.make_sensitive_if_playing(button, player)
pychess.ic.FICSObjects.player_id(name)

Two players are equal if the first 11 characters of their name match. This is to facilitate matching players from output of commands like the ‘games’ command which only return the first 11 characters of a player’s name

pychess.ic.ICGameModel module

class pychess.ic.ICGameModel.ICGameModel(connection, ficsgame, timemodel)

Bases: pychess.Utils.GameModel.GameModel

acceptReceived(player, offer)
backToMainLine()
checkStatus()

Updates self.status so it fits with what getStatus(boards[-1]) would return. That is, if the game is e.g. check mated this will call mode.end(), or if moves have been undone from an otherwise ended position, this will call __resume and emit game_unended.

end(status, reason)
ficsplayer(player)
goFirst()
goLast()
goNext(step=1)
goPrev(step=1)
hasGuestPlayers()
offerReceived(player, offer)
onActionError(om, offer, error)
onBoardSetup(bm, gameno, fen, wname, bname)
onDisconnected(connection)
onExGameReset(bm, ficsgame)
onGameEnded(bm, ficsgame)
onGamePaused(bm, gameno, paused)
onGameUndoing(bm, gameno, ply)
onKibitzMessage(cm, name, gameno, text)
onMadeExamined(bm, gameno)
onMadeUnExamined(bm, gameno)
onObserversReceived(other, gameno, observers)
onTimesUpdate(bm, gameno, wms, bms)
onWhisperMessage(cm, name, gameno, text)
setPlayers(players)
terminate()
update_board(gameno, ply, curcol, lastmove, fen, wname, bname, wms, bms)
display_text
noTD
remote_ficsplayer
remote_player

pychess.ic.ICLogon module

pychess.ic.TimeSeal module

exception pychess.ic.TimeSeal.CanceledException

Bases: Exception

class pychess.ic.TimeSeal.ICSStreamReader(limit, loop, connected_event, name)

Bases: asyncio.streams.StreamReader

read_until(*untils)
class pychess.ic.TimeSeal.ICSStreamReaderProtocol(stream_reader, client_connected_cb, loop, name, timeseal)

Bases: asyncio.streams.StreamReaderProtocol

cook_some(data)
data_received(data)

Called when some data is received.

The argument is a bytes object.

decode(buf, stateinfo=None)
encode(inbuf, timestamp=None)
class pychess.ic.TimeSeal.ICSTelnet(timeseal)

Bases: object

cancel()
close()
get_init_string()

timeseal header: TIMESTAMP|bruce|Linux gruber 2.6.15-gentoo-r1 #9 PREEMPT Thu Feb 9 20:09:47 GMT 2006 i686 Intel(R) Celeron(R) CPU 2.00GHz GenuineIntel GNU/Linux| 93049

read_until(*untils)
readline()
readuntil(until)
start(host, port, connected_event)
write(string)
sensitive = False

pychess.ic.VerboseTelnet module

class pychess.ic.VerboseTelnet.ConsoleHandler(callback)

Bases: object

handle(line)
class pychess.ic.VerboseTelnet.FromABPlusPrediction(callback, regexp0, regexp1, regexp2)

Bases: pychess.ic.VerboseTelnet.MultipleLinesPrediction

handle(line)
class pychess.ic.VerboseTelnet.FromPlusPrediction(callback, regexp0, regexp1)

Bases: pychess.ic.VerboseTelnet.MultipleLinesPrediction

handle(line)
class pychess.ic.VerboseTelnet.FromToPrediction(callback, regexp0, regexp1)

Bases: pychess.ic.VerboseTelnet.MultipleLinesPrediction

handle(line)
class pychess.ic.VerboseTelnet.LinePrediction(callback, regexp)

Bases: pychess.ic.VerboseTelnet.Prediction

handle(line)
class pychess.ic.VerboseTelnet.MultipleLinesPrediction(callback, *regexps)

Bases: pychess.ic.VerboseTelnet.Prediction

class pychess.ic.VerboseTelnet.NLinesPrediction(callback, *regexps)

Bases: pychess.ic.VerboseTelnet.MultipleLinesPrediction

handle(line)
class pychess.ic.VerboseTelnet.Prediction(callback, *regexps)

Bases: object

class pychess.ic.VerboseTelnet.PredictionsTelnet(telnet, predictions, reply_cmd_dict, replay_dg_dict, replay_cn_dict)

Bases: object

cancel()
close()
parse()
run_command(text, show_reply=False)
test_prediction(prediction, line)
class pychess.ic.VerboseTelnet.TelnetLine(line, code, code_type)

Bases: tuple

code

Alias for field number 1

code_type

Alias for field number 2

line

Alias for field number 0

class pychess.ic.VerboseTelnet.TelnetLines(telnet, show_reply)

Bases: object

appendleft(x)
extendleft(iterable)
popleft()

Module contents

class pychess.ic.GameType(fics_name, short_fics_name, rating_type, display_text=None, variant_type=0)

Bases: object

variant
class pychess.ic.NormalGameType(fics_name, short_fics_name, rating_type, display_text)

Bases: pychess.ic.GameType

class pychess.ic.VariantGameType(fics_name, short_fics_name, rating_type, variant_type)

Bases: pychess.ic.GameType

display_text
seek_text
class pychess.ic.WildGameType(fics_name, variant_type)

Bases: pychess.ic.VariantGameType

classmethod instances()
pychess.ic.get_infobarmessage_content(player, text, gametype=None)
pychess.ic.get_infobarmessage_content2(player, heading_text, message_text, gametype=None)
pychess.ic.parseRating(rating)
pychess.ic.parse_title_hex(titlehex)
pychess.ic.time_control_to_gametype(minutes, gain)
pychess.ic.type_to_display_text(typename)