Esempio n. 1
0
web.config.debug = False

urls = (
    '/mix',         'Mix',
    '/identify',    'Identify',
    '/visualize',   'Visualize',
    '/play',        'Play',
    '/',            'Index',
)

alnum = map(chr, range(97, 123)) + [str(n) for n in range(0,10)]
KEY="d92d8109432f0ead8000707303d0c6849e23be119a18df853"
# w = Wordnik(api_key="1d3baf57f57254b5c430200e729037e9dea9d87493f3a16b4",username="******",password="******")
## privileged key!
wnk = Wordnik(api_key=KEY,username="******",password="******")
all_colors = uberList([ w['word'] for w in json.loads(wnk.word_list_get_words("wordrainbow")) ])
hexen = create_hexen()

class Mix(object):
    def GET(self):
        web.header("Access-Control-Allow-Origin", "*")
        
        if session.get("mixing", False):
            return self.mix()
        else:
            return self.initialize_session()
    
    
    def mix(self):
        query_params = web.input(name=None,hex=None,callback="callback")
        colorname    = query_params.name