This is the eleventh part of the Twisted tutorial Twisted from Scratch, or The Evolution of Finger.
In this part, we make it easier for non-programmers to configure a finger server, and show how to package it in the .deb and RPM package formats.
So far, the user had to be somewhat of a programmer to be able to configure stuff. Maybe we can eliminate even that? Move old code to finger/__init__.py and...
Full source code for finger module here: finger module
finger/tap.pyAnd register it all:
finger/plugins.tmlAnd now, the following works
% mktap finger --file=/etc/users --ircnick=fingerbot % sudo twistd -nf finger.tap
If we already have the finger
package installed in
PYTHONPATH (e.g. we added it to site-packages), we can achieve easy
integration:
% tap2deb --unsigned -m "Foo <foo@example.com>" --type=python finger.tac % sudo dpkg -i .build/*.deb
% tap2rpm --type=python finger.tac #[maybe other options needed] % sudo rpm -i .build/*.rpm
Will properly register the tap/tac, init.d scripts, etc. for the given file.
If it doesn't work on your favorite OS: patches accepted!