coherence.backend (module)

class Backend(server, **kwargs)[source]

Bases: coherence.log.LogAble, coherence.extern.simple_plugin.Plugin

the base class for all backends

if there are any UPnP service actions, that can’t be handled by the service classes itself, or need some special adjustments for the backend, they need to be defined here.

Like maybe upnp_Browse for the CDS Browse action.

the init method for a backend, should probably most of the time be overwritten when the init is done, send a signal to its device

the device will then setup and announce itself, after that it calls the backends upnp_init method

implements = []
logCategory = 'backend'
__init__(server, **kwargs)[source]

the init method for a backend, should probably most of the time be overwritten when the init is done, send a signal to its device

the device will then setup and announce itself, after that it calls the backends upnp_init method

server = None

do whatever is necessary with the stuff we can extract from the config dict, connect maybe to an external data-source and start up the backend after that’s done, tell Coherence about it

init_completed(*args, **kwargs)[source]

inform Coherence that this backend is ready for announcement this method just accepts any form of arguments as we don’t under which circumstances it is called

upnp_init()[source]

this method gets called after the device is fired, here all initializations of service related state variables should happen, as the services aren’t available before that point

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class BackendStore(server, *args, **kwargs)[source]

Bases: coherence.backend.Backend

the base class for all MediaServer backend stores

the init method for a MediaServer backend, should probably most of the time be overwritten when the init is done, send a signal to its device

the device will then setup and announce itself, after that it calls the backends upnp_init method

logCategory = 'backend_store'
__init__(server, *args, **kwargs)[source]

the init method for a MediaServer backend, should probably most of the time be overwritten when the init is done, send a signal to its device

the device will then setup and announce itself, after that it calls the backends upnp_init method

update_id = None

do whatever is necessary with the stuff we can extract from the config dict

release()[source]

if anything needs to be cleaned up upon shutdown of this backend, this is the place for it

_get_all_items(id)[source]

a helper method to get all items as a response to some XBox 360 UPnP Search action probably never be used as the backend will overwrite the wmc_mapping with more appropriate methods

get_by_id(id)[source]

called by the CDS or the MediaServer web

id is the id property of our DIDLLite item

if this MediaServer implements containers, that can share their content, like ‘all tracks’, ‘album’ and ‘album_of_artist’ - they all have the same track item as content - then the id may be passed by the CDS like this:

‘id@container’ or ‘id@container@container@container…’

therefore a

if isinstance(id, basestring):
id = id.split(‘@’,1) id = id[0]

may be appropriate as the first thing to do when entering this method

should return

  • None when no matching item for that id is found,
  • a BackendItem,
  • or a Deferred
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
implements = []
info(message, *args, **kwargs)
init_completed(*args, **kwargs)

inform Coherence that this backend is ready for announcement this method just accepts any form of arguments as we don’t under which circumstances it is called

log(message, *args, **kwargs)
msg(message, *args, **kwargs)
upnp_init()

this method gets called after the device is fired, here all initializations of service related state variables should happen, as the services aren’t available before that point

warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class BackendItem(*args, **kwargs)[source]

Bases: coherence.log.LogAble

the base class for all MediaServer backend items

most of the time we collect the necessary data for an UPnP ContentDirectoryService Container or Object and instantiate it here

self.item = DIDLLite.Container(id,parent_id,name,…)
or

self.item = DIDLLite.MusicTrack(id,parent_id,name,…)

To make that a valid UPnP CDS Object it needs one or more DIDLLite.Resource(uri,protocolInfo)

self.item.res = [] res = DIDLLite.Resource(url, ‘http-get::%s:’ % mimetype)

url : the urlbase of our backend + ‘/’ + our id

res.size = size self.item.res.append(res)

logCategory = 'backend_item'
__init__(*args, **kwargs)[source]

most of the time we collect the necessary data for an UPnP ContentDirectoryService Container or Object and instantiate it here

self.item = DIDLLite.Container(id,parent_id,name,…)
or

self.item = DIDLLite.MusicTrack(id,parent_id,name,…)

To make that a valid UPnP CDS Object it needs one or more DIDLLite.Resource(uri,protocolInfo)

self.item.res = [] res = DIDLLite.Resource(url, ‘http-get::%s:’ % mimetype)

url : the urlbase of our backend + ‘/’ + our id

res.size = size self.item.res.append(res)

get_children(start=0, end=0)[source]

called by the CDS and the MediaServer web should return

  • a list of its childs[start:end]
  • or a Deferred

if end == 0, the request is for all childs after start - childs[start:]

get_child_count()[source]

called by the CDS should return

  • the number of its childs - len(childs)
  • or a Deferred
get_item()[source]

called by the CDS and the MediaServer web should return

  • an UPnP ContentDirectoryServer DIDLLite object
  • or a Deferred
get_name()[source]

called by the MediaServer web should return

  • the name of the item, it is always expected to be in unicode
get_path()[source]

called by the MediaServer web should return

  • the filepath where to find the media file that this item does refer to
get_cover()[source]

called by the MediaServer web should return

  • the filepath where to find the album art file

only needed when we have created for that item an albumArtURI property that does point back to us

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class BackendRssMixin[source]

Bases: object

update_data(rss_url, container=None)[source]

creates a deferred chain to retrieve the rdf file, parse and extract the metadata and reschedule itself

parse_data(xml_data, container)[source]

extract media info and create BackendItems

queue_update(error_or_failure, rss_url, container)[source]
class Container(parent, title)[source]

Bases: coherence.backend.BackendItem

register_child(child, external_id=None)[source]
add_child(child, external_id=None, update=True)[source]
remove_child(child, external_id=None, update=True)[source]
get_children(start=0, end=0)[source]

called by the CDS and the MediaServer web should return

  • a list of its childs[start:end]
  • or a Deferred

if end == 0, the request is for all childs after start - childs[start:]

get_child_count()[source]

called by the CDS should return

  • the number of its childs - len(childs)
  • or a Deferred
get_path()[source]

called by the MediaServer web should return

  • the filepath where to find the media file that this item does refer to
get_item()[source]

called by the CDS and the MediaServer web should return

  • an UPnP ContentDirectoryServer DIDLLite object
  • or a Deferred
get_name()[source]

called by the MediaServer web should return

  • the name of the item, it is always expected to be in unicode
