Carrom tournaments management
Homepage Repository PyPI Python
pip install SoL==5.22
This project contains some tools that make it easier the organization of a championship of Carrom tournaments using a variant of the Swiss system, or even everyone against everyone events.
The main component is a Pyramid application serving two distinct user interfaces:
Attention!
SoL 3 requires Python 3.3 or higher, it does not work with Python 2
Warning
SoL 3.1+ requires SQLite 3.8 or higher
Contents
These are the key points:
Multilingual application
Scarry spoke only Italian, because the i18n mechanism in Delphi (and in general under Windows) sucks. Most of the code was written and commented in Italian too, and that made it very difficult to get foreign contributions
Multiuser
There is a super user (named “admin” by default) that can do everything, in particular assign a nickname and a password to any player, who can then log in and manage her own tournaments, but can't change information owned by other users
Real database
Scarry used Paradox tables, but we are in the third millennium, now: SoL uses a real, even if simple and light, SQL database under its skin
Easy to use
The application is usually driven by computer-illiterated guys, so little to no surprises
Easy to deploy
Gods know how many hours went in building f*cking installers with BDE goodies
Bring back the fun
Programming in Python is just that, since the beginning
The application implements the following features:
The very first requirement to install an instance of SoL on your own machine is getting Python 3.5 or better[1]. This step obviously depends on the operating system you are using: on most GNU/Linux distributions it is already available[2], for example on Debian and derivatives like Ubuntu the following command will do the task:
$ apt-get install python3
If instead you are using M$-Windows, you should select the right installer from the downloads page on http://www.python.org/.
Non pure Python packages and Windows
The most problematic thing on Windows is being able to install all the required packages:
a few of them are actually written in C and there are chances that your particular
combination of Python version and Windows version (32bit vs 64bit in particular) isn't
supported by the respective authors.
If the installation fails because a suitable package cannot be found, your only option (other than bugging me) is to install the needed development tools on your machine and retry the installation: the installer should be able to figure out the details and compile the modules.
Since a couple of years Microsoft started to pay attention to the Python world, and actually released a trimmed down version of its development suites expressly to compile Python 2 extension modules, but nothing equivalent is available for Python 3 yet. Instead, you need to install the complete Visual Studio suite in particular, for Python 3.5, the Visual Studio 2015 Community Edition.
Another recommended, although optional, add-on is the DejaVu fonts set, to support a rather wide range of glyphs when producing the PDFs printouts. As usual, on GNU/Linux it's a matter of executing the following command
$ apt-get install fonts-dejavu
or equivalent for your distribution, while on M$-Windows you need to download them and
extract the archive in the right location which usually is C:\Windows\Fonts.
The easiest way is using SoLista, a buildout configuration that will perform most of the needed steps with a few clicks: this is particularly indicated if you are not fluent with the command line interface of your operating system.
Follow the hopefully clear enough steps in SoLista's README.
Note
This is a work-in-progress facility: better documentation and helper tools are on the way! It targets brave souls willing to face a bleeding edge experience.
Current state is based on the work contributed by Amar Sanakal, thank you!
Another option, if you have a 64bit computer, is to run the pre-built Docker image.
First of all, you must enable the hardware virtualization in the BIOS of your computer.
Then you can proceed to install the Docker Engine for your particular operating system
(that is, GNU/Linux, Windows or Mac OS X).
After you have tested the install in the Docker Quickstart terminal (for example as
depicted here), run the following command in the same window:
docker run -d -p 80:6996 --name sol amarsanakal/solista
This will start the software and is now accessible on port 80. You can access it as
http://<ip-address>.
The <ip-address> is the ip address of the docker machine running on your PC. This would
have been displayed to you when you launched the Docker Quickstart terminal. You can check it
anytime by running:
docker-machine ls
the ip address is shown under the URL column. Use that without the port number shown there. See https://docs.docker.com/machine/get-started/ for more details.
If you are a developer and want to play with Docker, you can checkout SoL sources and
make docker-build
make docker-change-admin
make docker-start, then visit
http://localhost:6996/ as usualSee Makefile.docker for other related targets.
Install SoL using pip:
pip install SoL
that will download the latest version of SoL from PyPI and all its dependencies as well
Install ExtJS 4.2.1:
python3 -m metapensiero.extjs.desktop
Create a standard config file:
soladmin create-config config.ini
and edit it as appropriate; you can also directly specify the name and the password of the
super user (by default the name is admin and the password will be asked
interactively):
soladmin create-config --admin differentone --password str4nge
Setup the database:
soladmin initialize-db config.ini
Load official data:
soladmin restore config.ini
Run the application server:
pserve config.ini
Enjoy!
firefox http://localhost:6996/
or, for poor Window$ users or just because using Python makes you happier:
python -m webbrowser http://localhost:6996/
The complete sources are available on Bitbucket and can be downloaded with the following command:
git clone https://bitbucket.org/lele/sol
I recommend using a virtual environment to keep you isolated from the system packages:
python3 -m venv env source env/bin/activate
After that, you can setup a development environment by executing the command:
pip install -r requirements/development.txt
You must then install the required ExtJS 4 sources executing:
python -m metapensiero.extjs.desktop --src
If you are a developer, you are encouraged to create your own fork of the software and possibly open a pull request: I will happily merge your changes!
You can run the test suite with either
make test
or
python setup.py nosetests
Currently SoL is translated in English[3], French and Italian. If you know other languages and want to contribute, the easiest way to create a new translation is to create an account on the Weblate site and follow its translators guide.
Otherwise if like me you prefer using more traditional tools[4] you can extract a copy of
the sources and operate directly on the local catalogs under the directory src/sol/locale.
To extract translatable messages use the following command:
make update-catalogs
To check your work you must compile them with:
make compile-catalogs
If you run in troubles, or want to suggest something, or simply a desire of saying “Thank
you” raises up, feel free to contact me via email as lele at metapensiero dot it.
Consider also joining the dedicated mailing list where you can get in contact with other users of the application. There is also an issues tracker where you can open a new tickets about bugs or enhancements.
| [1] | As of this writing I'm using version 3.5.1 and I'd recommend using that, but SoL used to work great with Python 3.3 and Python 3.4 as well. |
| [2] | In fact it may even be already installed! |
| [3] | The are actually two distinct catalogs, to take into account US and UK variants. |
| [4] | GNU Emacs comes to mind of course, but there are zillions of them: start looking at the gettext page on Wikipedia. |