GUPnP.DeviceInfo

g GObject.Object GObject.Object GUPnP.DeviceInfo GUPnP.DeviceInfo GObject.Object->GUPnP.DeviceInfo

Subclasses:

GUPnP.Device, GUPnP.DeviceProxy

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_context ()

get_description_value (element)

get_device (type)

get_device_type ()

get_friendly_name ()

get_icon_async (requested_mime_type, requested_depth, requested_width, requested_height, prefer_bigger, cancellable, callback, *user_data)

get_icon_finish (res)

get_icon_url (requested_mime_type, requested_depth, requested_width, requested_height, prefer_bigger)

get_location ()

get_manufacturer ()

get_manufacturer_url ()

get_model_description ()

get_model_name ()

get_model_number ()

get_model_url ()

get_presentation_url ()

get_resource_factory ()

get_serial_number ()

get_service (type)

get_udn ()

get_upc ()

get_url_base ()

list_device_types ()

list_devices ()

list_dlna_capabilities ()

list_dlna_device_class_identifier ()

list_service_types ()

list_services ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

context

GUPnP.Context

r/w/co

The GUPnP.Context

device-type

str

r/w/co

The device type

document

GUPnP.XMLDoc

r/w/c

The XML document related to this device

element

int

w/c

The XML element related to this device

location

str

r/w/c

The location of the device description file

resource-factory

GUPnP.ResourceFactory

r/w/co

The resource factory to use

udn

str

r/w/co

The Unique Device Name

url-base

GLib.Uri

r/w/c

