From b00fb026d59d9e4c5688236c55400a148f3b658b Mon Sep 17 00:00:00 2001 From: Nanda Scott Date: Fri, 16 Feb 2018 19:02:51 -0500 Subject: [PATCH] Fixed rulings errors for consistency. --- scrython/__init__.py | 3 +++ scrython/rulings/rulings_object.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scrython/__init__.py b/scrython/__init__.py index e92d240..a01e0df 100644 --- a/scrython/__init__.py +++ b/scrython/__init__.py @@ -13,3 +13,6 @@ from scrython.rulings import Mtgo from scrython.rulings import Multiverse from scrython.rulings import Id from scrython.rulings import Code + +#Import classes from sets +from scrython.sets import Code diff --git a/scrython/rulings/rulings_object.py b/scrython/rulings/rulings_object.py index 5781081..38a027d 100644 --- a/scrython/rulings/rulings_object.py +++ b/scrython/rulings/rulings_object.py @@ -40,48 +40,48 @@ class RulingsObject(object): def object(self): if self.__checkForKey('object') is None: - return KeyError('This object has no key \'object\'') + raise KeyError('This object has no key \'object\'') return self.scryfallJson['object'] def has_more(self): if self.__checkForKey('has_more') is None: - return KeyError('This object has no key \'has_more\'') + raise KeyError('This object has no key \'has_more\'') return self.scryfallJson['has_more'] def data(self): if self.__checkForKey('data') is None: - return KeyError('This object has no key \'data\'') + raise KeyError('This object has no key \'data\'') return self.scryfallJson['data'] def data_length(self): if self.__checkForKey('data') is None: - return KeyError('This object has no key \'data\'') + raise KeyError('This object has no key \'data\'') return len(self.scryfallJson['data']) def ruling_object(self, num): if self.__checkForTupleKey('data', num, 'object') is None: - return KeyError('This ruling has no key \'object\'') + raise KeyError('This ruling has no key \'object\'') return self.scryfallJson['data'][num]['object'] def ruling_source(self, num): if self.__checkForTupleKey('data', num, 'source') is None: - return KeyError('This ruling has no key \'source\'') + raise KeyError('This ruling has no key \'source\'') return self.scryfallJson['data'][num]['source'] def ruling_published_at(self, num): if self.__checkForTupleKey('data', num, 'published_at') is None: - return KeyError('This ruling has no key \'published_at\'') + raise KeyError('This ruling has no key \'published_at\'') return self.scryfallJson['data'][num]['published_at'] def ruling_comment(self, num): if self.__checkForTupleKey('data', num, 'comment') is None: - return KeyError('This ruling has no key \'comment\'') + raise KeyError('This ruling has no key \'comment\'') return self.scryfallJson['data'][num]['comment']