From: Brian Dolbec Date: Sun, 23 Jun 2013 01:22:02 +0000 (-0700) Subject: Fix a self error X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=66cac951e6b1f7bbeedfcb9d0f8b5347b111658c;p=gentoo-keys.git Fix a self error --- 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