From 6f3b196fe61f1cd20b23e5a08a9a9f238e2f5c4d Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Fri, 21 Jun 2013 18:43:33 -0700 Subject: [PATCH] Add a configured separator for the in file seed info. --- gkeys/seed.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gkeys/seed.py b/gkeys/seed.py index d045a22..4b4710a 100644 --- a/gkeys/seed.py +++ b/gkeys/seed.py @@ -23,6 +23,8 @@ from gkeys.config import GKEY class Seeds(object): '''Handles all seed key file operations''' + separator = '|' + def __init__(self, filepath=None): '''Seeds class init function @@ -69,7 +71,7 @@ class Seeds(object): logger.debug("Begin saving seed file %s" % self.filename) try: with open(self.filename, 'w') as seedfile: - seedlines = [x.value_string() for x in self.seeds] + seedlines = [x.value_string(self.separator) for x in self.seeds] seedfile.write('\n'.join(seedlines)) seedfile.write("\n") except IOError as err: @@ -147,7 +149,7 @@ class Seeds(object): def _split_seed(seed): '''Splits the seed string and replaces all occurances of 'None' with the python type None''' - iterable = seed.split() + iterable = seed.split(self.separator) for i in range(len(iterable)): if iterable[i] == 'None': iterable[i] = None -- 2.26.2