summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python-dbusmock
diff options
context:
space:
mode:
authorTrevor Gamblin <trevor.gamblin@windriver.com>2020-05-12 17:51:31 -0400
committerKhem Raj <raj.khem@gmail.com>2020-05-12 15:58:06 -0700
commit0acb9d90bcd2dadce2102fc3b98635b942e2042b (patch)
treec84938ff57610d80ee683f7238517091d632d889 /meta-python/recipes-devtools/python/python-dbusmock
parentb80664c82b6c7c459c23b26dadbefe50c2ee779a (diff)
downloadmeta-openembedded-0acb9d90bcd2dadce2102fc3b98635b942e2042b.tar.gz
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 <trevor.gamblin@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python-dbusmock')
-rw-r--r--meta-python/recipes-devtools/python/python-dbusmock/0001-Add-functionality-to-add-own-objects-to-internal-obj.patch52
-rw-r--r--meta-python/recipes-devtools/python/python-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch27
2 files changed, 0 insertions, 79 deletions
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 c4d817849..000000000
--- 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 @@
1From c4436fd42f2936e5fb0f95434d06e45aa9959ca0 Mon Sep 17 00:00:00 2001
2From: Simon Busch <simon.busch@lge.com>
3Date: Wed, 9 Apr 2014 13:18:33 +0200
4Subject: [PATCH] Add functionality to add own objects to internal object
5
6 list
7
8In some case the tests might want to create dynamically dbus objects which extended
9functionality from own class definitions within templates. In such cases we need to
10register those objects with the internal object manager of dbusmock.
11
12Signed-off-by: Simon Busch <simon.busch@lge.com>
13
14---
15 dbusmock/__init__.py | 4 ++--
16 dbusmock/mockobject.py | 8 ++++++++
17 2 files changed, 10 insertions(+), 2 deletions(-)
18
19diff --git a/dbusmock/__init__.py b/dbusmock/__init__.py
20index 8a482ab..3d5d71a 100644
21--- a/dbusmock/__init__.py
22+++ b/dbusmock/__init__.py
23@@ -14,8 +14,8 @@ __license__ = 'LGPL 3+'
24 __version__ = '0.16.7'
25
26 from dbusmock.mockobject import (DBusMockObject, MOCK_IFACE,
27- OBJECT_MANAGER_IFACE, get_object, get_objects)
28+ OBJECT_MANAGER_IFACE, get_object, get_objects, add_object)
29 from dbusmock.testcase import DBusTestCase
30
31 __all__ = ['DBusMockObject', 'MOCK_IFACE', 'OBJECT_MANAGER_IFACE',
32- 'DBusTestCase', 'get_object', 'get_objects']
33+ 'DBusTestCase', 'get_object', 'get_objects', 'add_object']
34diff --git a/dbusmock/mockobject.py b/dbusmock/mockobject.py
35index 586dbad..e4f130f 100644
36--- a/dbusmock/mockobject.py
37+++ b/dbusmock/mockobject.py
38@@ -688,6 +688,14 @@ dbus.service._method_lookup = _dbusmock_method_lookup
39 # Helper API for templates
40 #
41
42+def add_object(path, obj):
43+ if path in objects:
44+ raise dbus.exceptions.DBusException(
45+ 'org.freedesktop.DBus.Mock.NameError',
46+ 'object %s already exists' % path)
47+
48+ objects[path] = obj
49+
50
51 def get_objects():
52 '''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 06ab1f05e..000000000
--- a/meta-python/recipes-devtools/python/python-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1From 03bd5cb77c54033857810bb17562859eefa41221 Mon Sep 17 00:00:00 2001
2From: Simon Busch <simon.busch@lge.com>
3Date: Wed, 9 Apr 2014 13:20:33 +0200
4Subject: [PATCH] Add possibility to import templates from packages
5
6Does not have any unit tests yet.
7
8Signed-off-by: Simon Busch <simon.busch@lge.com>
9
10---
11 dbusmock/mockobject.py | 3 +++
12 1 file changed, 3 insertions(+)
13
14diff --git a/dbusmock/mockobject.py b/dbusmock/mockobject.py
15index e4f130f..389df70 100644
16--- a/dbusmock/mockobject.py
17+++ b/dbusmock/mockobject.py
18@@ -46,6 +46,9 @@ def load_module(name):
19 exec(f.read(), mod.__dict__, mod.__dict__)
20 return mod
21
22+ if '.' in name:
23+ return importlib.import_module(name)
24+
25 return importlib.import_module('dbusmock.templates.' + name)
26
27