Example #1
0
 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)
Example #2
0
 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)
Example #3
0
def getWordHtml(prefix, word):
  template = jj2env.get_template('word2.html')
  return template.render({'bookExps': json.loads(getWordJson(word)),
                          'booksIndex': dicIndex,
                          'word': word})