Example #1
0
 def get(self):    
   bday = self.request.get('bday')     
   btype = self.request.get('btype')    
   [lewis, spiller, chinese, millman] = calculate.calculate(bday)
   logging.debug(lewis)
   lewis_int = [int(x) for x in lewis]
   mb = calculate.calculate_mbti_full([lewis, spiller, chinese, millman]) 
   cycle, now_year, str_d = calculate.calculate_cycle(bday)
   res = {"lewis": lewis_int, "spiller": spiller, "chinese": chinese, "millman": millman, "mb": mb, "cycle": cycle}
   self.response.out.write(simplejson.dumps(res))
Example #2
0
  def get(self):    
    res = []
    bdays = self.request.get('bdays')
    for bday in bdays.split(","): 
      bday_date = datetime.datetime.strptime(bday, '%B %d %Y').date()
      bday_pb_date = bday_date.strftime('%Y%m%d')
      [lewis, spiller, chinese, millman] = calculate.calculate(bday_pb_date)
      logging.debug(lewis)
      lewis_int = [int(x) for x in lewis]
      mb_astro_res = calculate.calculate_mb([lewis, spiller, chinese, millman]) 
      cycle, now_year, str_d = calculate.calculate_cycle(bday_pb_date)
      res.append({"lewis": lewis_int, "spiller": spiller, "chinese": chinese, "millman": millman, "mb": mb_astro_res, "cycle": cycle, "bday": bday_pb_date})

    self.response.out.write(simplejson.dumps(res))
Example #3
0
    def get(self):
        d = self.request.get('d')
        btype = self.request.get('btype')

        try:
            lewis, spiller, chinese, millman = calculate.calculate(d)

            lewi_summary = self.get_lewi(lewis[0])
            spiller_summary = self.get_spiller(spiller)
            chinese_summary = self.get_chinese(chinese)
            millman_summary = self.get_millman(millman[0])
            mbti_summary = self.get_mbti()

            cycle, now_year, str_d = calculate.calculate_cycle(d)

            mb_astro_res = calculate.calculate_mbti_full(
                [lewis, spiller, chinese, millman])
            logging.debug(mb_astro_res)

            path = os.path.join(os.path.dirname(__file__), 'reading.html')
            template_values = {
                'code_date': d,
                'date': str_d,
                'lewi_main': lewis[0],
                'lewis': lewis,
                'spiller': spiller,
                'spiller_converted': convertSpiller(spiller),
                'chinese': chinese,
                'btype': btype,
                'millman': millman,
                'millman_main': millman[0],
                'mb': mb_astro_res,
                'lewi_summary': lewi_summary,
                'spiller_summary': spiller_summary,
                'chinese_summary': chinese_summary,
                'millman_summary': millman_summary,
                'mbti_summary': mbti_summary,
                'cycle': cycle,
                'now_year': now_year
            }
        except Exception, e:
            logging.debug(e)
            path = os.path.join(os.path.dirname(__file__), 'explore.html')
            template_values = {
                'error': 'Wrong date',
            }
Example #4
0
 def get(self):
     bday = self.request.get('bday')
     btype = self.request.get('btype')
     [lewis, spiller, chinese, millman] = calculate.calculate(bday)
     logging.debug(lewis)
     lewis_int = [int(x) for x in lewis]
     mb = calculate.calculate_mbti_full([lewis, spiller, chinese, millman])
     cycle, now_year, str_d = calculate.calculate_cycle(bday)
     res = {
         "lewis": lewis_int,
         "spiller": spiller,
         "chinese": chinese,
         "millman": millman,
         "mb": mb,
         "cycle": cycle
     }
     self.response.out.write(simplejson.dumps(res))
