k.utils : module documentation

Part of kiwi

GObject utilities and addons
Function list_properties Return a list of all properties for GType gtype, excluding
Function type_register Register the type, but only if it's not already registered
Class PropertyMeta Metaclass that takes into account properties and signals
Class PropertyObject I am an object which maps GObject properties to attributes
Function gsignal Add a GObject signal to the current object.
Function gproperty Add a GObject property to the current object.
Function quote Similar to urllib.quote but for glibs GMarkup
Class _GObjectClassInittableMetaType Undocumented
Class _GobjectClassInittableObject Undocumented
Function _max Undocumented
def list_properties(gtype, parent=True):
Return a list of all properties for GType gtype, excluding properties in parent classes
def type_register(gtype):
Register the type, but only if it's not already registered
Parametersgtypethe class to register
def gsignal(name, *args, **kwargs):

Add a GObject signal to the current object. It current supports the following types:

  • str, int, float, long, object, enum
Parametersnamename of the signal (type: string )
argstypes for signal parameters, if the first one is a string 'override', the signal will be overridden and must therefor exists in the parent GObject.
Notesflags: A combination of;
  • gobject.SIGNAL_RUN_FIRST
  • gobject.SIGNAL_RUN_LAST
  • gobject.SIGNAL_RUN_CLEANUP
  • gobject.SIGNAL_NO_RECURSE
  • gobject.SIGNAL_DETAILED
  • gobject.SIGNAL_ACTION
  • gobject.SIGNAL_NO_HOOKS
retval: return value in signal callback
def _max(c):
Undocumented
def gproperty(name, ptype, default=None, nick='', blurb='', flags=gobject.PARAM_READWRITE, **kwargs):
Add a GObject property to the current object.
Parametersnamename of property (type: string )
ptypetype of property (type: type )
defaultdefault value
nickshort description
blurblong description
flagsparameter flags, a combination of:
  • PARAM_READABLE
  • PARAM_READWRITE
  • PARAM_WRITABLE
  • PARAM_CONSTRUCT
  • PARAM_CONSTRUCT_ONLY
  • PARAM_LAX_VALIDATION

Optional, only for int, float, long types:

Notesminimum: minimum allowed value
maximum: maximum allowed value
def quote(msg):
Similar to urllib.quote but for glibs GMarkup
Parametersmsgstring to quote
Returnsquoted string
API Documentation for Kiwi, generated by pydoctor at 2010-05-20 02:10:57.