The URL base

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class GUPnP.DeviceInfo(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

GUPnP.DeviceInfoClass

Device information shared by local and remote devices

This class aggregates the information that is shared between remote and local devices.

get_context()
Returns:

The GUPnP.Context the devices is operating on.

Return type:

GUPnP.Context

Get the associated GUPnP.Context.

get_description_value(element)
Parameters:

element (str) – Name of the description element to retrieve

Returns:

a newly allocated string containing the requested value or None if the device description doesn’t contain the given element

Return type:

str or None

This function provides generic access to the contents of arbitrary elements in the device description file.

New in version 0.14.0.

get_device(type)
Parameters:

type (str) – The type of the device to be retrieved.

Returns:

A new GUPnP.DeviceInfo.

Return type:

GUPnP.DeviceInfo or None

Get the device with type type directly contained in self as a new object implementing GUPnP.DeviceInfo, or None if no such device was found. The returned object should be unreffed when done.

Note that devices are not cached internally, so that every time you call this function a new object is created. The application must cache any used devices if it wishes to keep them around and re-use them.

get_device_type()
Returns:

A constant string, or None.

Return type:

str

Get the UPnP device type of this GUPnP.DeviceInfo, e.g. urn:schemas-upnp-org:device:InternetGatewayDevice:1

get_friendly_name()
Returns:

A newly allocated string containing the “friendly name” of the device, or None if not available. GLib.free() after use.

Return type:

str or None

Get the friendly name of the device.

get_icon_async(requested_mime_type, requested_depth, requested_width, requested_height, prefer_bigger, cancellable, callback, *user_data)
Parameters:
  • requested_mime_type (str or None) – The requested file format, or None for any

  • requested_depth (int) – The requested color depth, or -1 for any

  • requested_width (int) – The requested width, or -1 for any

  • requested_height (int) – The requested height, or -1 for any

  • prefer_bigger (bool) – True if a bigger, rather than a smaller icon should be returned if no exact match could be found

  • cancellable (Gio.Cancellable or None) –

  • callback (Gio.AsyncReadyCallback or None) –

  • user_data (object or None) –

Download the device icon matching the request parameters. For details on the lookup procedure, see [method`GUPnP`.DeviceInfo.get_icon_url]

get_icon_finish(res)
Parameters:

res (Gio.AsyncResult) – A Gio.AsyncResult

Raises:

GLib.Error

Returns:

A GLib.Bytes contaning the icon or None on either error or no matching icon was found.

mime:

The location where to store the the format of the returned icon, or None. The returned string should be freed after use

depth:

The location where to store the depth of the returned icon, or None

width:

The location where to store the width of the returned icon, or None

height:

The location where to store the height of the returned icon, or None

Return type:

(GLib.Bytes, mime: str, depth: int, width: int, height: int)

get_icon_url(requested_mime_type, requested_depth, requested_width, requested_height, prefer_bigger)
Parameters:
  • requested_mime_type (str or None) – The requested file format, or None for any

  • requested_depth (int) – The requested color depth, or -1 for any

  • requested_width (int) – The requested width, or -1 for any

  • requested_height (int) – The requested height, or -1 for any

  • prefer_bigger (bool) – True if a bigger, rather than a smaller icon should be returned if no exact match could be found

Returns:

a string, or None. GLib.free() after use.

mime_type:

The location where to store the the format of the returned icon, or None. The returned string should be freed after use

depth:

The location where to store the depth of the returned icon, or None

width:

The location where to store the width of the returned icon, or None

height:

The location where to store the height of the returned icon, or None

Return type:

(str or None, mime_type: str, depth: int, width: int, height: int)

Get an URL pointing to the icon most closely matching the given criteria, or None.

If requested_mime_type is set, only icons with this mime type will be returned. If requested_depth is set, only icons with this or lower depth will be returned. If requested_width and/or requested_height are set, only icons that are this size or smaller are returned, unless prefer_bigger is set, in which case the next biggest icon will be returned. The returned strings should be freed.

get_location()
Returns:

A s

Return type:

str

Get the URL of the device file

get_manufacturer()
Returns:

A newly allocated string containing the manufacturer of the device, or None if not available. GLib.free() after use.

Return type:

str or None

Get the manufacturer of the device.

get_manufacturer_url()
Returns:

A string, or None. GLib.free() after use.

Return type:

str or None

Get an URL pointing to the manufacturer’s website.

get_model_description()
Returns:

A string, or None. GLib.free() after use.

Return type:

str or None

Get the description of the device model.

get_model_name()
Returns:

A string, or None. GLib.free() after use.

Return type:

str or None

Get the model name of the device.

get_model_number()
Returns:

A string, or None. GLib.free() after use.

Return type:

str or None

Get the model number of the device.

get_model_url()
Returns:

A string, or None. GLib.free() after use.

Return type:

str or None

Get an URL pointing to the device model’s website.

get_presentation_url()
Returns:

A string, or None. GLib.free() after use.

Return type:

str or None

Get an URL pointing to the device’s presentation page, for web-based administration, if available.

get_resource_factory()
Returns:

A GUPnP.ResourceFactory.

Return type:

GUPnP.ResourceFactory

Get the GUPnP.ResourceFactory used by the self.

get_serial_number()
Returns:

A string, or None. GLib.free() after use.

Return type:

str or None

Get the serial number of the device.

get_service(type)
Parameters:

type (str) – The type of the service to be retrieved.

Returns:

A GUPnP.ServiceInfo.

Return type:

GUPnP.ServiceInfo or None

Get the service with type type directly contained in self as a new object implementing GUPnP.ServiceInfo, or None if no such device was found.

Note that services are not cached internally, so that every time you call this function a new object is created. The application must cache any used services if it wishes to keep them around and re-use them.

get_udn()
Returns:

A constant string.

Return type:

str

Get the Unique Device Name of the device.

get_upc()
Returns:

A string, or None. GLib.free() after use.

Return type:

str or None

Get the Universal Product Code of the device.

get_url_base()
Returns:

A #SoupURI.

Return type:

GLib.Uri

Get the URL base of this device.

list_device_types()
Returns:

A GLib.List of strings. The elements should be GLib.free()’d and the list should be g_list_free()’d.

Return type:

[str] or None

Get a GLib.List of strings representing the types of the devices directly contained in self.

list_devices()
Returns:

a GLib.List of new GUPnP.DeviceInfo objects or None if no devices are

Return type:

[GUPnP.DeviceInfo] or None

Get a GLib.List of new objects implementing GUPnP.DeviceInfo representing the devices directly contained in self, excluding itself.

Note that devices are not cached internally, so that every time you call this function new objects are created. The application must cache any used devices if it wishes to keep them around and re-use them.

list_dlna_capabilities()
Returns:

a GLib.List of newly allocated strings or None if the device description doesn’t contain the <dlna:X_DLNACAP> element.

Return type:

[str] or None

Get a GLib.List of strings that represent the device capabilities as announced in the device description file using the <dlna:X_DLNACAP> element.

New in version 0.14.0.

list_dlna_device_class_identifier()
Returns:

a GLib.List of newly allocated strings or None if the device description doesn’t contain any <dlna:X_DLNADOC> element.

Return type:

[str] or None

Get a list of strings that represent the device class and version as announced in the device description file using the <dlna:X_DLNADOC> element, e.g. DMS-1.51, M-DMS-1.51 and so on.

New in version 0.20.4.

list_service_types()
Returns:

A GLib.List of strings. The elements should be GLib.free()’d and the list should be g_list_free()’d.

Return type:

[str] or None

Get a GLib.List of strings representing the types of the services directly contained in self, but not in its subdevices.

list_services()
Returns:

A GLib.List of new GUPnP.ServiceInfo objects.

Return type:

[GUPnP.ServiceInfo] or None

Get a GLib.List of new objects implementing GUPnP.ServiceInfo representing the services directly contained in self. The returned list should be g_list_free()’d and the elements should be GObject.Object.unref()’d.

Note that services are not cached internally, so that every time you call function new objects are created. The application must cache any used services if it wishes to keep them around and re-use them.

Property Details

GUPnP.DeviceInfo.props.context
Name:

context

Type:

GUPnP.Context

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The GUPnP.Context to use.

GUPnP.DeviceInfo.props.device_type
Name:

device-type

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The device type, e.g. urn:schemas-upnp-org:device:InternetGatewayDevice:1

GUPnP.DeviceInfo.props.document
Name:

document

Type:

GUPnP.XMLDoc

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The description document

GUPnP.DeviceInfo.props.element
Name:

element

Type:

int

Default Value:

None

Flags:

WRITABLE, CONSTRUCT

Private property.

GUPnP.DeviceInfo.props.location
Name:

location

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The location of the device description file.

GUPnP.DeviceInfo.props.resource_factory
Name:

resource-factory

Type:

GUPnP.ResourceFactory

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The resource factory to use. Set to None for default factory.

GUPnP.DeviceInfo.props.udn
Name:

udn

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The UDN of this device.

GUPnP.DeviceInfo.props.url_base
Name:

url-base

Type:

GLib.Uri

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The URL base (GLib.Uri).