Example #5
0
  def get(self):
    d = self.request.get('d')     
    btype = self.request.get('btype') 

    try:
      lewis, spiller, chinese, millman = calculate.calculate(d)
      
      lewi_summary = self.get_lewi(lewis[0])
      spiller_summary = self.get_spiller(spiller)
      chinese_summary = self.get_chinese(chinese)
      millman_summary = self.get_millman(millman[0])
      mbti_summary = self.get_mbti()

      cycle, now_year, str_d = calculate.calculate_cycle(d)

      mb_astro_res = calculate.calculate_mbti_full([lewis, spiller, chinese, millman])
      logging.debug(mb_astro_res)
      
      path = os.path.join(os.path.dirname(__file__), 'reading.html')
      template_values = {
        'code_date': d,
        'date': str_d,
        'lewi_main': lewis[0],
        'lewis': lewis,
        'spiller': spiller,
        'spiller_converted': convertSpiller(spiller),
        'chinese': chinese,
        'btype': btype,
        'millman': millman,
        'millman_main': millman[0],
        'mb': mb_astro_res,
        'lewi_summary': lewi_summary,
        'spiller_summary': spiller_summary,
        'chinese_summary': chinese_summary,
        'millman_summary': millman_summary,
        'mbti_summary': mbti_summary,
        'cycle': cycle,
        'now_year': now_year
        }  
    except Exception, e:
      logging.debug(e)
      path = os.path.join(os.path.dirname(__file__), 'explore.html')
      template_values = {
        'error': 'Wrong date',
        }        
Example #6
0
    def get(self):
        res = []
        bdays = self.request.get('bdays')
        for bday in bdays.split(","):
            bday_date = datetime.datetime.strptime(bday, '%B %d %Y').date()
            bday_pb_date = bday_date.strftime('%Y%m%d')
            [lewis, spiller, chinese,
             millman] = calculate.calculate(bday_pb_date)
            logging.debug(lewis)
            lewis_int = [int(x) for x in lewis]
            mb_astro_res = calculate.calculate_mb(
                [lewis, spiller, chinese, millman])
            cycle, now_year, str_d = calculate.calculate_cycle(bday_pb_date)
            res.append({
                "lewis": lewis_int,
                "spiller": spiller,
                "chinese": chinese,
                "millman": millman,
                "mb": mb_astro_res,
                "cycle": cycle,
                "bday": bday_pb_date
            })

        self.response.out.write(simplejson.dumps(res))
Example #7
0
    #res =  calculate.calculate('19470101') # ahmet inam
    #res =  calculate.calculate('19360627') # mete tuncay
    #res =  calculate.calculate('19490413') # hitchens
    #res =  calculate.calculate('19770727') # parag khanna
    #res =  calculate.calculate('19610210') # george stephanapolous
    #res =  calculate.calculate('19670514') # sebastian thrun
    #res =  calculate.calculate('18890420') # adolf hitler
    #res =  calculate.calculate('19521007') # putin
    #res =  calculate.calculate('19650404') # cemalettin tasci
    #res =  calculate.calculate('19610506') # george clooney
    #res =  calculate.calculate('19910916') # her
    #res =  calculate.calculate('19451005') # baba
    #res =  calculate.calculate('19871027') # irem
    #res =  calculate.calculate('19200701') # sabahattin dede
    #res =  calculate.calculate('19570310') # bin laden
    res =  calculate.calculate('19540609') # dkal
    #res =  calculate.calculate('19440715') # glenn morris
    #res =  calculate.calculate('19440404') # mantak chia
    #res =  calculate.calculate('19730729') # pat
    #res =  calculate.calculate('19701008') # damon
    #res =  calculate.calculate('19460524') # tansu ciller
    #res =  calculate.calculate('19490726') # thaksin
    #res =  calculate.calculate('19890426') # l-s
    
    print calculate.calculate_mbti_full(res)
    print res

    print  calculate.calculate_cycle('19910916') 
 
    
Example #8
0
import sys
sys.path.append('..')
import calculate

print calculate.calculate_cycle("19730424")
print calculate.calculate_cycle("19490222")
print calculate.calculate_cycle("19451005")