コード例 #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})