Skip to content

Commit

Permalink
Some changes to be able to run on linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
p0psicles committed Aug 10, 2016
1 parent 58e7822 commit a3ffdc0
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions server/web.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env python

from __future__ import unicode_literals

import os
import time
from urlparse import urljoin
time.sleep(3)
if os.name in ('posix',):
import sys
sys.setdefaultencoding("utf-8")
import site
else:
import sys
import sys
import sqlite3, os

sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib')))
Expand All @@ -21,15 +20,10 @@
abort, render_template, flash, jsonify, request

from contextlib import closing

#from main import *
from passlib.hash import md5_crypt
from operator import itemgetter
import logging

# Testing UTF-8
print sys.getdefaultencoding()

# create our little application :)
app = Flask(__name__,
template_folder='public',
Expand Down Expand Up @@ -104,7 +98,9 @@ def getpokemon():
pokemon_attributes['image_nr'] = str(pokemon_attributes['pokemon_id']).zfill(3)
pokemons.append(pokemon_attributes)

return jsonify(sorted(pokemons, key=lambda k: k['IV'], reverse=True))
if pokemons:
return jsonify(sorted(pokemons, key=lambda k: k['IV'], reverse=True))
return []


@app.route('/getPogoSession', methods=['POST'])
Expand Down

0 comments on commit a3ffdc0

Please sign in to comment.