Mercurial > hg > horiscopes
comparison V4/runme.py @ 23:11d4e438045e
make version 5
author | DaveM |
---|---|
date | Mon, 09 Apr 2018 15:07:21 +0100 |
parents | a5b8e2b91d8f |
children |
comparison
equal
deleted
inserted
replaced
22:a5b8e2b91d8f | 23:11d4e438045e |
---|---|
82 # def requestURL(url,payload): | 82 # def requestURL(url,payload): |
83 # r = requests.get(url, params=payload) | 83 # r = requests.get(url, params=payload) |
84 # time.sleep(5) | 84 # time.sleep(5) |
85 # return r | 85 # return r |
86 | 86 |
87 def loadPickUpdate(filename): | 87 # def loadPickUpdate(filename): |
88 | 88 |
89 def loadPick(filename): | 89 def loadPick(filename): |
90 with open(filename, 'rb') as handle: | 90 with open(filename, 'rb') as handle: |
91 b = pickle.load(handle) | 91 b = pickle.load(handle) |
92 return b | 92 return b |
144 parseSaveFile = pickFile.split('.')[0]+'_collect.pick' | 144 parseSaveFile = pickFile.split('.')[0]+'_collect.pick' |
145 if not os.path.exists(parseSaveFile): | 145 if not os.path.exists(parseSaveFile): |
146 parseHoriscope(people,parseSaveFile) | 146 parseHoriscope(people,parseSaveFile) |
147 else: | 147 else: |
148 people = loadPick(parseSaveFile) | 148 people = loadPick(parseSaveFile) |
149 if not os.path.exists('fullResults.pick'): | 149 # if not os.path.exists('fullResults.pick'): |
150 if os.path.exists('fullResults.pick'): | |
150 comp = syn.compatibility() | 151 comp = syn.compatibility() |
151 comp.parseCompatRules('compatibilityRules.csv') | 152 comp.parseCompatRules('compatibilityRules.csv') |
152 for person in people: | 153 for person in people: |
154 print person.id | |
153 person.score = None | 155 person.score = None |
154 if person.issue is None: | 156 if person.issue is None: |
155 person.score = comp.calcCompatibility(person.horiscope) | 157 person.score = comp.calcCompatibility(person.horiscope) |
156 if person.score is None: | 158 if person.score is None: |
157 person.issue = 'None Planet Locations' | 159 person.issue = 'None Planet Locations' |