Getting sid
------------
-Currently unreleased, only a development version is available.
+Currently unreleased on PyPi_.
- http://git.kaliko.me/?p=sid.git
+`git tagged` version and `master branch` should be stable though.
-Getting the latest source code
-------------------------------
+* Doc: https://kaliko.gitlab.io/sid/
+* git: https://gitlab.com/kaliko/sid.git
+* Issue: https://gitlab.com/kaliko/sid/-/issues
-If you would instead like to use the latest source code, you can grab a copy
-of the development version from git by running the command:
- git clone git://git.kaliko.me/sid.git
-
-
-Installing from source
-----------------------
-
-To install sid from source, simply run the command (within a virtualenv preferably)::
+Get the source with git::
- python3 setup.py install
+ git clone git://git.kaliko.me/sid.git
-You can use the `--help` switch to `setup.py` for a complete list of commands
-and their options. See the `Installing Python Modules`_ document for more details.
+Install/update master from git::
+ pip install -U git+https://gitlab.com/kaliko/sid.git@master#egg=sid
Using the bot
-------------
Here is a plain example::
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
+ #!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+
+ import getpass
+ import logging
+ from sid.sid import MUCBot
+ from sid.ping import Ping
- import getpass
- from sid.sid import MUCBot
- from sid.ping import Ping
+ logging.basicConfig(level=args.loglevel,
+ format='%(levelname)-8s %(message)s')
- JID = 'bot@example.org'
- NICK = 'sid'
- PASS = getpass.getpass('Password for "{}": '.format(JID))
- ROOM = 'room@conf.example.org'
+ JID = 'bot@example.org'
+ ROOM = 'room@conf.example.org'
+ # Pay attention: if you join the room with the same account/nick,
+ # For instance with a regular interactive client, the bot will
+ # not answer you, it ignores its own messages for obvious reasons.
+ NICK = 'sid'
+ PASS = getpass.getpass(f'Password for "{JID}": ')
- xmpp = MUCBot(JID, PASS, ROOM, NICK)
- xmpp.register_bot_plugin(Ping)
- # Connect to the XMPP server and start processing XMPP stanzas.
- if xmpp.connect():
- xmpp.process(block=True)
- xmpp.shutdown_plugins()
- xmpp.log.info('Done')
- else:
- xmpp.log.info('Unable to connect.')
+ # Instanciate the bot
+ xmpp = MUCBot(JID, PASS, ROOM, NICK)
+ # Register a plugin
+ xmpp.register_bot_plugin(Ping)
+ # Connect to the XMPP server and start processing XMPP stanzas.
+ try:
+ xmpp.connect()
+ xmpp.process()
+ except KeyboardInterrupt:
+ xmpp.shutdown_plugins()
-Contacting authors
-------------------
+
+Contacting author
+-----------------
The current maintainer can be found on xmpp chat room <kaliko.me⊘conf.azylum.org>
or you can contact him by email/xmpp <kaliko⊘azylum.org>.
- .. _Installing Python Modules: http://docs.python.org/3/install/
-
+.. _PyPI: https://pypi.org