diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch | 27 |
1 files changed, 27 insertions, 0 deletions
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 @@ | |||
| 1 | From 03bd5cb77c54033857810bb17562859eefa41221 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Simon Busch <simon.busch@lge.com> | ||
| 3 | Date: Wed, 9 Apr 2014 13:20:33 +0200 | ||
| 4 | Subject: [PATCH] Add possibility to import templates from packages | ||
| 5 | |||
| 6 | Does not have any unit tests yet. | ||
| 7 | |||
| 8 | Signed-off-by: Simon Busch <simon.busch@lge.com> | ||
| 9 | |||
| 10 | --- | ||
| 11 | dbusmock/mockobject.py | 3 +++ | ||
| 12 | 1 file changed, 3 insertions(+) | ||
| 13 | |||
| 14 | diff --git a/dbusmock/mockobject.py b/dbusmock/mockobject.py | ||
| 15 | index 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 | |||
