aboutsummaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python-dbusmock/0002-Add-possibility-to-import-templates-from-packages.patch
blob: 06ab1f05e2b0b59c77f4c768a4bf95a71b47d911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 03bd5cb77c54033857810bb17562859eefa41221 Mon Sep 17 00:00:00 2001
From: Simon Busch <simon.busch@lge.com>
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 <simon.busch@lge.com>

---
 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)