From f260eacb2d9707b09a822443363741c0eea8d0ab Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Tue, 12 May 2020 17:51:31 -0400 Subject: python3-dbusmock: re-add recipe and fix patch path Running the "non-gpl3" builder in my local autobuilder fails almost immediately because python3-dbusmock is not available. It appears that during the creation of meta-python2 and cleanup of meta-python that the recipe for python3-dbusmock got removed entirely, so I've re-added it, and renamed the corresponding patch folder so that it can find the patches listed in the recipe. Signed-off-by: Trevor Gamblin Signed-off-by: Khem Raj (cherry picked from commit 0acb9d90bcd2dadce2102fc3b98635b942e2042b) Signed-off-by: Armin Kuster --- ...nality-to-add-own-objects-to-internal-obj.patch | 52 ---------------------- ...ibility-to-import-templates-from-packages.patch | 27 ----------- ...nality-to-add-own-objects-to-internal-obj.patch | 52 ++++++++++++++++++++++ ...ibility-to-import-templates-from-packages.patch | 27 +++++++++++ .../python/python3-dbusmock_0.16.7.bb | 25 +++++++++++ 5 files changed, 104 insertions(+), 79 deletions(-) delete mode 100644 meta-python/recipes-devtools/python/python-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch delete mode 100644 meta-python/recipes-devtools/python/python-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch create mode 100644 meta-python/recipes-devtools/python/python3-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch create mode 100644 meta-python/recipes-devtools/python/python3-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch create mode 100644 meta-python/recipes-devtools/python/python3-dbusmock_0.16.7.bb (limited to 'meta-python') diff --git a/meta-python/recipes-devtools/python/python-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch b/meta-python/recipes-devtools/python/python-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch deleted file mode 100644 index c4d817849f..0000000000 --- a/meta-python/recipes-devtools/python/python-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch +++ /dev/null @@ -1,52 +0,0 @@ -From c4436fd42f2936e5fb0f95434d06e45aa9959ca0 Mon Sep 17 00:00:00 2001 -From: Simon Busch -Date: Wed, 9 Apr 2014 13:18:33 +0200 -Subject: [PATCH] Add functionality to add own objects to internal object - - list - -In some case the tests might want to create dynamically dbus objects which extended -functionality from own class definitions within templates. In such cases we need to -register those objects with the internal object manager of dbusmock. - -Signed-off-by: Simon Busch - ---- - dbusmock/__init__.py | 4 ++-- - dbusmock/mockobject.py | 8 ++++++++ - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/dbusmock/__init__.py b/dbusmock/__init__.py -index 8a482ab..3d5d71a 100644 ---- a/dbusmock/__init__.py -+++ b/dbusmock/__init__.py -@@ -14,8 +14,8 @@ __license__ = 'LGPL 3+' - __version__ = '0.16.7' - - from dbusmock.mockobject import (DBusMockObject, MOCK_IFACE, -- OBJECT_MANAGER_IFACE, get_object, get_objects) -+ OBJECT_MANAGER_IFACE, get_object, get_objects, add_object) - from dbusmock.testcase import DBusTestCase - - __all__ = ['DBusMockObject', 'MOCK_IFACE', 'OBJECT_MANAGER_IFACE', -- 'DBusTestCase', 'get_object', 'get_objects'] -+ 'DBusTestCase', 'get_object', 'get_objects', 'add_object'] -diff --git a/dbusmock/mockobject.py b/dbusmock/mockobject.py -index 586dbad..e4f130f 100644 ---- a/dbusmock/mockobject.py -+++ b/dbusmock/mockobject.py -@@ -688,6 +688,14 @@ dbus.service._method_lookup = _dbusmock_method_lookup - # Helper API for templates - # - -+def add_object(path, obj): -+ if path in objects: -+ raise dbus.exceptions.DBusException( -+ 'org.freedesktop.DBus.Mock.NameError', -+ 'object %s already exists' % path) -+ -+ objects[path] = obj -+ - - def get_objects(): - '''Return all existing object paths''' diff --git a/meta-python/recipes-devtools/python/python-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch b/meta-python/recipes-devtools/python/python-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch deleted file mode 100644 index 06ab1f05e2..0000000000 --- a/meta-python/recipes-devtools/python/python-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 03bd5cb77c54033857810bb17562859eefa41221 Mon Sep 17 00:00:00 2001 -From: Simon Busch -Date: Wed, 9 Apr 2014 13:20:33 +0200 -Subject: [PATCH] Add possibility to import templates from packages - -Does not have any unit tests yet. - -Signed-off-by: Simon Busch - ---- - dbusmock/mockobject.py | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/dbusmock/mockobject.py b/dbusmock/mockobject.py -index e4f130f..389df70 100644 ---- a/dbusmock/mockobject.py -+++ b/dbusmock/mockobject.py -@@ -46,6 +46,9 @@ def load_module(name): - exec(f.read(), mod.__dict__, mod.__dict__) - return mod - -+ if '.' in name: -+ return importlib.import_module(name) -+ - return importlib.import_module('dbusmock.templates.' + name) - - diff --git a/meta-python/recipes-devtools/python/python3-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch b/meta-python/recipes-devtools/python/python3-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch new file mode 100644 index 0000000000..c4d817849f --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch @@ -0,0 +1,52 @@ +From c4436fd42f2936e5fb0f95434d06e45aa9959ca0 Mon Sep 17 00:00:00 2001 +From: Simon Busch +Date: Wed, 9 Apr 2014 13:18:33 +0200 +Subject: [PATCH] Add functionality to add own objects to internal object + + list + +In some case the tests might want to create dynamically dbus objects which extended +functionality from own class definitions within templates. In such cases we need to +register those objects with the internal object manager of dbusmock. + +Signed-off-by: Simon Busch + +--- + dbusmock/__init__.py | 4 ++-- + dbusmock/mockobject.py | 8 ++++++++ + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/dbusmock/__init__.py b/dbusmock/__init__.py +index 8a482ab..3d5d71a 100644 +--- a/dbusmock/__init__.py ++++ b/dbusmock/__init__.py +@@ -14,8 +14,8 @@ __license__ = 'LGPL 3+' + __version__ = '0.16.7' + + from dbusmock.mockobject import (DBusMockObject, MOCK_IFACE, +- OBJECT_MANAGER_IFACE, get_object, get_objects) ++ OBJECT_MANAGER_IFACE, get_object, get_objects, add_object) + from dbusmock.testcase import DBusTestCase + + __all__ = ['DBusMockObject', 'MOCK_IFACE', 'OBJECT_MANAGER_IFACE', +- 'DBusTestCase', 'get_object', 'get_objects'] ++ 'DBusTestCase', 'get_object', 'get_objects', 'add_object'] +diff --git a/dbusmock/mockobject.py b/dbusmock/mockobject.py +index 586dbad..e4f130f 100644 +--- a/dbusmock/mockobject.py ++++ b/dbusmock/mockobject.py +@@ -688,6 +688,14 @@ dbus.service._method_lookup = _dbusmock_method_lookup + # Helper API for templates + # + ++def add_object(path, obj): ++ if path in objects: ++ raise dbus.exceptions.DBusException( ++ 'org.freedesktop.DBus.Mock.NameError', ++ 'object %s already exists' % path) ++ ++ objects[path] = obj ++ + + def get_objects(): + '''Return all existing object paths''' diff --git a/meta-python/recipes-devtools/python/python3-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch b/meta-python/recipes-devtools/python/python3-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch new file mode 100644 index 0000000000..06ab1f05e2 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch @@ -0,0 +1,27 @@ +From 03bd5cb77c54033857810bb17562859eefa41221 Mon Sep 17 00:00:00 2001 +From: Simon Busch +Date: Wed, 9 Apr 2014 13:20:33 +0200 +Subject: [PATCH] Add possibility to import templates from packages + +Does not have any unit tests yet. + +Signed-off-by: Simon Busch + +--- + dbusmock/mockobject.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/dbusmock/mockobject.py b/dbusmock/mockobject.py +index e4f130f..389df70 100644 +--- a/dbusmock/mockobject.py ++++ b/dbusmock/mockobject.py +@@ -46,6 +46,9 @@ def load_module(name): + exec(f.read(), mod.__dict__, mod.__dict__) + return mod + ++ if '.' in name: ++ return importlib.import_module(name) ++ + return importlib.import_module('dbusmock.templates.' + name) + + diff --git a/meta-python/recipes-devtools/python/python3-dbusmock_0.16.7.bb b/meta-python/recipes-devtools/python/python3-dbusmock_0.16.7.bb new file mode 100644 index 0000000000..cd760ab893 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-dbusmock_0.16.7.bb @@ -0,0 +1,25 @@ +# Copyright (c) 2014 LG Electronics, Inc. + +SUMMARY = "With this program/Python library you can easily create mock objects on D-Bus" +AUTHOR = "Martin Pitt " + +LICENSE = "GPL-3.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=e6a600fd5e1d9cbde2d983680233ad02" + +SRC_URI[md5sum] = "80f8caa838fad96483a8751e11d384f9" +SRC_URI[sha256sum] = "2d2ea892fa4633c3ec6ac1e912120ec493047a5c6522849b7d1c95ad755bce75" + +SRC_URI += " \ + file://0001-Add-functionality-to-add-own-objects-to-internal-obj.patch \ + file://0002-Add-possibility-to-import-templates-from-packages.patch \ +" + +PYPI_PACKAGE = "python-dbusmock" + +inherit pypi setuptools3 + +RDEPENDS_${PN} += "\ + ${PYTHON_PN}-dbus \ + ${PYTHON_PN}-pygobject \ + ${PYTHON_PN}-xml \ + " -- cgit 1.2.3-korg