From 66cac951e6b1f7bbeedfcb9d0f8b5347b111658c Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sat, 22 Jun 2013 18:22:02 -0700 Subject: [PATCH] Fix a self error --- gkeys/seed.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gkeys/seed.py b/gkeys/seed.py index fc71551..544ab02 100644 --- a/gkeys/seed.py +++ b/gkeys/seed.py @@ -41,21 +41,24 @@ class Seeds(object): if not self.filename: logger.debug("Seed: load; Not a valid filename: '%s'" % str(self.filename)) return False - logger.debug("Seeds: Begin loading seed file %s" % self.filename) + logger.debug("Seeds: load; Begin loading seed file %s" % self.filename) seedlines = None self.seeds = [] try: with open(self.filename) as seedfile: seedlines = seedfile.readlines() except IOError as err: + logger.debug("Seed: load; IOError occurred while loading file") self._error(err) return False for seed in seedlines: try: - parts = self._split_seed(seed) + parts = self._split_seed(seed, self.separator) self.seeds.append(GKEY._make(parts)) except Exception as err: + logger.debug("Seed: load; Error splitting seed: %s" % seed) + logger.debug("Seed: load; ...............parts: %s" % str(parts)) self._error(err) logger.debug("Seed: load; Completed loading seed file %s" % self.filename) return True @@ -146,10 +149,10 @@ class Seeds(object): @staticmethod - def _split_seed(seed): + def _split_seed(seed, separator): '''Splits the seed string and replaces all occurances of 'None' with the python type None''' - iterable = seed.split(self.separator) + iterable = seed.split(separator) for i in range(len(iterable)): if iterable[i] == 'None': iterable[i] = None -- 2.26.2