# Module k.utils

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 | _GObjectClassInittableMetaType | Undocumented
Class | _GobjectClassInittableObject | Undocumented
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 | _max | Undocumented
Function | gproperty | Add a GObject property to the current object.
Function | quote | Similar to urllib.quote but for glibs GMarkup

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

Parameters | gtype | the 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

Parameters | name | name of the signal (type: string )
| args | types for signal parameters, if the first one is a string 'override', the signal will be overridden and must therefor exists in the parent GObject.

Notes

flags: 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.

Parameters | name | name of property (type: string )
| ptype | type of property (type: type )
| default | default value
| nick | short description
| blurb | long description

flags

parameter 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:

Notes | minimum: minimum allowed value
| maximum: maximum allowed value

def quote(msg):
Similar to urllib.quote but for glibs GMarkup

Parameters | msg | string to quote
Returns | quoted string