comparison V4/synastry.py @ 22:a5b8e2b91d8f

fixing None Planets bug and reformatting output of fullResults
author DaveM
date Thu, 08 Mar 2018 20:36:44 +0000
parents ae220e89cb3a
children 11d4e438045e
comparison
equal deleted inserted replaced
21:0264a7888d54 22:a5b8e2b91d8f
98 self.cob = personDict['COB'] 98 self.cob = personDict['COB']
99 self.p_dob = personDict['pDOB'] 99 self.p_dob = personDict['pDOB']
100 self.p_tob = personDict['pTOB'] 100 self.p_tob = personDict['pTOB']
101 self.p_cob = personDict['pCOB'] 101 self.p_cob = personDict['pCOB']
102 self.horiscope = None 102 self.horiscope = None
103 self.resp = None
103 104
104 def identifyIssues(self): 105 def identifyIssues(self):
105 if self.id is None: 106 if self.id is None:
106 self.issue = 'id' 107 self.issue = 'id'
107 elif self.dob is None: 108 elif self.dob is None:
190 self.resp = requests.get(self.url, params=self.payload) 191 self.resp = requests.get(self.url, params=self.payload)
191 time.sleep(5) 192 time.sleep(5)
192 return self.resp 193 return self.resp
193 194
194 def parsePage(self): 195 def parsePage(self):
196 self.horiscope = None
197 if('Please use valid date.' in self.resp.content):
198 self.issue = 'dob'
199 return self.horiscope
200 elif('Please use valid time.' in self.resp.content):
201 self.issue = 'tob'
202 return self.horiscope
195 gotLocation = 0 203 gotLocation = 0
196 self.horiscope = planetPositions() 204 self.horiscope = planetPositions()
197 soup = BeautifulSoup(self.resp.content, 'lxml') 205 soup = BeautifulSoup(self.resp.content, 'lxml')
198 tcCell = soup.find_all('div', attrs={'class':'right-sedy-banner-svetlejsi'}) 206 tcCell = soup.find_all('div', attrs={'class':'right-sedy-banner-svetlejsi'})
199 for cell in tcCell: 207 for cell in tcCell:
275 def isInHouse(self,component,houseNo): 283 def isInHouse(self,component,houseNo):
276 # print (self.planets[component].houseA,self.planets[component].houseB,houseNo) 284 # print (self.planets[component].houseA,self.planets[component].houseB,houseNo)
277 if (self.planets[component].houseA == houseNo) or (self.planets[component].houseB == houseNo): 285 if (self.planets[component].houseA == houseNo) or (self.planets[component].houseB == houseNo):
278 return True 286 return True
279 return False 287 return False
288
289 def makeAllAspectTreple(self):
290 self.aspectTreple = {}
291 for p1 in planetPositions.planetNames:
292 for p2 in planetPositions.planetNames:
293 aspect = self.calcAspect(p1,p2)[0]
294 if aspect is not None:
295 self.aspectTreple[(p1,p2,aspect)] = 1
280 296
281 def calcAllAspects(self): 297 def calcAllAspects(self):
282 for p1 in planetPositions.planetNames: 298 for p1 in planetPositions.planetNames:
283 for p2 in planetPositions.planetNames: 299 for p2 in planetPositions.planetNames:
284 self.calcAspect(p1,p2) 300 self.calcAspect(p1,p2)