Utility modules

This submodule contains utility functions and classes used in PyIRC that perform non-IRC related functions, but are nonetheless needed for our purposes to make things easier.

classutil

Utilities for class metaprogramming and related purposes

PyIRC.util.classutil.private_mangle(cls, name)

Generate a private name based on the given name

Parameters:
  • cls -- Class (instance or not) to use for the mangling
  • name -- Name to mangle.

enum

class PyIRC.util.enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

class PyIRC.util.enum.IntEnum

Enum where members are also (and must be) ints

PyIRC.util.enum.unique(enumeration)

Class decorator for enumerations ensuring unique member values.

version

PyIRC version information

class PyIRC.util.version.Version(major, minor, status, gitversion)
gitversion

Alias for field number 3

major

Alias for field number 0

minor

Alias for field number 1

status

Alias for field number 2

PyIRC.util.version.version = Version(major=3, minor=0, status='alpha', gitversion='e962c47')

Current PyIRC version

Attributes:
major: Current major version. Set to 3 for PyIRC 3. minor: Current minor version. status: Release status (alpha, beta, release) gitversion: Current git revision, may be set to "unknown"
PyIRC.util.version.versionstr = '3.0-a[e962c47]'

Current PyIRC version string. Obtained from the package whenever possible, but may be generated from constants.

Warning

Do not rely on this format remaining stable, use :py:data::~PyIRC.util.version.version instead!