From 039a35a344d132bf1c086e6e5b40b7e7615d4447 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Sun, 5 Jan 2014 15:29:30 +0100 Subject: [PATCH] Fix bug in ManifestError __str__ function + some formatting fixes --- base/manifest.py | 4 ++-- common/exceptions.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/base/manifest.py b/base/manifest.py index e756626..a51f826 100644 --- a/base/manifest.py +++ b/base/manifest.py @@ -62,5 +62,5 @@ class Manifest(object): self.validation_error(e.message, e.path) def validation_error(self, message, json_path=None): - from common.exceptions import ManifestError - raise ManifestError(message, self.path, json_path) + from common.exceptions import ManifestError + raise ManifestError(message, self.path, json_path) diff --git a/common/exceptions.py b/common/exceptions.py index c82950f..33f0df6 100644 --- a/common/exceptions.py +++ b/common/exceptions.py @@ -8,8 +8,8 @@ class ManifestError(Exception): def __str__(self): if self.json_path is not None: - path = '.'.join(self.json_path) - return ('{msg}\n\tFile: {file}\n\tJSON path: {jsonpath}' + path = '.'.join(map(str, self.json_path)) + return ('{msg}\n File path: {file}\n JSON path: {jsonpath}' .format(msg=self.message, file=self.manifest_path, jsonpath=path)) return '{file}: {msg}'.format(msg=self.message, file=self.manifest_path) @@ -19,7 +19,7 @@ class TaskListError(Exception): self.message = message def __str__(self): - return "Error in tasklist: {0}".format(self.message) + return 'Error in tasklist: {msg}'.format(msg=self.message) class TaskError(Exception):