dbus-python-client-gen


Namedbus-python-client-gen JSON
Version 0.8.3 PyPI version JSON
download
home_pagehttps://github.com/stratis-storage/dbus-python-client-gen
Summarytransforms values into properly wrapped dbus-python objects
upload_time2023-04-28 00:40:00
maintainer
docs_urlNone
authorAnne Mulhern
requires_python
licenseMPL-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            A Python Library for Generating dbus-python Client Code
=======================================================

Function
--------
This library contains a function, make_class, that consumes
an XML specification of a D-Bus interface. ::

>>> Klass = make_class("Klass", spec)

This call yields a Python class, called Klass, with two static class
members, "Methods" and "Properties". The "Methods" class has a static
method corresponding to each method defined in the interface. Each method
takes a proxy object as its first argument followed by any number of
keyword arguments, corresponding to the arguments of the method. The
"Properties" class has a static class corresponding to every property
defined in the interface. Each property class may have a static Get() or
Set() method, depending on its attributes.

For example, assuming the interface defines a read only Version property,
the following call should return a value. ::

>>> Klass.Properties.Version.Get()

However, since Version is a read only property, the following call should
fail with an AttributeError. ::

>>> Klass.Properties.Version.Set("42")

Similarly, if the interface defines a method, Create, with one argument,
name, a STRING, the following call should succeed. ::

>>> Klass.Methods.Create(proxy, name="name")

The Create method invokes the method on the proxy object, passing force,
transformed into a dbus-python String type.

On the other hand, the invocation will raise a DPClientError exception if
the method is called with an argument with an incorrect type as, ::

>>> Klass.Methods.Create(proxy, name=false)

or with an incorrect keyword as, ::

>>> Klass.Methods.Create(proxy, force=false)

or without all the necessary keywords as, ::

>>> Klass.Methods.Create(proxy)

Errors
------
This library exports the exception type, DPClientError and all its subtypes.
It constitutes a bug if an error of any other type is propagated during class
generation or when the methods of the class are executed.

The following shows the error hierarchy. Entries after the dash indicate
additional fields, beyond the message, which the exception contains. Only
leaves of the error class heirarchy are constructed directly.


DPClientError

  * DPClientGenerationError
    This exception is raised if an error occurs while generating the method.
    Such an exception would result from introspection data which lacked the
    necessary attributes or entries.

  * DPClientRuntimeError - interface name
    This exception is raised if there is an error while the generated method is
    executing.

    - DPClientInvalidArgError
      This exception is raised if the arguments to be passed to the D-Bus
      method are incorrect.

        * DPClientKeywordError - method name, expected and actual keywords
          This exception is raised if there are missing or unexpected arguments.

        * DPClientMarshallingError - original arguments
          This exception is raised if the arguments can not be transformed to
          their required dbus-python types.

    - DPClientInvocationError - invocation context
      This exception is raised if a dbus-python method is invoked and some error
      occurs. This exception's invocation context is used to distinguish between
      a method call, a get property call, and a set property call. The context
      is an object of type DPClientInvocationContext.

The DPClientInvocationContext hierarchy is shown below. Entries after the
dash indicate the fields in the context.

DPClientInvocationContext

  * DPClientMethodCallContext - method name, arguments

  * DPClientGetPropertyContext - property name

  * DPClientSetPropertyContext - property name, value


Dependencies
------------
* dbus-python
* into-dbus-python

