Mercurial > repos > yating-l > gonramp_apollo_tools
diff apollo/ApolloUser.py @ 1:78af01d73add draft
planemo upload for repository https://github.com/Yating-L/suite_gonramp_apollo.git commit 9009fa8663038d2cb4a1c5130600a51f31f654a1-dirty
author | yating-l |
---|---|
date | Tue, 28 Nov 2017 12:43:22 -0500 |
parents | 1da8b9042af4 |
children |
line wrap: on
line diff
--- a/apollo/ApolloUser.py Mon Nov 27 14:47:03 2017 -0500 +++ b/apollo/ApolloUser.py Tue Nov 28 12:43:22 2017 -0500 @@ -45,16 +45,16 @@ self.logger.error("The %s format is not supported!", file_format) with open(filename, 'r') as f: lines = f.readlines() - headers = lines[0].rstrip().split(delimiter) + headers = lines[0].split(delimiter) users = [] lines = lines[1:] for l in lines: - print l l = l.split(delimiter) info = dict() fields = len(l) for i in range(fields): - info[headers[i]] = l[i] + title = headers[i].rstrip() + info[title] = l[i].rstrip() users.append(info) return users @@ -93,6 +93,6 @@ self.logger.error("Cannot find useremail in the text file, make sure you use the correct header, see README file for examples.") if not 'group' in u: self.logger.error("Cannot find group in the text file, make sure you use the correct header, see README file for examples.") - subtools.arrow_add_to_group(u['group'], u['useremail']) + subtools.arrow_remove_from_group(u['group'], u['useremail'])