예제 #1
0
파일: serviceweb.py 프로젝트: pokowaka/pali
 def GET(self, word):
   # web.py server which allow cross-site xmlhttprequest
   # https://gist.github.com/1271118/52eca29d23a1f307597e04d434b0421011843e2f
   #web.header('Access-Control-Allow-Origin', '*')
   #web.header('Access-Control-Allow-Credentials', 'true')
   if type(word) is not unicode:
     word = word.decode('utf-8')
   return getWordJson(word)
예제 #2
0
파일: serviceweb.py 프로젝트: sup6/pali
 def GET(self, word):
     # web.py server which allow cross-site xmlhttprequest
     # https://gist.github.com/1271118/52eca29d23a1f307597e04d434b0421011843e2f
     #web.header('Access-Control-Allow-Origin', '*')
     #web.header('Access-Control-Allow-Credentials', 'true')
     if type(word) is not unicode:
         word = word.decode('utf-8')
     return getWordJson(word)
예제 #3
0
def getWordHtml(prefix, word):
  template = jj2env.get_template('word2.html')
  return template.render({'bookExps': json.loads(getWordJson(word)),
                          'booksIndex': dicIndex,
                          'word': word})