Requirements
------------
This library is not compatible with Python 2.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/stratis-storage/dbus-python-client-gen",
    "name": "dbus-python-client-gen",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Anne Mulhern",
    "author_email": "amulhern@redhat.com",
    "download_url": "https://files.pythonhosted.org/packages/57/9a/3976e1ba68b1bf82dc6b47b712d085d948c4dc7f844d797302676e4de305/dbus-python-client-gen-0.8.3.tar.gz",
    "platform": "Linux",
    "description": "A Python Library for Generating dbus-python Client Code\n=======================================================\n\nFunction\n--------\nThis library contains a function, make_class, that consumes\nan XML specification of a D-Bus interface. ::\n\n>>> Klass = make_class(\"Klass\", spec)\n\nThis call yields a Python class, called Klass, with two static class\nmembers, \"Methods\" and \"Properties\". The \"Methods\" class has a static\nmethod corresponding to each method defined in the interface. Each method\ntakes a proxy object as its first argument followed by any number of\nkeyword arguments, corresponding to the arguments of the method. The\n\"Properties\" class has a static class corresponding to every property\ndefined in the interface. Each property class may have a static Get() or\nSet() method, depending on its attributes.\n\nFor example, assuming the interface defines a read only Version property,\nthe following call should return a value. ::\n\n>>> Klass.Properties.Version.Get()\n\nHowever, since Version is a read only property, the following call should\nfail with an AttributeError. ::\n\n>>> Klass.Properties.Version.Set(\"42\")\n\nSimilarly, if the interface defines a method, Create, with one argument,\nname, a STRING, the following call should succeed. ::\n\n>>> Klass.Methods.Create(proxy, name=\"name\")\n\nThe Create method invokes the method on the proxy object, passing force,\ntransformed into a dbus-python String type.\n\nOn the other hand, the invocation will raise a DPClientError exception if\nthe method is called with an argument with an incorrect type as, ::\n\n>>> Klass.Methods.Create(proxy, name=false)\n\nor with an incorrect keyword as, ::\n\n>>> Klass.Methods.Create(proxy, force=false)\n\nor without all the necessary keywords as, ::\n\n>>> Klass.Methods.Create(proxy)\n\nErrors\n------\nThis library exports the exception type, DPClientError and all its subtypes.\nIt constitutes a bug if an error of any other type is propagated during class\ngeneration or when the methods of the class are executed.\n\nThe following shows the error hierarchy. Entries after the dash indicate\nadditional fields, beyond the message, which the exception contains. Only\nleaves of the error class heirarchy are constructed directly.\n\n\nDPClientError\n\n  * DPClientGenerationError\n    This exception is raised if an error occurs while generating the method.\n    Such an exception would result from introspection data which lacked the\n    necessary attributes or entries.\n\n  * DPClientRuntimeError - interface name\n    This exception is raised if there is an error while the generated method is\n    executing.\n\n    - DPClientInvalidArgError\n      This exception is raised if the arguments to be passed to the D-Bus\n      method are incorrect.\n\n        * DPClientKeywordError - method name, expected and actual keywords\n          This exception is raised if there are missing or unexpected arguments.\n\n        * DPClientMarshallingError - original arguments\n          This exception is raised if the arguments can not be transformed to\n          their required dbus-python types.\n\n    - DPClientInvocationError - invocation context\n      This exception is raised if a dbus-python method is invoked and some error\n      occurs. This exception's invocation context is used to distinguish between\n      a method call, a get property call, and a set property call. The context\n      is an object of type DPClientInvocationContext.\n\nThe DPClientInvocationContext hierarchy is shown below. Entries after the\ndash indicate the fields in the context.\n\nDPClientInvocationContext\n\n  * DPClientMethodCallContext - method name, arguments\n\n  * DPClientGetPropertyContext - property name\n\n  * DPClientSetPropertyContext - property name, value\n\n\nDependencies\n------------\n* dbus-python\n* into-dbus-python\n\nRequirements\n------------\nThis library is not compatible with Python 2.\n",
    "bugtrack_url": null,
    "license": "MPL-2.0",
    "summary": "transforms values into properly wrapped dbus-python objects",
    "version": "0.8.3",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d9be08a3b0f0f23cf97b06de086de0314f57d6f9026ad38b291ab3349f47f859",
                "md5": "80f83a0f20d8d0eee17203fb08450363",
                "sha256": "1a87b212b62052bc936c5994457578c580f50d95910460881ec803fadb50d68f"
            },
            "downloads": -1,
            "filename": "dbus_python_client_gen-0.8.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "80f83a0f20d8d0eee17203fb08450363",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 14422,
            "upload_time": "2023-04-28T00:39:58",
            "upload_time_iso_8601": "2023-04-28T00:39:58.472609Z",
            "url": "https://files.pythonhosted.org/packages/d9/be/08a3b0f0f23cf97b06de086de0314f57d6f9026ad38b291ab3349f47f859/dbus_python_client_gen-0.8.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "579a3976e1ba68b1bf82dc6b47b712d085d948c4dc7f844d797302676e4de305",
                "md5": "8d6f897e29bc9c884ec62f6ff69f002d",
                "sha256": "741e11c296b3d55059e34a75d1b64b6999379b346db01e217a256f7e884952c1"
            },
            "downloads": -1,
            "filename": "dbus-python-client-gen-0.8.3.tar.gz",
            "has_sig": false,
            "md5_digest": "8d6f897e29bc9c884ec62f6ff69f002d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15072,
            "upload_time": "2023-04-28T00:40:00",
            "upload_time_iso_8601": "2023-04-28T00:40:00.382685Z",
            "url": "https://files.pythonhosted.org/packages/57/9a/3976e1ba68b1bf82dc6b47b712d085d948c4dc7f844d797302676e4de305/dbus-python-client-gen-0.8.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-28 00:40:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "stratis-storage",
    "github_project": "dbus-python-client-gen",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dbus-python-client-gen"
}
        
Elapsed time: 0.06153s