Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__pycache__/
*.py[cod]
*$py.class
.DS_store

# C extensions
*.so
Expand Down Expand Up @@ -60,5 +61,3 @@ target/

#Ipython Notebook
.ipynb_checkpoints

.DS_Store
2 changes: 1 addition & 1 deletion example/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ class app(server.WebApp):

if __name__ == '__main__':
server = server.jolla_server(app)
server.run_server()
server.run_server(reload = True)
Binary file added jolla/HTTPerror.pyc
Binary file not shown.
Binary file added jolla/__init__.pyc
Binary file not shown.
Binary file added jolla/plugins.pyc
Binary file not shown.
20 changes: 13 additions & 7 deletions jolla/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ def __init__(self, environ=None, get_urls=True):

self.request['data'] = {}
self.request['query_string'] = {}

# Beyond Comp
line = self._environ['QUERY_STRING']
request_data = environ['wsgi.input'].read()
request_data = environ['wsgi.input'].read(environ.get('content_length', 0))
if request_data:
request_data = unquote(request_data)
for data_pair in request_data.split('&'):
key, value = data_pair.split('=')

self.request['data'][key] = value

# up
query_string = self._environ['QUERY_STRING']
if query_string:
query_string = unquote(query_string)
Expand All @@ -114,7 +114,7 @@ def __init__(self, environ=None, get_urls=True):
self.request['query_string'][key] = value
except ValueError:
pass

# Below Comp
if not get_urls:
for url in self.urls:
try:
Expand Down Expand Up @@ -232,7 +232,13 @@ def application(self, environ, start_response):

return html_code[0]

def run_server(self):
def run_server(self, reload = False):
print "the server is running on the {} in the port {}".format(self.host, self.port)

self.serve_forever()
if reload:
from werkzeug.serving import run_simple
run_simple(self.host, self.port, self, use_debugger=True, use_reloader=True)
else:
self.serve_forever()

def __call__(self, environ, start_response):
return self.application(environ, start_response)
Binary file added jolla/server.pyc
Binary file not shown.
Binary file added jolla/session.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
download_url='https://github.com/salamer/jolla',

install_requires=[
'gevent'
'gevent',
'werkzeug'
],

packages=['jolla'],
Expand Down