Package pyfics
[hide private]

Package pyfics

source code

pyfics - Python interface to ics chess servers.

Requirements

Examples

A simple example:
>>> from twisted.internet.protocol import ReconnectingClientFactory
>>> from twisted.internet import reactor
>>> from pyfics.protocols import InteractiveIcsParsingProtocol
>>> from pyfics.parser import ficsparser
>>> from pyfics.server import fics
>>> ics = fics.Fics()
>>> ics.login = 'username'
>>> ics.password = 'password'
>>>
>>> class MyProtocol(InteractiveIcsParsingProtocol):
...     delimiters = [ 'fics% ', ]
...     server = ics
...     parser = ficsparser
...
...     def datagramReceived(self, data):
...         print repr(data)
...
>>> c = ReconnectingClientFactory
>>> c.protocol = MyProtocol
>>>
>>> reactor.connectTCP('freechess.org', 5000, c())
>>> reactor.run()



Version: 0.1

Author: Ali Polatel <polatel@gmail.com>

Copyright: Copyright (c) 2006-2007 Ali Polatel

License: GPL-3

Submodules [hide private]