get_id()[source]
get_update_id()[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
get_cover()

called by the MediaServer web should return

  • the filepath where to find the album art file

only needed when we have created for that item an albumArtURI property that does point back to us

info(message, *args, **kwargs)
log(message, *args, **kwargs)
logCategory = 'backend_item'
msg(message, *args, **kwargs)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class LazyContainer(parent, title, external_id=None, refresh=0, childrenRetriever=None, **kwargs)[source]

Bases: coherence.backend.Container

logCategory = 'lazyContainer'
replace_by(item)[source]
add_child(child, external_id=None, update=True)[source]
update_children(new_children, old_children)[source]
start_children_retrieval_campaign()[source]
end_children_retrieval_campaign(success=True)[source]
retrieve_children(start=0, page=0)[source]
retrieve_all_children(start=0, request_count=0)[source]
get_children(start=0, request_count=0)[source]

called by the CDS and the MediaServer web should return

  • a list of its childs[start:end]
  • or a Deferred

if end == 0, the request is for all childs after start - childs[start:]

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
get_child_count()

called by the CDS should return

  • the number of its childs - len(childs)
  • or a Deferred
get_cover()

called by the MediaServer web should return

  • the filepath where to find the album art file

only needed when we have created for that item an albumArtURI property that does point back to us

get_id()
get_item()

called by the CDS and the MediaServer web should return

  • an UPnP ContentDirectoryServer DIDLLite object
  • or a Deferred
get_name()

called by the MediaServer web should return

  • the name of the item, it is always expected to be in unicode
get_path()

called by the MediaServer web should return

  • the filepath where to find the media file that this item does refer to
get_update_id()
info(message, *args, **kwargs)
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
register_child(child, external_id=None)
remove_child(child, external_id=None, update=True)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class AbstractBackendStore(server, **kwargs)[source]

Bases: coherence.backend.BackendStore

len()[source]
set_root_item(item)[source]
get_root_id()[source]
get_root_item()[source]
append_item(item, storage_id=None)[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
_get_all_items(id)

a helper method to get all items as a response to some XBox 360 UPnP Search action probably never be used as the backend will overwrite the wmc_mapping with more appropriate methods

critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
implements = []
info(message, *args, **kwargs)
init_completed(*args, **kwargs)

inform Coherence that this backend is ready for announcement this method just accepts any form of arguments as we don’t under which circumstances it is called

log(message, *args, **kwargs)
logCategory = 'backend_store'
msg(message, *args, **kwargs)
release()

if anything needs to be cleaned up upon shutdown of this backend, this is the place for it

remove_item(item)[source]
upnp_init()

this method gets called after the device is fired, here all initializations of service related state variables should happen, as the services aren’t available before that point

warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
get_by_id(id)[source]

called by the CDS or the MediaServer web

id is the id property of our DIDLLite item

if this MediaServer implements containers, that can share their content, like ‘all tracks’, ‘album’ and ‘album_of_artist’ - they all have the same track item as content - then the id may be passed by the CDS like this:

‘id@container’ or ‘id@container@container@container…’

therefore a

if isinstance(id, basestring):
id = id.split(‘@’,1) id = id[0]

may be appropriate as the first thing to do when entering this method

should return

  • None when no matching item for that id is found,
  • a BackendItem,
  • or a Deferred
getnextID()[source]

coherence.base (module)

class SimpleRoot(coherence)[source]

Bases: twisted.web.resource.Resource, coherence.log.LogAble

addSlash = True
logCategory = 'coherence'
getChild(name, request)[source]

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

listchilds(uri)[source]
render(request)[source]

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class WebServer(ui, port, coherence)[source]

Bases: coherence.log.LogAble

logCategory = 'webserver'
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class Plugins(ids=('coherence.plugins.backend.media_server', 'coherence.plugins.backend.media_renderer', 'coherence.plugins.backend.binary_light', 'coherence.plugins.backend.dimmable_light'))[source]

Bases: coherence.log.LogAble

logCategory = 'plugins'
_valids = ('coherence.plugins.backend.media_server', 'coherence.plugins.backend.media_renderer', 'coherence.plugins.backend.binary_light', 'coherence.plugins.backend.dimmable_light')
_plugins = {}
get(key, default=None)[source]
set(key, value)[source]
keys()[source]
_collect_from_module()[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
_Plugins__initialized = False
_Plugins__instance = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class Coherence(config=None)[source]

Bases: coherence.log.LogAble

logCategory = 'coherence'
web_server_port = None

Services

web_server = None

initializes logsystem a COHEN_DEBUG environment variable overwrites all level settings here

clear()[source]

we do need this to survive multiple calls to Coherence during trial tests

setup_part2()[source]
add_plugin(plugin, **kwargs)[source]
remove_plugin(plugin)[source]

Removes a backend from Coherence

@:param plugin: is the object return by add_plugin or an UUID string

static writeable_config()[source]

do we have a new-style config file

store_plugin_config(uuid, items)[source]

find the backend with uuid and store in its the config the key and value pair(s)

receiver(signal, *args, **kwargs)[source]
shutdown(force=False)[source]
check_devices()[source]

iterate over devices and their embedded ones and renew subscriptions

subscribe(name, callback)[source]
unsubscribe(name, callback)[source]
callback(name, *args)[source]
get_device_by_host(host)[source]
get_device_with_usn(usn)[source]
get_device_with_id(device_id)[source]
get_devices()[source]
get_local_devices()[source]
get_nonlocal_devices()[source]
create_device(device_type, infos)[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Coherence__cls = None
_Coherence__incarnations = 0
_Coherence__initialized = False
_Coherence__instance = None
_Loggable__logger = None
add_device(device)[source]
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
remove_device(device_type, infos)[source]
add_web_resource(name, sub)[source]
remove_web_resource(name)[source]
static connect(receiver, signal=<class 'coherence.extern.louie.All'>, sender=<class 'coherence.extern.louie.Any'>, weak=True)[source]

wrapper method around louie.connect

static disconnect(receiver, signal=<class 'coherence.extern.louie.All'>, sender=<class 'coherence.extern.louie.Any'>, weak=True)[source]

wrapper method around louie.disconnect

coherence.dbus_constants (module)

coherence.dbus_service (module)

DBUS service class

un_namespace(text)[source]
class DBusCDSService(service, dbus_device, bus)[source]

Bases: dbus.service.Object, coherence.log.LogAble

logCategory = 'dbus'
NOT_FOR_THE_TUBES = True
shutdown()[source]
_release_thyself(suicide_mode=True)[source]
variable_changed(variable)[source]
get_id()[source]
get_scpd_xml()[source]
StateVariableChanged(*args, **keywords)
getAvailableActions()[source]
subscribeStateVariables()[source]
GetSearchCapabilites(dbus_async_cb, dbus_async_err_cb)[source]
GetSortCapabilities(dbus_async_cb, dbus_async_err_cb)[source]
GetSortExtensionCapabilities(dbus_async_cb, dbus_async_err_cb)[source]
GetFeatureList(dbus_async_cb, dbus_async_err_cb)[source]
GetSystemUpdateID(dbus_async_cb, dbus_async_err_cb)[source]
Browse(ObjectID, BrowseFlag, Filter, StartingIndex, RequestedCount, SortCriteria, dbus_async_cb, dbus_async_err_cb)[source]
Search(ContainerID, SearchCriteria, Filter, StartingIndex, RequestedCount, SortCriteria, dbus_async_cb, dbus_async_err_cb)[source]
CreateObject(ContainerID, Elements, dbus_async_cb, dbus_async_err_cb)[source]
DestroyObject(ObjectID, dbus_async_cb, dbus_async_err_cb)[source]
UpdateObject(ObjectID, CurrentTagValue, NewTagValue, dbus_async_cb, dbus_async_err_cb)[source]
MoveObject(ObjectID, NewParentID, dbus_async_cb, dbus_async_err_cb)[source]
ImportResource(SourceURI, DestinationURI, dbus_async_cb, dbus_async_err_cb)[source]
ExportResource(SourceURI, DestinationURI, dbus_async_cb, dbus_async_err_cb)[source]
DeleteResource(ResourceURI, dbus_async_cb, dbus_async_err_cb)[source]
StopTransferResource(TransferID, dbus_async_cb, dbus_async_err_cb)[source]
GetTransferProgress(TransferID, dbus_async_cb, dbus_async_err_cb)[source]
CreateReference(ContainerID, ObjectID, dbus_async_cb, dbus_async_err_cb)[source]
callAction(name, arguments)[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
Introspect(object_path, connection)

Return a string of XML encoding this object’s supported interfaces, methods and signals.

SUPPORTS_MULTIPLE_CONNECTIONS = False
SUPPORTS_MULTIPLE_OBJECT_PATHS = False
_Loggable__logger = None
_dbus_class_table = {'coherence.dbus_service.DBusCDSService': {'org.DLNA.DMS.CDS': {'Browse': <function DBusCDSService.Browse>, 'CreateObject': <function DBusCDSService.CreateObject>, 'CreateReference': <function DBusCDSService.CreateReference>, 'DeleteResource': <function DBusCDSService.DeleteResource>, 'DestroyObject': <function DBusCDSService.DestroyObject>, 'ExportResource': <function DBusCDSService.ExportResource>, 'GetFeatureList': <function DBusCDSService.GetFeatureList>, 'GetSearchCapabilites': <function DBusCDSService.GetSearchCapabilites>, 'GetSortCapabilities': <function DBusCDSService.GetSortCapabilities>, 'GetSortExtensionCapabilities': <function DBusCDSService.GetSortExtensionCapabilities>, 'GetSystemUpdateID': <function DBusCDSService.GetSystemUpdateID>, 'GetTransferProgress': <function DBusCDSService.GetTransferProgress>, 'ImportResource': <function DBusCDSService.ImportResource>, 'MoveObject': <function DBusCDSService.MoveObject>, 'Search': <function DBusCDSService.Search>, 'StateVariableChanged': <function signal.<locals>.decorator.<locals>.emit_signal>, 'StopTransferResource': <function DBusCDSService.StopTransferResource>, 'UpdateObject': <function DBusCDSService.UpdateObject>, 'getAvailableActions': <function DBusCDSService.getAvailableActions>, 'get_id': <function DBusCDSService.get_id>, 'get_scpd_xml': <function DBusCDSService.get_scpd_xml>, 'subscribeStateVariables': <function DBusCDSService.subscribeStateVariables>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusDevice': {'org.Coherence.device': {'get_device_icons': <function DBusDevice.get_device_icons>, 'get_device_type': <function DBusDevice.get_device_type>, 'get_device_type_version': <function DBusDevice.get_device_type_version>, 'get_friendly_device_type': <function DBusDevice.get_friendly_device_type>, 'get_friendly_name': <function DBusDevice.get_friendly_name>, 'get_id': <function DBusDevice.get_id>, 'get_info': <function DBusDevice.get_info>, 'get_markup_name': <function DBusDevice.get_markup_name>, 'get_usn': <function DBusDevice.get_usn>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusPontoon': {'org.Coherence': {'DMR_added': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMR_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMS_added': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMS_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaRenderer_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaRenderer_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaServer_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaServer_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'add_plugin': <function DBusPontoon.add_plugin>, 'call_plugin': <function DBusPontoon.call_plugin>, 'create_object': <function DBusPontoon.create_object>, 'create_oob': <function DBusPontoon.create_oob>, 'device_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'device_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'get_device_with_id': <function DBusPontoon.get_device_with_id>, 'get_devices': <function DBusPontoon.get_devices>, 'get_devices_async': <function DBusPontoon.get_devices_async>, 'get_pin': <function DBusPontoon.get_pin>, 'hostname': <function DBusPontoon.hostname>, 'import_resource': <function DBusPontoon.import_resource>, 'pin': <function DBusPontoon.pin>, 'put_resource': <function DBusPontoon.put_resource>, 'remove_plugin': <function DBusPontoon.remove_plugin>, 'unpin': <function DBusPontoon.unpin>, 'version': <function DBusPontoon.version>}, 'org.DLNA.DMC': {'getDMRList': <function DBusPontoon.getDMRList>, 'getDMSList': <function DBusPontoon.getDMSList>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusService': {'org.Coherence.service': {'StateVariableChanged': <function signal.<locals>.decorator.<locals>.emit_signal>, 'action': <function DBusService.action>, 'call_action': <function DBusService.call_action>, 'destroy_object': <function DBusService.destroy_object>, 'get_available_actions': <function DBusService.get_available_actions>, 'get_id': <function DBusService.get_id>, 'get_scpd_xml': <function DBusService.get_scpd_xml>, 'subscribe': <function DBusService.subscribe>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'dbus.service.FallbackObject': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'dbus.service.Interface': {}, 'dbus.service.Object': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}}
_message_cb(connection, message)
_unregister_cb(connection)
add_to_connection(connection, path)

Make this object accessible via the given D-Bus connection and object path.

Parameters:
connection : dbus.connection.Connection

Export the object on this connection. If the class attribute SUPPORTS_MULTIPLE_CONNECTIONS is False (default), this object can only be made available on one connection; if the class attribute is set True by a subclass, the object can be made available on more than one connection.

path : dbus.ObjectPath or other str

Place the object at this object path. If the class attribute SUPPORTS_MULTIPLE_OBJECT_PATHS is False (default), this object can only be made available at one object path; if the class attribute is set True by a subclass, the object can be made available with more than one object path.

Raises ValueError:
 

if the object’s class attributes do not allow the object to be exported in the desired way.

Since:

0.82.0

connection

The Connection on which this object is available. Access raises AttributeError if there is no Connection, or more than one Connection.

Changed in 0.82.0: AttributeError can be raised.

critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
locations

An iterable over tuples representing locations at which this object is available.

Each tuple has at least two items, but may have more in future versions of dbus-python, so do not rely on their exact length. The first two items are the dbus.connection.Connection and the object path.

Since:0.82.0
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
remove_from_connection(connection=None, path=None)

Make this object inaccessible via the given D-Bus connection and object path. If no connection or path is specified, the object ceases to be accessible via any connection or path.

Parameters:
connection : dbus.connection.Connection or None

Only remove the object from this Connection. If None, remove from all Connections on which it’s exported.

path : dbus.ObjectPath or other str, or None

Only remove the object from this object path. If None, remove from all object paths.

Raises LookupError:
 

if the object was not exported on the requested connection or path, or (if both are None) was not exported at all.

Since:

0.81.1

warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class DBusService(service, dbus_device, bus)[source]

Bases: dbus.service.Object, coherence.log.LogAble

logCategory = 'dbus'
SUPPORTS_MULTIPLE_CONNECTIONS = True
shutdown()[source]
_release_thyself(suicide_mode=True)[source]
_get_service_methods()[source]

Returns a list of method descriptors for this object

variable_changed(variable)[source]
StateVariableChanged(*args, **keywords)
get_scpd_xml()[source]
get_available_actions()[source]
get_id()[source]
action(name, arguments, dbus_async_cb, dbus_async_err_cb)[source]
call_action(name, arguments, dbus_async_cb, dbus_async_err_cb, sender=None, connection=None)[source]
destroy_object(arguments, dbus_async_cb, dbus_async_err_cb)[source]
subscribe()[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
Introspect(object_path, connection)

Return a string of XML encoding this object’s supported interfaces, methods and signals.

SUPPORTS_MULTIPLE_OBJECT_PATHS = False
_Loggable__logger = None
_dbus_class_table = {'coherence.dbus_service.DBusCDSService': {'org.DLNA.DMS.CDS': {'Browse': <function DBusCDSService.Browse>, 'CreateObject': <function DBusCDSService.CreateObject>, 'CreateReference': <function DBusCDSService.CreateReference>, 'DeleteResource': <function DBusCDSService.DeleteResource>, 'DestroyObject': <function DBusCDSService.DestroyObject>, 'ExportResource': <function DBusCDSService.ExportResource>, 'GetFeatureList': <function DBusCDSService.GetFeatureList>, 'GetSearchCapabilites': <function DBusCDSService.GetSearchCapabilites>, 'GetSortCapabilities': <function DBusCDSService.GetSortCapabilities>, 'GetSortExtensionCapabilities': <function DBusCDSService.GetSortExtensionCapabilities>, 'GetSystemUpdateID': <function DBusCDSService.GetSystemUpdateID>, 'GetTransferProgress': <function DBusCDSService.GetTransferProgress>, 'ImportResource': <function DBusCDSService.ImportResource>, 'MoveObject': <function DBusCDSService.MoveObject>, 'Search': <function DBusCDSService.Search>, 'StateVariableChanged': <function signal.<locals>.decorator.<locals>.emit_signal>, 'StopTransferResource': <function DBusCDSService.StopTransferResource>, 'UpdateObject': <function DBusCDSService.UpdateObject>, 'getAvailableActions': <function DBusCDSService.getAvailableActions>, 'get_id': <function DBusCDSService.get_id>, 'get_scpd_xml': <function DBusCDSService.get_scpd_xml>, 'subscribeStateVariables': <function DBusCDSService.subscribeStateVariables>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusDevice': {'org.Coherence.device': {'get_device_icons': <function DBusDevice.get_device_icons>, 'get_device_type': <function DBusDevice.get_device_type>, 'get_device_type_version': <function DBusDevice.get_device_type_version>, 'get_friendly_device_type': <function DBusDevice.get_friendly_device_type>, 'get_friendly_name': <function DBusDevice.get_friendly_name>, 'get_id': <function DBusDevice.get_id>, 'get_info': <function DBusDevice.get_info>, 'get_markup_name': <function DBusDevice.get_markup_name>, 'get_usn': <function DBusDevice.get_usn>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusPontoon': {'org.Coherence': {'DMR_added': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMR_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMS_added': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMS_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaRenderer_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaRenderer_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaServer_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaServer_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'add_plugin': <function DBusPontoon.add_plugin>, 'call_plugin': <function DBusPontoon.call_plugin>, 'create_object': <function DBusPontoon.create_object>, 'create_oob': <function DBusPontoon.create_oob>, 'device_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'device_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'get_device_with_id': <function DBusPontoon.get_device_with_id>, 'get_devices': <function DBusPontoon.get_devices>, 'get_devices_async': <function DBusPontoon.get_devices_async>, 'get_pin': <function DBusPontoon.get_pin>, 'hostname': <function DBusPontoon.hostname>, 'import_resource': <function DBusPontoon.import_resource>, 'pin': <function DBusPontoon.pin>, 'put_resource': <function DBusPontoon.put_resource>, 'remove_plugin': <function DBusPontoon.remove_plugin>, 'unpin': <function DBusPontoon.unpin>, 'version': <function DBusPontoon.version>}, 'org.DLNA.DMC': {'getDMRList': <function DBusPontoon.getDMRList>, 'getDMSList': <function DBusPontoon.getDMSList>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusService': {'org.Coherence.service': {'StateVariableChanged': <function signal.<locals>.decorator.<locals>.emit_signal>, 'action': <function DBusService.action>, 'call_action': <function DBusService.call_action>, 'destroy_object': <function DBusService.destroy_object>, 'get_available_actions': <function DBusService.get_available_actions>, 'get_id': <function DBusService.get_id>, 'get_scpd_xml': <function DBusService.get_scpd_xml>, 'subscribe': <function DBusService.subscribe>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'dbus.service.FallbackObject': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'dbus.service.Interface': {}, 'dbus.service.Object': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}}
_message_cb(connection, message)
_unregister_cb(connection)
add_to_connection(connection, path)

Make this object accessible via the given D-Bus connection and object path.

Parameters:
connection : dbus.connection.Connection

Export the object on this connection. If the class attribute SUPPORTS_MULTIPLE_CONNECTIONS is False (default), this object can only be made available on one connection; if the class attribute is set True by a subclass, the object can be made available on more than one connection.

path : dbus.ObjectPath or other str

Place the object at this object path. If the class attribute SUPPORTS_MULTIPLE_OBJECT_PATHS is False (default), this object can only be made available at one object path; if the class attribute is set True by a subclass, the object can be made available with more than one object path.

Raises ValueError:
 

if the object’s class attributes do not allow the object to be exported in the desired way.

Since:

0.82.0

connection

The Connection on which this object is available. Access raises AttributeError if there is no Connection, or more than one Connection.

Changed in 0.82.0: AttributeError can be raised.

critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
locations

An iterable over tuples representing locations at which this object is available.

Each tuple has at least two items, but may have more in future versions of dbus-python, so do not rely on their exact length. The first two items are the dbus.connection.Connection and the object path.

Since:0.82.0
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
remove_from_connection(connection=None, path=None)

Make this object inaccessible via the given D-Bus connection and object path. If no connection or path is specified, the object ceases to be accessible via any connection or path.

Parameters:
connection : dbus.connection.Connection or None

Only remove the object from this Connection. If None, remove from all Connections on which it’s exported.

path : dbus.ObjectPath or other str, or None

Only remove the object from this object path. If None, remove from all object paths.

Raises LookupError:
 

if the object was not exported on the requested connection or path, or (if both are None) was not exported at all.

Since:

0.81.1

warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class DBusDevice(device, bus)[source]

Bases: dbus.service.Object, coherence.log.LogAble

logCategory = 'dbus'
SUPPORTS_MULTIPLE_CONNECTIONS = True
shutdown()[source]
_release_thyself(suicide_mode=True)[source]
path()[source]
get_info()[source]
get_markup_name()[source]
get_friendly_name()[source]
get_friendly_device_type()[source]
get_device_type_version()[source]
get_id()[source]
get_device_type()[source]
get_usn()[source]
get_device_icons()[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
Introspect(object_path, connection)

Return a string of XML encoding this object’s supported interfaces, methods and signals.

SUPPORTS_MULTIPLE_OBJECT_PATHS = False
_Loggable__logger = None
_dbus_class_table = {'coherence.dbus_service.DBusCDSService': {'org.DLNA.DMS.CDS': {'Browse': <function DBusCDSService.Browse>, 'CreateObject': <function DBusCDSService.CreateObject>, 'CreateReference': <function DBusCDSService.CreateReference>, 'DeleteResource': <function DBusCDSService.DeleteResource>, 'DestroyObject': <function DBusCDSService.DestroyObject>, 'ExportResource': <function DBusCDSService.ExportResource>, 'GetFeatureList': <function DBusCDSService.GetFeatureList>, 'GetSearchCapabilites': <function DBusCDSService.GetSearchCapabilites>, 'GetSortCapabilities': <function DBusCDSService.GetSortCapabilities>, 'GetSortExtensionCapabilities': <function DBusCDSService.GetSortExtensionCapabilities>, 'GetSystemUpdateID': <function DBusCDSService.GetSystemUpdateID>, 'GetTransferProgress': <function DBusCDSService.GetTransferProgress>, 'ImportResource': <function DBusCDSService.ImportResource>, 'MoveObject': <function DBusCDSService.MoveObject>, 'Search': <function DBusCDSService.Search>, 'StateVariableChanged': <function signal.<locals>.decorator.<locals>.emit_signal>, 'StopTransferResource': <function DBusCDSService.StopTransferResource>, 'UpdateObject': <function DBusCDSService.UpdateObject>, 'getAvailableActions': <function DBusCDSService.getAvailableActions>, 'get_id': <function DBusCDSService.get_id>, 'get_scpd_xml': <function DBusCDSService.get_scpd_xml>, 'subscribeStateVariables': <function DBusCDSService.subscribeStateVariables>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusDevice': {'org.Coherence.device': {'get_device_icons': <function DBusDevice.get_device_icons>, 'get_device_type': <function DBusDevice.get_device_type>, 'get_device_type_version': <function DBusDevice.get_device_type_version>, 'get_friendly_device_type': <function DBusDevice.get_friendly_device_type>, 'get_friendly_name': <function DBusDevice.get_friendly_name>, 'get_id': <function DBusDevice.get_id>, 'get_info': <function DBusDevice.get_info>, 'get_markup_name': <function DBusDevice.get_markup_name>, 'get_usn': <function DBusDevice.get_usn>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusPontoon': {'org.Coherence': {'DMR_added': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMR_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMS_added': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMS_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaRenderer_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaRenderer_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaServer_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaServer_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'add_plugin': <function DBusPontoon.add_plugin>, 'call_plugin': <function DBusPontoon.call_plugin>, 'create_object': <function DBusPontoon.create_object>, 'create_oob': <function DBusPontoon.create_oob>, 'device_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'device_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'get_device_with_id': <function DBusPontoon.get_device_with_id>, 'get_devices': <function DBusPontoon.get_devices>, 'get_devices_async': <function DBusPontoon.get_devices_async>, 'get_pin': <function DBusPontoon.get_pin>, 'hostname': <function DBusPontoon.hostname>, 'import_resource': <function DBusPontoon.import_resource>, 'pin': <function DBusPontoon.pin>, 'put_resource': <function DBusPontoon.put_resource>, 'remove_plugin': <function DBusPontoon.remove_plugin>, 'unpin': <function DBusPontoon.unpin>, 'version': <function DBusPontoon.version>}, 'org.DLNA.DMC': {'getDMRList': <function DBusPontoon.getDMRList>, 'getDMSList': <function DBusPontoon.getDMSList>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusService': {'org.Coherence.service': {'StateVariableChanged': <function signal.<locals>.decorator.<locals>.emit_signal>, 'action': <function DBusService.action>, 'call_action': <function DBusService.call_action>, 'destroy_object': <function DBusService.destroy_object>, 'get_available_actions': <function DBusService.get_available_actions>, 'get_id': <function DBusService.get_id>, 'get_scpd_xml': <function DBusService.get_scpd_xml>, 'subscribe': <function DBusService.subscribe>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'dbus.service.FallbackObject': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'dbus.service.Interface': {}, 'dbus.service.Object': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}}
_message_cb(connection, message)
_unregister_cb(connection)
add_to_connection(connection, path)

Make this object accessible via the given D-Bus connection and object path.

Parameters:
connection : dbus.connection.Connection

Export the object on this connection. If the class attribute SUPPORTS_MULTIPLE_CONNECTIONS is False (default), this object can only be made available on one connection; if the class attribute is set True by a subclass, the object can be made available on more than one connection.

path : dbus.ObjectPath or other str

Place the object at this object path. If the class attribute SUPPORTS_MULTIPLE_OBJECT_PATHS is False (default), this object can only be made available at one object path; if the class attribute is set True by a subclass, the object can be made available with more than one object path.

Raises ValueError:
 

if the object’s class attributes do not allow the object to be exported in the desired way.

Since:

0.82.0

connection

The Connection on which this object is available. Access raises AttributeError if there is no Connection, or more than one Connection.

Changed in 0.82.0: AttributeError can be raised.

critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
locations

An iterable over tuples representing locations at which this object is available.

Each tuple has at least two items, but may have more in future versions of dbus-python, so do not rely on their exact length. The first two items are the dbus.connection.Connection and the object path.

Since:0.82.0
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
remove_from_connection(connection=None, path=None)

Make this object inaccessible via the given D-Bus connection and object path. If no connection or path is specified, the object ceases to be accessible via any connection or path.

Parameters:
connection : dbus.connection.Connection or None

Only remove the object from this Connection. If None, remove from all Connections on which it’s exported.

path : dbus.ObjectPath or other str, or None

Only remove the object from this object path. If None, remove from all object paths.

Raises LookupError:
 

if the object was not exported on the requested connection or path, or (if both are None) was not exported at all.

Since:

0.81.1

warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class DBusPontoon(controlpoint, bus=None)[source]

Bases: dbus.service.Object, coherence.log.LogAble

logCategory = 'dbus'
SUPPORTS_MULTIPLE_CONNECTIONS = True
shutdown()[source]
pin(key, value)[source]
get_pin(key)[source]
unpin(key)[source]
create_oob(file)[source]
remove_client(usn, client)[source]
remove(udn)[source]
version()[source]
hostname()[source]
get_devices()[source]
get_devices_async(for_mirabeau, dbus_async_cb, dbus_async_err_cb)[source]
get_device_with_id(id)[source]
add_plugin(backend, arguments)[source]
remove_plugin(uuid)[source]
call_plugin(uuid, method, arguments)[source]
create_object(device_id, container_id, arguments, dbus_async_cb, dbus_async_err_cb)[source]
import_resource(device_id, source_uri, destination_uri, dbus_async_cb, dbus_async_err_cb)[source]
put_resource(destination_uri, filepath, dbus_async_cb, dbus_async_err_cb)[source]
_device_detected(device)[source]
_device_removed(usn='')[source]
cp_ms_detected(client, udn='')[source]
cp_mr_detected(client, udn='')[source]
cp_ms_removed(udn)[source]
cp_mr_removed(udn)[source]
UPnP_ControlPoint_MediaServer_detected(*args, **keywords)
UPnP_ControlPoint_MediaServer_removed(*args, **keywords)
UPnP_ControlPoint_MediaRenderer_detected(*args, **keywords)
UPnP_ControlPoint_MediaRenderer_removed(*args, **keywords)
device_detected(*args, **keywords)
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
Introspect(object_path, connection)

Return a string of XML encoding this object’s supported interfaces, methods and signals.

SUPPORTS_MULTIPLE_OBJECT_PATHS = False
_Loggable__logger = None
_dbus_class_table = {'coherence.dbus_service.DBusCDSService': {'org.DLNA.DMS.CDS': {'Browse': <function DBusCDSService.Browse>, 'CreateObject': <function DBusCDSService.CreateObject>, 'CreateReference': <function DBusCDSService.CreateReference>, 'DeleteResource': <function DBusCDSService.DeleteResource>, 'DestroyObject': <function DBusCDSService.DestroyObject>, 'ExportResource': <function DBusCDSService.ExportResource>, 'GetFeatureList': <function DBusCDSService.GetFeatureList>, 'GetSearchCapabilites': <function DBusCDSService.GetSearchCapabilites>, 'GetSortCapabilities': <function DBusCDSService.GetSortCapabilities>, 'GetSortExtensionCapabilities': <function DBusCDSService.GetSortExtensionCapabilities>, 'GetSystemUpdateID': <function DBusCDSService.GetSystemUpdateID>, 'GetTransferProgress': <function DBusCDSService.GetTransferProgress>, 'ImportResource': <function DBusCDSService.ImportResource>, 'MoveObject': <function DBusCDSService.MoveObject>, 'Search': <function DBusCDSService.Search>, 'StateVariableChanged': <function signal.<locals>.decorator.<locals>.emit_signal>, 'StopTransferResource': <function DBusCDSService.StopTransferResource>, 'UpdateObject': <function DBusCDSService.UpdateObject>, 'getAvailableActions': <function DBusCDSService.getAvailableActions>, 'get_id': <function DBusCDSService.get_id>, 'get_scpd_xml': <function DBusCDSService.get_scpd_xml>, 'subscribeStateVariables': <function DBusCDSService.subscribeStateVariables>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusDevice': {'org.Coherence.device': {'get_device_icons': <function DBusDevice.get_device_icons>, 'get_device_type': <function DBusDevice.get_device_type>, 'get_device_type_version': <function DBusDevice.get_device_type_version>, 'get_friendly_device_type': <function DBusDevice.get_friendly_device_type>, 'get_friendly_name': <function DBusDevice.get_friendly_name>, 'get_id': <function DBusDevice.get_id>, 'get_info': <function DBusDevice.get_info>, 'get_markup_name': <function DBusDevice.get_markup_name>, 'get_usn': <function DBusDevice.get_usn>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusPontoon': {'org.Coherence': {'DMR_added': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMR_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMS_added': <function signal.<locals>.decorator.<locals>.emit_signal>, 'DMS_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaRenderer_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaRenderer_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaServer_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'UPnP_ControlPoint_MediaServer_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'add_plugin': <function DBusPontoon.add_plugin>, 'call_plugin': <function DBusPontoon.call_plugin>, 'create_object': <function DBusPontoon.create_object>, 'create_oob': <function DBusPontoon.create_oob>, 'device_detected': <function signal.<locals>.decorator.<locals>.emit_signal>, 'device_removed': <function signal.<locals>.decorator.<locals>.emit_signal>, 'get_device_with_id': <function DBusPontoon.get_device_with_id>, 'get_devices': <function DBusPontoon.get_devices>, 'get_devices_async': <function DBusPontoon.get_devices_async>, 'get_pin': <function DBusPontoon.get_pin>, 'hostname': <function DBusPontoon.hostname>, 'import_resource': <function DBusPontoon.import_resource>, 'pin': <function DBusPontoon.pin>, 'put_resource': <function DBusPontoon.put_resource>, 'remove_plugin': <function DBusPontoon.remove_plugin>, 'unpin': <function DBusPontoon.unpin>, 'version': <function DBusPontoon.version>}, 'org.DLNA.DMC': {'getDMRList': <function DBusPontoon.getDMRList>, 'getDMSList': <function DBusPontoon.getDMSList>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'coherence.dbus_service.DBusService': {'org.Coherence.service': {'StateVariableChanged': <function signal.<locals>.decorator.<locals>.emit_signal>, 'action': <function DBusService.action>, 'call_action': <function DBusService.call_action>, 'destroy_object': <function DBusService.destroy_object>, 'get_available_actions': <function DBusService.get_available_actions>, 'get_id': <function DBusService.get_id>, 'get_scpd_xml': <function DBusService.get_scpd_xml>, 'subscribe': <function DBusService.subscribe>}, 'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'dbus.service.FallbackObject': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}, 'dbus.service.Interface': {}, 'dbus.service.Object': {'org.freedesktop.DBus.Introspectable': {'Introspect': <function Object.Introspect>}}}
_message_cb(connection, message)
_unregister_cb(connection)
add_to_connection(connection, path)

Make this object accessible via the given D-Bus connection and object path.

Parameters:
connection : dbus.connection.Connection

Export the object on this connection. If the class attribute SUPPORTS_MULTIPLE_CONNECTIONS is False (default), this object can only be made available on one connection; if the class attribute is set True by a subclass, the object can be made available on more than one connection.

path : dbus.ObjectPath or other str

Place the object at this object path. If the class attribute SUPPORTS_MULTIPLE_OBJECT_PATHS is False (default), this object can only be made available at one object path; if the class attribute is set True by a subclass, the object can be made available with more than one object path.

Raises ValueError:
 

if the object’s class attributes do not allow the object to be exported in the desired way.

Since:

0.82.0

connection

The Connection on which this object is available. Access raises AttributeError if there is no Connection, or more than one Connection.

Changed in 0.82.0: AttributeError can be raised.

critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
device_removed(*args, **keywords)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
locations

An iterable over tuples representing locations at which this object is available.

Each tuple has at least two items, but may have more in future versions of dbus-python, so do not rely on their exact length. The first two items are the dbus.connection.Connection and the object path.

Since:0.82.0
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
remove_from_connection(connection=None, path=None)

Make this object inaccessible via the given D-Bus connection and object path. If no connection or path is specified, the object ceases to be accessible via any connection or path.

Parameters:
connection : dbus.connection.Connection or None

Only remove the object from this Connection. If None, remove from all Connections on which it’s exported.

path : dbus.ObjectPath or other str, or None

Only remove the object from this object path. If None, remove from all object paths.

Raises LookupError:
 

if the object was not exported on the requested connection or path, or (if both are None) was not exported at all.

Since:

0.81.1

warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
getDMSList()[source]
_get_devices_of_type(typ)[source]
getDMRList()[source]
DMS_added(*args, **keywords)
DMS_removed(*args, **keywords)
DMR_added(*args, **keywords)
DMR_removed(*args, **keywords)

coherence.dispatcher (module)

class Receiver(signal, callback, args, kwargs)[source]

Bases: object

exception UnknownSignal[source]

Bases: Exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class Dispatcher[source]

Bases: object

connect(signal, callback, *args, **kw)[source]
disconnect(receiver)[source]
emit(signal, *args, **kwargs)[source]
deferred_emit(signal, *args, **kwargs)[source]
save_emit(signal, *args, **kwargs)[source]
_merge_results_and_receivers(result, receivers)[source]
_get_receivers(signal)[source]
class SignalingProperty(signal, var_name=None, default=None)[source]

Bases: object

Does emit self.signal when the value has changed but only if HAS changed (means old_value != new_value).

class ChangedSignalingProperty(signal, var_name=None, default=None)[source]

Bases: coherence.dispatcher.SignalingProperty

Does send the signal with two values when changed:
  1. the new value
  2. the value it has been before
class CustomSignalingProperty(signal, fget, fset, fdel=None, doc=None)[source]

Bases: object

Signal changes to this property. allows to specify fget and fset as the build in property-decorator.

fdel is there for API compability only. As there is no good way to signal a deletion it is not implemented at all.

__init__(signal, fget, fset, fdel=None, doc=None)[source]

fdel is there for API compability only. As there is no good way to signal a deletion it is not implemented at all.

coherence.json_service (module)

class JsonInterface(controlpoint)[source]

Bases: twisted.web.resource.Resource, coherence.log.LogAble

logCategory = 'json'
render_GET(request)[source]
render_POST(request)[source]
getChildWithDefault(path, request)[source]

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

do_the_render(request)[source]
list_devices(request)[source]
call_action(action, request)[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(path, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)

coherence.log (module)

get_main_log_level()[source]
formatter_message(message, use_color=True)[source]
class ColoredFormatter(msg, use_color=True)[source]

Bases: logging.Formatter

format(record)[source]

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

converter()
localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
tm_sec,tm_wday,tm_yday,tm_isdst)

Convert seconds since the Epoch to a time tuple expressing local time. When ‘seconds’ is not passed in, convert the current time instead.

default_msec_format = '%s,%03d'
default_time_format = '%Y-%m-%d %H:%M:%S'
formatException(ei)

Format and return the specified exception information as a string.

This default implementation just uses traceback.print_exception()

formatMessage(record)
formatStack(stack_info)

This method is provided as an extension point for specialized formatting of stack information.

The input data is a string as returned from a call to traceback.print_stack(), but with the last trailing newline removed.

The base implementation just returns the value passed in.

formatTime(record, datefmt=None)

Return the creation time of the specified LogRecord as formatted text.

This method should be called from format() by a formatter which wants to make use of a formatted time. This method can be overridden in formatters to provide for any specific requirement, but the basic behaviour is as follows: if datefmt (a string) is specified, it is used with time.strftime() to format the creation time of the record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used. The resulting string is returned. This function uses a user-configurable function to convert the creation time to a tuple. By default, time.localtime() is used; to change this for a particular formatter instance, set the ‘converter’ attribute to a function with the same signature as time.localtime() or time.gmtime(). To change it for all formatters, for example if you want all logging times to be shown in GMT, set the ‘converter’ attribute in the Formatter class.

usesTime()

Check if the format uses the creation time of the record.

class ColoredLogger(name)[source]

Bases: logging.Logger

FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
findCaller(stack_info=False, use_color=True)[source]

Find the stack frame of the caller so that we can note the source file name, line number and function name.

_log(level, msg, args, exc_info=None, extra=None, stack_info=False)

Low-level logging routine which creates a LogRecord and then calls all the handlers of this logger to handle the record.

addFilter(filter)

Add the specified filter to this handler.

addHandler(hdlr)

Add the specified handler to this logger.

callHandlers(record)

Pass a record to all relevant handlers.

Loop through all handlers for this logger and its parents in the logger hierarchy. If no handler was found, output a one-off error message to sys.stderr. Stop searching up the hierarchy whenever a logger with the “propagate” attribute set to zero is found - that will be the last logger whose handlers are called.

critical(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘CRITICAL’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.critical(“Houston, we have a %s”, “major disaster”, exc_info=1)

debug(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘DEBUG’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.debug(“Houston, we have a %s”, “thorny problem”, exc_info=1)

error(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘ERROR’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.error(“Houston, we have a %s”, “major problem”, exc_info=1)

exception(msg, *args, exc_info=True, **kwargs)

Convenience method for logging an ERROR with exception information.

fatal(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘CRITICAL’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.critical(“Houston, we have a %s”, “major disaster”, exc_info=1)

filter(record)

Determine if a record is loggable by consulting all the filters.

The default is to allow the record to be logged; any filter can veto this and the record is then dropped. Returns a zero value if a record is to be dropped, else non-zero.

Changed in version 3.2: Allow filters to be just callables.

getChild(suffix)

Get a logger which is a descendant to this one.

This is a convenience method, such that

logging.getLogger(‘abc’).getChild(‘def.ghi’)

is the same as

logging.getLogger(‘abc.def.ghi’)

It’s useful, for example, when the parent logger is named using __name__ rather than a literal string.

getEffectiveLevel()

Get the effective level for this logger.

Loop through this logger and its parents in the logger hierarchy, looking for a non-zero logging level. Return the first one found.

handle(record)

Call the handlers for the specified record.

This method is used for unpickled records received from a socket, as well as those created locally. Logger-level filtering is applied.

hasHandlers()

See if this logger has any handlers configured.

Loop through all handlers for this logger and its parents in the logger hierarchy. Return True if a handler was found, else False. Stop searching up the hierarchy whenever a logger with the “propagate” attribute set to zero is found - that will be the last logger which is checked for the existence of handlers.

info(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘INFO’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.info(“Houston, we have a %s”, “interesting problem”, exc_info=1)

isEnabledFor(level)

Is this logger enabled for level ‘level’?

log(level, msg, *args, **kwargs)

Log ‘msg % args’ with the integer severity ‘level’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.log(level, “We have a %s”, “mysterious problem”, exc_info=1)

makeRecord(name, level, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None)

A factory method which can be overridden in subclasses to create specialized LogRecords.

manager = <logging.Manager object>
removeFilter(filter)

Remove the specified filter from this handler.

removeHandler(hdlr)

Remove the specified handler from this logger.

root = <RootLogger root (WARNING)>
setLevel(level)

Set the logging level of this logger. level must be an int or a str.

warn(msg, *args, **kwargs)
warning(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘WARNING’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.warning(“Houston, we have a %s”, “bit of a problem”, exc_info=1)

class LogAble[source]

Bases: object

Base class for objects that want to be able to log messages with different level of severity. The levels are, in order from least to most: log, debug, info, warning, error.

@cvar logCategory: Implementors can provide a category to log their
messages under.
logCategory = 'default'
_Loggable__logger = None
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
log(message, *args, **kwargs)[source]
warning(message, *args, **kwargs)[source]
info(message, *args, **kwargs)[source]
critical(message, *args, **kwargs)[source]
debug(message, *args, **kwargs)[source]
error(message, *args, **kwargs)[source]
exception(message, *args, **kwargs)[source]
fatal(message, *args, **kwargs)
warn(message, *args, **kwargs)
msg(message, *args, **kwargs)
get_logger(log_category)[source]
init(logfilename=None, loglevel=30)[source]

coherence.transcoder (module)

transcoder classes to be used in combination with a Coherence MediaServer

using GStreamer pipelines for the actually work and feeding the output into a http response

get_transcoder_name(transcoder)[source]
class InternalTranscoder[source]

Bases: object

just a class to inherit from and which we can look for upon creating our list of available transcoders

class FakeTransformer(destination=None, request=None)[source]

Bases: gi.repository.Gst.Element, coherence.log.LogAble

logCategory = 'faker_datasink'
_sinkpadtemplate = <Gst.PadTemplate object at 0x7f3a118511b0 (GstPadTemplate at 0x56501c3989b0)>
_srcpadtemplate = <Gst.PadTemplate object at 0x7f3a118511f8 (GstPadTemplate at 0x56501c398a40)>
get_fake_header()[source]
chainfunc(pad, buffer)[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
_force_floating = gi.FunctionInfo(force_floating)
_gst_reserved
_ref = gi.FunctionInfo(ref)
_ref_sink = gi.FunctionInfo(ref_sink)
_unref = gi.FunctionInfo(unref)
_unsupported_data_method(*args, **kargs)
_unsupported_method(*args, **kargs)
abort_state = gi.FunctionInfo(abort_state)
add_control_binding = gi.FunctionInfo(add_control_binding)
classmethod add_metadata(self, key:str, value:str)
add_pad = gi.FunctionInfo(add_pad)
classmethod add_pad_template(self, templ:Gst.PadTemplate)
add_property_deep_notify_watch = gi.FunctionInfo(add_property_deep_notify_watch)
add_property_notify_watch = gi.FunctionInfo(add_property_notify_watch)
classmethod add_static_metadata(self, key:str, value:str)
classmethod add_static_pad_template(self, static_templ:Gst.StaticPadTemplate)
classmethod add_static_pad_template_with_gtype(self, static_templ:Gst.StaticPadTemplate, pad_type:GType)
base_time
bind_property()
bind_property_full(*args, **kargs)
bus
call_async = gi.FunctionInfo(call_async)
chain()
change_state = gi.FunctionInfo(change_state)
check_uniqueness = gi.FunctionInfo(check_uniqueness)
clock
compat_control(*args, **kargs)
connect()
connect_after()
connect_data(detailed_signal, handler, *data, **kwargs)

Connect a callback to the given signal with optional user data.

Parameters:
  • detailed_signal (str) – A detailed signal to connect to.
  • handler (callable) – Callback handler to connect to the signal.
  • *data

    Variable data which is passed through to the signal handler.

  • connect_flags (GObject.ConnectFlags) – Flags used for connection options.
Returns:

A signal id which can be used with disconnect.

connect_object()
connect_object_after()
contexts
continue_state = gi.FunctionInfo(continue_state)
control_bindings
control_rate
create_all_pads = gi.FunctionInfo(create_all_pads)
critical(message, *args, **kwargs)
current_state
debug(message, *args, **kwargs)
default_deep_notify = gi.FunctionInfo(default_deep_notify)
default_error = gi.FunctionInfo(default_error)
disconnect(**kwargs)
disconnect_by_func()
do_change_state

Gst.StateChange) -> Gst.StateChangeReturn

Type:change_state(self, transition
do_deep_notify

Gst.Object, pspec:GObject.ParamSpec)

Type:deep_notify(self, orig
do_get_state

int) -> Gst.StateChangeReturn, state:Gst.State, pending:Gst.State

Type:get_state(self, timeout
do_no_more_pads

no_more_pads(self)

do_pad_added

Gst.Pad)

Type:pad_added(self, pad
do_pad_removed

Gst.Pad)

Type:pad_removed(self, pad
do_post_message

Gst.Message) -> bool

Type:post_message(self, message
do_provide_clock

provide_clock(self) -> Gst.Clock or None

do_query

Gst.Query) -> bool

Type:query(self, query
do_release_pad

Gst.Pad)

Type:release_pad(self, pad
do_request_new_pad

Gst.PadTemplate, name:str=None, caps:Gst.Caps=None) -> Gst.Pad or None

Type:request_new_pad(self, templ
do_send_event

Gst.Event) -> bool

Type:send_event(self, event
do_set_bus

Gst.Bus=None)

Type:set_bus(self, bus
do_set_clock

Gst.Clock=None) -> bool

Type:set_clock(self, clock
do_set_context

Gst.Context)

Type:set_context(self, context
do_set_state

Gst.State) -> Gst.StateChangeReturn

Type:set_state(self, state
do_state_changed

Gst.State, newstate:Gst.State, pending:Gst.State)

Type:state_changed(self, oldstate
emit()
emit_stop_by_name(detailed_signal)

Deprecated, please use stop_emission_by_name.

error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
classmethod find_property(self, property_name:str) → GObject.ParamSpec
flags
force_floating(*args, **kargs)
foreach_pad = gi.FunctionInfo(foreach_pad)
foreach_sink_pad = gi.FunctionInfo(foreach_sink_pad)
foreach_src_pad = gi.FunctionInfo(foreach_src_pad)
freeze_notify()

Freezes the object’s property-changed notification queue.

Returns:A context manager which optionally can be used to automatically thaw notifications.

This will freeze the object so that “notify” signals are blocked until the thaw_notify() method is called.

with obj.freeze_notify():
    pass
g_type_instance
get_base_time = gi.FunctionInfo(get_base_time)
get_bus = gi.FunctionInfo(get_bus)
get_clock = gi.FunctionInfo(get_clock)
get_compatible_pad = gi.FunctionInfo(get_compatible_pad)
get_compatible_pad_template = gi.FunctionInfo(get_compatible_pad_template)
get_context = gi.FunctionInfo(get_context)
get_context_unlocked = gi.FunctionInfo(get_context_unlocked)
get_contexts = gi.FunctionInfo(get_contexts)
get_control_binding = gi.FunctionInfo(get_control_binding)
get_control_rate = gi.FunctionInfo(get_control_rate)
get_data(*args, **kargs)
get_factory = gi.FunctionInfo(get_factory)
get_g_value_array = gi.FunctionInfo(get_g_value_array)
get_metadata = gi.FunctionInfo(get_metadata)
get_name = gi.FunctionInfo(get_name)
get_pad_template = gi.FunctionInfo(get_pad_template)
get_pad_template_list = gi.FunctionInfo(get_pad_template_list)
get_parent = gi.FunctionInfo(get_parent)
get_path_string = gi.FunctionInfo(get_path_string)
get_properties()
get_property()
get_qdata(*args, **kargs)
get_request_pad = gi.FunctionInfo(get_request_pad)
get_start_time = gi.FunctionInfo(get_start_time)
get_state = gi.FunctionInfo(get_state)
get_static_pad = gi.FunctionInfo(get_static_pad)
get_value = gi.FunctionInfo(get_value)
getv = gi.FunctionInfo(getv)
handler_block(handler_id)

Blocks the signal handler from being invoked until handler_unblock() is called.

Parameters:
  • obj (GObject.Object) – Object instance to block handlers for.
  • handler_id (int) – Id of signal to block.
Returns:

A context manager which optionally can be used to automatically unblock the handler:

with GObject.signal_handler_block(obj, id):
    pass
handler_block_by_func()
handler_disconnect(**kwargs)
handler_is_connected(**kwargs)
handler_unblock(**kwargs)
handler_unblock_by_func()
has_active_control_bindings = gi.FunctionInfo(has_active_control_bindings)
has_ancestor = gi.FunctionInfo(has_ancestor)
has_as_ancestor = gi.FunctionInfo(has_as_ancestor)
has_as_parent = gi.FunctionInfo(has_as_parent)
info(message, *args, **kwargs)
classmethod install_properties(self, pspecs:list)
classmethod install_property(self, property_id:int, pspec:GObject.ParamSpec)
interface_find_property(*args, **kargs)
interface_install_property(*args, **kargs)
interface_list_properties(*args, **kargs)
is_floating = gi.FunctionInfo(is_floating)
is_locked_state = gi.FunctionInfo(is_locked_state)
iterate_pads = gi.FunctionInfo(iterate_pads)
iterate_sink_pads = gi.FunctionInfo(iterate_sink_pads)
iterate_src_pads = gi.FunctionInfo(iterate_src_pads)
last_return
last_sync
classmethod list_properties(self) → list, n_properties:int
lock
log(message, *args, **kwargs)
lost_state = gi.FunctionInfo(lost_state)
make_from_uri = gi.FunctionInfo(make_from_uri)
message_full = gi.FunctionInfo(message_full)
message_full_with_details = gi.FunctionInfo(message_full_with_details)
msg(message, *args, **kwargs)
name
new = gi.FunctionInfo(new)
newv = gi.FunctionInfo(newv)
next_state
no_more_pads = gi.FunctionInfo(no_more_pads)
notify = gi.FunctionInfo(notify)
notify_by_pspec(*args, **kargs)
numpads
numsinkpads
numsrcpads
object
classmethod override_property(self, property_id:int, name:str)
pads
parent
pending_state
post_message = gi.FunctionInfo(post_message)
props = <gi._gi.GProps object>
provide_clock = gi.FunctionInfo(provide_clock)
qdata
query = gi.FunctionInfo(query)
query_convert = gi.FunctionInfo(query_convert)
query_duration = gi.FunctionInfo(query_duration)
query_position = gi.FunctionInfo(query_position)
ref = gi.FunctionInfo(ref)
ref_count
ref_sink(*args, **kargs)
register = gi.FunctionInfo(register)
release_request_pad = gi.FunctionInfo(release_request_pad)
remove_control_binding = gi.FunctionInfo(remove_control_binding)
remove_pad = gi.FunctionInfo(remove_pad)
remove_property_notify_watch = gi.FunctionInfo(remove_property_notify_watch)
replace = gi.FunctionInfo(replace)
replace_data(*args, **kargs)
replace_qdata(*args, **kargs)
request_pad = gi.FunctionInfo(request_pad)
run_dispose(*args, **kargs)
seek = gi.FunctionInfo(seek)
seek_simple = gi.FunctionInfo(seek_simple)
send_event = gi.FunctionInfo(send_event)
set_base_time = gi.FunctionInfo(set_base_time)
set_bus = gi.FunctionInfo(set_bus)
set_clock = gi.FunctionInfo(set_clock)
set_context = gi.FunctionInfo(set_context)
set_control_binding_disabled = gi.FunctionInfo(set_control_binding_disabled)
set_control_bindings_disabled = gi.FunctionInfo(set_control_bindings_disabled)
set_control_rate = gi.FunctionInfo(set_control_rate)
set_data(*args, **kargs)
set_locked_state = gi.FunctionInfo(set_locked_state)
classmethod set_metadata(self, longname:str, classification:str, description:str, author:str)
set_name = gi.FunctionInfo(set_name)
set_parent = gi.FunctionInfo(set_parent)
set_properties()
set_property()
set_start_time = gi.FunctionInfo(set_start_time)
set_state = gi.FunctionInfo(set_state)
classmethod set_static_metadata(self, longname:str, classification:str, description:str, author:str)
sinkpads
srcpads
start_time
state_change_return_get_name = gi.FunctionInfo(state_change_return_get_name)
state_cond
state_get_name = gi.FunctionInfo(state_get_name)
state_lock
steal_data(*args, **kargs)
steal_qdata(*args, **kargs)
stop_emission(detailed_signal)

Deprecated, please use stop_emission_by_name.

stop_emission_by_name(**kwargs)
suggest_next_sync = gi.FunctionInfo(suggest_next_sync)
sync_state_with_parent = gi.FunctionInfo(sync_state_with_parent)
sync_values = gi.FunctionInfo(sync_values)
target_state
thaw_notify = gi.FunctionInfo(thaw_notify)
unparent = gi.FunctionInfo(unparent)
unref = gi.FunctionInfo(unref)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
watch_closure(*args, **kargs)
weak_ref()
class DataSink(destination=None, request=None)[source]

Bases: gi.repository.Gst.Element, coherence.log.LogAble

logCategory = 'transcoder_datasink'
_sinkpadtemplate = <Gst.PadTemplate object at 0x7f3a118515e8 (GstPadTemplate at 0x56501c398ad0)>
chainfunc(pad, inst, buffer)[source]
eventfunc(pad, inst, event)[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
_force_floating = gi.FunctionInfo(force_floating)
_gst_reserved
_ref = gi.FunctionInfo(ref)
_ref_sink = gi.FunctionInfo(ref_sink)
_unref = gi.FunctionInfo(unref)
_unsupported_data_method(*args, **kargs)
_unsupported_method(*args, **kargs)
abort_state = gi.FunctionInfo(abort_state)
add_control_binding = gi.FunctionInfo(add_control_binding)
classmethod add_metadata(self, key:str, value:str)
add_pad = gi.FunctionInfo(add_pad)
classmethod add_pad_template(self, templ:Gst.PadTemplate)
add_property_deep_notify_watch = gi.FunctionInfo(add_property_deep_notify_watch)
add_property_notify_watch = gi.FunctionInfo(add_property_notify_watch)
classmethod add_static_metadata(self, key:str, value:str)
classmethod add_static_pad_template(self, static_templ:Gst.StaticPadTemplate)
classmethod add_static_pad_template_with_gtype(self, static_templ:Gst.StaticPadTemplate, pad_type:GType)
base_time
bind_property()
bind_property_full(*args, **kargs)
bus
call_async = gi.FunctionInfo(call_async)
chain()
change_state = gi.FunctionInfo(change_state)
check_uniqueness = gi.FunctionInfo(check_uniqueness)
clock
compat_control(*args, **kargs)
connect()
connect_after()
connect_data(detailed_signal, handler, *data, **kwargs)

Connect a callback to the given signal with optional user data.

Parameters:
  • detailed_signal (str) – A detailed signal to connect to.
  • handler (callable) – Callback handler to connect to the signal.
  • *data

    Variable data which is passed through to the signal handler.

  • connect_flags (GObject.ConnectFlags) – Flags used for connection options.
Returns:

A signal id which can be used with disconnect.

connect_object()
connect_object_after()
contexts
continue_state = gi.FunctionInfo(continue_state)
control_bindings
control_rate
create_all_pads = gi.FunctionInfo(create_all_pads)
critical(message, *args, **kwargs)
current_state
debug(message, *args, **kwargs)
default_deep_notify = gi.FunctionInfo(default_deep_notify)
default_error = gi.FunctionInfo(default_error)
disconnect(**kwargs)
disconnect_by_func()
do_change_state

Gst.StateChange) -> Gst.StateChangeReturn

Type:change_state(self, transition
do_deep_notify

Gst.Object, pspec:GObject.ParamSpec)

Type:deep_notify(self, orig
do_get_state

int) -> Gst.StateChangeReturn, state:Gst.State, pending:Gst.State

Type:get_state(self, timeout
do_no_more_pads

no_more_pads(self)

do_pad_added

Gst.Pad)

Type:pad_added(self, pad
do_pad_removed

Gst.Pad)

Type:pad_removed(self, pad
do_post_message

Gst.Message) -> bool

Type:post_message(self, message
do_provide_clock

provide_clock(self) -> Gst.Clock or None

do_query

Gst.Query) -> bool

Type:query(self, query
do_release_pad

Gst.Pad)

Type:release_pad(self, pad
do_request_new_pad

Gst.PadTemplate, name:str=None, caps:Gst.Caps=None) -> Gst.Pad or None

Type:request_new_pad(self, templ
do_send_event

Gst.Event) -> bool

Type:send_event(self, event
do_set_bus

Gst.Bus=None)

Type:set_bus(self, bus
do_set_clock

Gst.Clock=None) -> bool

Type:set_clock(self, clock
do_set_context

Gst.Context)

Type:set_context(self, context
do_set_state

Gst.State) -> Gst.StateChangeReturn

Type:set_state(self, state
do_state_changed

Gst.State, newstate:Gst.State, pending:Gst.State)

Type:state_changed(self, oldstate
emit()
emit_stop_by_name(detailed_signal)

Deprecated, please use stop_emission_by_name.

error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
classmethod find_property(self, property_name:str) → GObject.ParamSpec
flags
force_floating(*args, **kargs)
foreach_pad = gi.FunctionInfo(foreach_pad)
foreach_sink_pad = gi.FunctionInfo(foreach_sink_pad)
foreach_src_pad = gi.FunctionInfo(foreach_src_pad)
freeze_notify()

Freezes the object’s property-changed notification queue.

Returns:A context manager which optionally can be used to automatically thaw notifications.

This will freeze the object so that “notify” signals are blocked until the thaw_notify() method is called.

with obj.freeze_notify():
    pass
g_type_instance
get_base_time = gi.FunctionInfo(get_base_time)
get_bus = gi.FunctionInfo(get_bus)
get_clock = gi.FunctionInfo(get_clock)
get_compatible_pad = gi.FunctionInfo(get_compatible_pad)
get_compatible_pad_template = gi.FunctionInfo(get_compatible_pad_template)
get_context = gi.FunctionInfo(get_context)
get_context_unlocked = gi.FunctionInfo(get_context_unlocked)
get_contexts = gi.FunctionInfo(get_contexts)
get_control_binding = gi.FunctionInfo(get_control_binding)
get_control_rate = gi.FunctionInfo(get_control_rate)
get_data(*args, **kargs)
get_factory = gi.FunctionInfo(get_factory)
get_g_value_array = gi.FunctionInfo(get_g_value_array)
get_metadata = gi.FunctionInfo(get_metadata)
get_name = gi.FunctionInfo(get_name)
get_pad_template = gi.FunctionInfo(get_pad_template)
get_pad_template_list = gi.FunctionInfo(get_pad_template_list)
get_parent = gi.FunctionInfo(get_parent)
get_path_string = gi.FunctionInfo(get_path_string)
get_properties()
get_property()
get_qdata(*args, **kargs)
get_request_pad = gi.FunctionInfo(get_request_pad)
get_start_time = gi.FunctionInfo(get_start_time)
get_state = gi.FunctionInfo(get_state)
get_static_pad = gi.FunctionInfo(get_static_pad)
get_value = gi.FunctionInfo(get_value)
getv = gi.FunctionInfo(getv)
handler_block(handler_id)

Blocks the signal handler from being invoked until handler_unblock() is called.

Parameters:
  • obj (GObject.Object) – Object instance to block handlers for.
  • handler_id (int) – Id of signal to block.
Returns:

A context manager which optionally can be used to automatically unblock the handler:

with GObject.signal_handler_block(obj, id):
    pass
handler_block_by_func()
handler_disconnect(**kwargs)
handler_is_connected(**kwargs)
handler_unblock(**kwargs)
handler_unblock_by_func()
has_active_control_bindings = gi.FunctionInfo(has_active_control_bindings)
has_ancestor = gi.FunctionInfo(has_ancestor)
has_as_ancestor = gi.FunctionInfo(has_as_ancestor)
has_as_parent = gi.FunctionInfo(has_as_parent)
info(message, *args, **kwargs)
classmethod install_properties(self, pspecs:list)
classmethod install_property(self, property_id:int, pspec:GObject.ParamSpec)
interface_find_property(*args, **kargs)
interface_install_property(*args, **kargs)
interface_list_properties(*args, **kargs)
is_floating = gi.FunctionInfo(is_floating)
is_locked_state = gi.FunctionInfo(is_locked_state)
iterate_pads = gi.FunctionInfo(iterate_pads)
iterate_sink_pads = gi.FunctionInfo(iterate_sink_pads)
iterate_src_pads = gi.FunctionInfo(iterate_src_pads)
last_return
last_sync
classmethod list_properties(self) → list, n_properties:int
lock
log(message, *args, **kwargs)
lost_state = gi.FunctionInfo(lost_state)
make_from_uri = gi.FunctionInfo(make_from_uri)
message_full = gi.FunctionInfo(message_full)
message_full_with_details = gi.FunctionInfo(message_full_with_details)
msg(message, *args, **kwargs)
name
new = gi.FunctionInfo(new)
newv = gi.FunctionInfo(newv)
next_state
no_more_pads = gi.FunctionInfo(no_more_pads)
notify = gi.FunctionInfo(notify)
notify_by_pspec(*args, **kargs)
numpads
numsinkpads
numsrcpads
object
classmethod override_property(self, property_id:int, name:str)
pads
parent
pending_state
post_message = gi.FunctionInfo(post_message)
props = <gi._gi.GProps object>
provide_clock = gi.FunctionInfo(provide_clock)
qdata
query = gi.FunctionInfo(query)
query_convert = gi.FunctionInfo(query_convert)
query_duration = gi.FunctionInfo(query_duration)
query_position = gi.FunctionInfo(query_position)
ref = gi.FunctionInfo(ref)
ref_count
ref_sink(*args, **kargs)
register = gi.FunctionInfo(register)
release_request_pad = gi.FunctionInfo(release_request_pad)
remove_control_binding = gi.FunctionInfo(remove_control_binding)
remove_pad = gi.FunctionInfo(remove_pad)
remove_property_notify_watch = gi.FunctionInfo(remove_property_notify_watch)
replace = gi.FunctionInfo(replace)
replace_data(*args, **kargs)
replace_qdata(*args, **kargs)
request_pad = gi.FunctionInfo(request_pad)
run_dispose(*args, **kargs)
seek = gi.FunctionInfo(seek)
seek_simple = gi.FunctionInfo(seek_simple)
send_event = gi.FunctionInfo(send_event)
set_base_time = gi.FunctionInfo(set_base_time)
set_bus = gi.FunctionInfo(set_bus)
set_clock = gi.FunctionInfo(set_clock)
set_context = gi.FunctionInfo(set_context)
set_control_binding_disabled = gi.FunctionInfo(set_control_binding_disabled)
set_control_bindings_disabled = gi.FunctionInfo(set_control_bindings_disabled)
set_control_rate = gi.FunctionInfo(set_control_rate)
set_data(*args, **kargs)
set_locked_state = gi.FunctionInfo(set_locked_state)
classmethod set_metadata(self, longname:str, classification:str, description:str, author:str)
set_name = gi.FunctionInfo(set_name)
set_parent = gi.FunctionInfo(set_parent)
set_properties()
set_property()
set_start_time = gi.FunctionInfo(set_start_time)
set_state = gi.FunctionInfo(set_state)
classmethod set_static_metadata(self, longname:str, classification:str, description:str, author:str)
sinkpads
srcpads
start_time
state_change_return_get_name = gi.FunctionInfo(state_change_return_get_name)
state_cond
state_get_name = gi.FunctionInfo(state_get_name)
state_lock
steal_data(*args, **kargs)
steal_qdata(*args, **kargs)
stop_emission(detailed_signal)

Deprecated, please use stop_emission_by_name.

stop_emission_by_name(**kwargs)
suggest_next_sync = gi.FunctionInfo(suggest_next_sync)
sync_state_with_parent = gi.FunctionInfo(sync_state_with_parent)
sync_values = gi.FunctionInfo(sync_values)
target_state
thaw_notify = gi.FunctionInfo(thaw_notify)
unparent = gi.FunctionInfo(unparent)
unref = gi.FunctionInfo(unref)
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
watch_closure(*args, **kargs)
weak_ref()
class GStreamerPipeline(pipeline, content_type)[source]

Bases: twisted.web.resource.Resource, coherence.log.LogAble

logCategory = 'gstreamer'
addSlash = True
parse_pipeline()[source]
start(request=None)[source]
new_preroll(appsink)[source]
new_buffer(appsink)[source]
eos(appsink)[source]
getChild(name, request)[source]

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

render_GET(request)[source]
render_HEAD(request)[source]

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result, request)[source]
on_message(bus, message)[source]
cleanup()[source]
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class BaseTranscoder(uri, destination=None, content_type=None)[source]

Bases: twisted.web.resource.Resource, coherence.log.LogAble

logCategory = 'transcoder'
addSlash = True
getChild(name, request)[source]

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

render_GET(request)[source]
render_HEAD(request)[source]

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result)[source]
on_message(bus, message)[source]
cleanup()[source]
start(request=None)[source]

This method should be sub classed for each class which inherits from BaseTranscoder

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class PCMTranscoder(uri, destination=None, content_type=None)[source]

Bases: coherence.transcoder.BaseTranscoder, coherence.transcoder.InternalTranscoder

contentType = 'audio/L16;rate=44100;channels=2'
name = 'lpcm'
start(request=None)[source]

This method should be sub classed for each class which inherits from BaseTranscoder

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
addSlash = True
cleanup()
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(name, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
logCategory = 'transcoder'
msg(message, *args, **kwargs)
on_message(bus, message)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_GET(request)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result)
server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class WAVTranscoder(uri, destination=None, content_type=None)[source]

Bases: coherence.transcoder.BaseTranscoder, coherence.transcoder.InternalTranscoder

contentType = 'audio/x-wav'
name = 'wav'
start(request=None)[source]

This method should be sub classed for each class which inherits from BaseTranscoder

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
addSlash = True
cleanup()
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(name, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
logCategory = 'transcoder'
msg(message, *args, **kwargs)
on_message(bus, message)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_GET(request)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result)
server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class MP3Transcoder(uri, destination=None, content_type=None)[source]

Bases: coherence.transcoder.BaseTranscoder, coherence.transcoder.InternalTranscoder

contentType = 'audio/mpeg'
name = 'mp3'
start(request=None)[source]

This method should be sub classed for each class which inherits from BaseTranscoder

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
addSlash = True
cleanup()
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(name, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
logCategory = 'transcoder'
msg(message, *args, **kwargs)
on_message(bus, message)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_GET(request)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result)
server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class MP4Transcoder(uri, destination=None, content_type=None)[source]

Bases: coherence.transcoder.BaseTranscoder, coherence.transcoder.InternalTranscoder

Only works if H264 inside Quicktime/MP4 container is input Source has to be a valid uri

contentType = 'video/mp4'
name = 'mp4'
start(request=None)[source]

This method should be sub classed for each class which inherits from BaseTranscoder

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
addSlash = True
cleanup()
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(name, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
logCategory = 'transcoder'
msg(message, *args, **kwargs)
on_message(bus, message)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_GET(request)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result)
server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class MP2TSTranscoder(uri, destination=None, content_type=None)[source]

Bases: coherence.transcoder.BaseTranscoder, coherence.transcoder.InternalTranscoder

contentType = 'video/mpeg'
name = 'mpegts'
start(request=None)[source]

This method should be sub classed for each class which inherits from BaseTranscoder

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
addSlash = True
cleanup()
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(name, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
logCategory = 'transcoder'
msg(message, *args, **kwargs)
on_message(bus, message)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_GET(request)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result)
server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class ThumbTranscoder(uri, destination=None, content_type=None)[source]

Bases: coherence.transcoder.BaseTranscoder, coherence.transcoder.InternalTranscoder

should create a valid thumbnail according to the DLNA spec neither width nor height must exceed 160px

contentType = 'image/jpeg'
name = 'thumb'
start(request=None)[source]

This method should be sub classed for each class which inherits from BaseTranscoder

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
addSlash = True
cleanup()
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(name, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
logCategory = 'transcoder'
msg(message, *args, **kwargs)
on_message(bus, message)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_GET(request)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result)
server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class GStreamerTranscoder(uri, destination=None, content_type=None)[source]

Bases: coherence.transcoder.BaseTranscoder

a generic Transcode based on GStreamer

the pipeline which will be parsed upon calling the start method, as to be set as the attribute pipeline_description to the instantiated class

same for the attribute contentType

pipeline_description = None
start(request=None)[source]

This method should be sub classed for each class which inherits from BaseTranscoder

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
addSlash = True
cleanup()
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(name, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
logCategory = 'transcoder'
msg(message, *args, **kwargs)
on_message(bus, message)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_GET(request)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

requestFinished(result)
server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class ExternalProcessProtocol(caller)[source]

Bases: twisted.internet.protocol.ProcessProtocol

connectionMade()[source]

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

outReceived(data)[source]

Some data was received from stdout.

errReceived(data)[source]

Some data was received from stderr.

inConnectionLost()[source]

This will be called when stdin is closed.

outConnectionLost()[source]

This will be called when stdout is closed.

errConnectionLost()[source]

This will be called when stderr is closed.

processEnded(status_object)[source]

Called when the child process exits and all file descriptors associated with it have been closed.

@type reason: L{twisted.python.failure.Failure}

childConnectionLost(childFD)
childDataReceived(childFD, data)
connected = 0
makeConnection(transport)

Make a connection to a transport and a server.

This sets the ‘transport’ attribute of this Protocol, and calls the connectionMade() callback.

processExited(reason)

This will be called when the subprocess exits.

@type reason: L{twisted.python.failure.Failure}

transport = None
class ExternalProcessProducer(pipeline, request)[source]

Bases: object

logCategory = 'externalprocess'
write_data(data)[source]
resumeProducing()[source]
pauseProducing()[source]
stopProducing()[source]
class ExternalProcessPipeline(uri)[source]

Bases: twisted.web.resource.Resource, coherence.log.LogAble

logCategory = 'externalprocess'
addSlash = False
pipeline_description = None
contentType = None
getChildWithDefault(path, request)[source]

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

render(request)[source]

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(path, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 0
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
transcoder_class_wrapper(klass, content_type, pipeline)[source]
class TranscoderManager(coherence=None)[source]

Bases: coherence.log.LogAble

singleton class which holds information about all available transcoders

they are put into a transcoders dict with their id as the key

we collect all internal transcoders by searching for all subclasses of InternalTranscoder, the class will be the value

transcoders defined in the config are parsed and stored as a dict in the transcoders dict

in the config a transcoder description has to look like this:

* preliminary, will be extended and might even change without further notice *

<transcoder>
<pipeline>%s …</pipeline> <!– we need a %s here to insert the
source uri (or can we have all the times pipelines we can prepend with a ‘%s !’) and an element named mux where we can attach our sink –>

<type>gstreamer</type> <!– could be gstreamer or process –> <name>mpegts</name> <target>video/mpeg</target> <fourth_field> <!– value for the 4th field of the

protocolInfo phalanx, default is ‘*’ –>

</transcoder>

initializes the class

it should be called at least once with the main coherence class passed as an argument, so we have access to the config

logCategory = 'transcoder_manager'
_instance_ = None
__init__(coherence=None)[source]

initializes the class

it should be called at least once with the main coherence class passed as an argument, so we have access to the config

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
select(name, uri, backend=None)[source]
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)

coherence.tube_service (module)

TUBE service classes

class MirabeauProxy[source]

Bases: twisted.web.resource.Resource, coherence.log.LogAble

logCategory = 'mirabeau'
isLeaf = 0
getChildWithDefault(path, request)[source]

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(path, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class TubeServiceControl(server)[source]

Bases: coherence.upnp.core.soap_service.UPnPPublisher

logCategory = 'mirabeau'
get_action_results(result, action, instance)[source]

check for out arguments if yes: check if there are related ones to StateVariables with

non A_ARG_TYPE_ prefix if yes: check if there is a call plugin method for this action

if yes: update StateVariable values with call result if no: get StateVariable values and

add them to result dict
soap__generic(*args, **kwargs)[source]

generic UPnP service control method, which will be used if no soap_ACTIONNAME method in the server service control class can be found

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
_gotError(failure, request, methodName, ns)
_gotResult(result, request, methodName, ns)
_methodNotFound(request, methodName)
_sendResponse(request, response, status=200)
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
decode_result(element)
delEntity(name)
encoding = 'UTF-8'
entityType = <InterfaceClass twisted.web.resource.IResource>
envelope_attrib = None
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(path, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
info(message, *args, **kwargs)
isLeaf = 1
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
lookupFunction(functionName)
msg(message, *args, **kwargs)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
render(request)

Handle a SOAP command.

render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

server = None
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class TubeServiceProxy(tube_service, device, backend=None)[source]

Bases: coherence.upnp.core.service.ServiceServer, twisted.web.resource.Resource

logCategory = 'mirabeau'
init_var_and_actions()[source]

retrieve all actions and create the Action classes for our (proxy) server

retrieve all variables and create the StateVariable classes for our (proxy) server

COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
_release()
build_last_change_event(instance=0, force=False)
build_single_notification(instance, variable_name, value)
check_moderated_variables()
check_subscribers()
create_new_instance(instance)
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
delEntity(name)
entityType = <InterfaceClass twisted.web.resource.IResource>
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
getChild(path, request)

Retrieve a ‘child’ resource from me.

Implement this to create dynamic resource generation – resources which are always available may be registered with self.putChild().

This will not be called if the class-level variable ‘isLeaf’ is set in your subclass; instead, the ‘postpath’ attribute of the request will be left as a list of the remaining path elements.

For example, the URL /foo/bar/baz will normally be:

| site.resource.getChild('foo').getChild('bar').getChild('baz').

However, if the resource returned by ‘bar’ has isLeaf set to true, then the getChild call will never be made on it.

Parameters and return value have the same meaning and requirements as those defined by L{IResource.getChildWithDefault}.

getChildForRequest(request)
getChildWithDefault(path, request)

Retrieve a static or dynamically generated child resource from me.

First checks if a resource was added manually by putChild, and then call getChild to check for dynamic resources. Only override if you want to affect behaviour of all child lookups, rather than just dynamic ones.

This will check to see if I have a pre-registered child resource of the given name, and call getChild if I do not.

@see: L{IResource.getChildWithDefault}

getDynamicEntity(name, request)
getStaticEntity(name)
get_action(action_name)
get_actions()
get_id()
get_scpdXML()
get_subscribers()
get_type()
get_variable(variable_name, instance=0)
get_variables()
info(message, *args, **kwargs)
isLeaf = 0
is_variable_moderated(name)
listDynamicEntities(request=None)
listDynamicNames()
listEntities()
listNames()
listStaticEntities()
listStaticNames()
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
new_subscriber(subscriber)
propagate_notification(notify)
putChild(path, child)

Register a static child.

You almost certainly don’t want ‘/’ in your path. If you intended to have the root of a folder, e.g. /foo/, you want path to be ‘’.

@see: L{IResource.putChild}

reallyPutEntity(name, entity)
register_vendor_action(name, implementation, arguments=None, needs_callback=True)

enables a backend to add an own, vendor defined, Action to the service

@ivar name: the name of the new Action @ivar implementation: either ‘optional’ or ‘required’ @ivar arguments: a C{list} if argument C{tuples},

like (name,direction,relatedStateVariable)
@ivar needs_callback: this Action needs a method in the backend
or service class
register_vendor_variable(name, implementation='optional', instance=0, evented='no', data_type='string', dependant_variable=None, default_value=None, allowed_values=None, has_vendor_values=False, allowed_value_range=None, moderated=False)

enables a backend to add an own, vendor defined, StateVariable to the service

@ivar name: the name of the new StateVariable @ivar implementation: either ‘optional’ or ‘required’ @ivar instance: the instance number of the service that variable

should be assigned to, usually ‘0’
@ivar evented: boolean, or the special keyword ‘never’ if the variable
doesn’t show up in a LastChange event too
@ivar data_type: ‘string’,’boolean’,’bin.base64’ or
various number formats
@ivar dependant_variable: the name of another StateVariable that
depends on this one
@ivar default_value: the value this StateVariable should have by
default when created for another instance of in the service

@ivar allowed_values: a C{list} of values this StateVariable can have @ivar has_vendor_values: boolean if there are values outside

the allowed_values list too
@ivar allowed_value_range: a C{dict} of ‘minimum’,’maximum’
and ‘step’ values
@ivar moderated: boolean, True if this StateVariable should only be
evented via a LastChange event
remove_instance(instance)
render(request)

Render a given resource. See L{IResource}’s render method.

I delegate to methods of self with the form ‘render_METHOD’ where METHOD is the HTTP that was used to make the request. Examples: render_GET, render_HEAD, render_POST, and so on. Generally you should implement those methods instead of overriding this one.

render_METHOD methods are expected to return a byte string which will be the rendered page, unless the return value is C{server.NOT_DONE_YET}, in which case it is this class’s responsibility to write the results using C{request.write(data)} and then call C{request.finish()}.

Old code that overrides render() directly is likewise expected to return a byte string or NOT_DONE_YET.

@see: L{IResource.render}

render_HEAD(request)

Default handling of HEAD method.

I just return self.render_GET(request). When method is HEAD, the framework will handle this correctly.

rm_notification(result, d)
server = None
set_variable(instance, variable_name, value, default=False)
simulate_notification()
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)
class TubeDeviceProxy(coherence, tube_device, external_address)[source]

Bases: coherence.log.LogAble

logCategory = 'dbus'
COLOR_FORMAT = '[%(levelname)-18s][\x1b[1m%(name)-15s\x1b[0m] %(message)s (\x1b[1m%(filename)s\x1b[0m:%(lineno)d)'
FORMAT = '[%(levelname)-18s][$BOLD%(name)-15s$RESET] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)'
_Loggable__logger = None
critical(message, *args, **kwargs)
debug(message, *args, **kwargs)
error(message, *args, **kwargs)
exception(message, *args, **kwargs)
fatal(message, *args, **kwargs)
info(message, *args, **kwargs)
log(message, *args, **kwargs)
msg(message, *args, **kwargs)
register()[source]
warn(message, *args, **kwargs)
warning(message, *args, **kwargs)