summaryrefslogtreecommitdiffstats
path: root/qtip/loader
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-02-23 20:51:38 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-02-24 11:19:17 +0800
commit245b6f4070d1b3b5124a184cb6442b55000fd321 (patch)
tree975a60229a1341a0cc2ea978943b2614b2ee099f /qtip/loader
parent452969c058a2f3f3327036b93cbc4bba4d7c574e (diff)
Fix bug when no paths is given for Plan constructor
FileLoader was trying to initialize abspath by finding a matched name from abspath which will lead to an exception. Use default paths of class instead. Change-Id: I8ca2122e97edd734aa68b4c6b12196960842313b Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'qtip/loader')
-rw-r--r--qtip/loader/file.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/qtip/loader/file.py b/qtip/loader/file.py
index 038f57dd..a39e15f6 100644
--- a/qtip/loader/file.py
+++ b/qtip/loader/file.py
@@ -28,11 +28,12 @@ class FileLoader(BaseLoader):
self._filename = name
self.abspath = self.find(name, paths=paths)
- def find(self, name, paths=None):
+ @classmethod
+ def find(cls, name, paths=None):
"""find a specification in searching paths"""
- paths = [self.abspath] if paths is None else paths
+ paths = cls._paths if paths is None else paths
for p in paths:
- abspath = path.join(p, self.RELATIVE_PATH, name)
+ abspath = path.join(p, cls.RELATIVE_PATH, name)
if path.exists(abspath):
return abspath
raise NotFoundError(name, paths)