pyfingerd structure#
pyfingerd’s conception is centered around the server class, which is either one of:
pyfingerd.server.FingerBaseServer
Base server class, mostly useful if you want to handle requests with your custom handler.
pyfingerd.server.FingerServer
Server class implementing the traditional usage of the finger protocol.
In the second case, pyfingerd uses the Adapter design pattern to implement interaction with the user accounting databases and output formatting.
A class diagram representing a simplified version of the structure is the following:
Interfaces#
An interface provides the data presented by the server to the client.
Interfaces in pyfingerd are subclasses of
pyfingerd.core.FingerInterface
. Interfaces must override
the methods from this class, mostly the one to search for users, in
order to provide data from their source.
Usable interfaces throughout pyfingerd are the following:
pyfingerd.core.FingerInterface
Base class and dummy interface, doesn’t transmit nor yield any user results.
pyfingerd.fiction.FingerScenarioInterface
Interface following a scenario; see Fictional interfaces for more information.
pyfingerd.posix.FingerPOSIXInterface
Interface using the POSIX user accounting databases.
pyfingerd.native.FingerNativeInterface
Interface bound to the one using native system interface:
pyfingerd.posix.FingerPOSIXInterface
if on Linux or *BSD.pyfingerd.core.FingerInterface
by default.
Formatters#
A formatter takes data obtained by the server for a given request through its interface, and presents it using text.
Formatters in pyfingerd are subclasses of
pyfingerd.core.FingerFormatter
. Existing formatters
throughout pyfingerd are the following:
pyfingerd.core.FingerFormatter
Base class, outputs similarly to RFC 1288.