Skip to content

Commit

Permalink
Merge branch 'tp-embeddable' of https://github.com/serverhorror/webpy
Browse files Browse the repository at this point in the history
…into serverhorror-tp-embeddable
  • Loading branch information
aaronsw committed Mar 25, 2011
2 parents d2536dd + 10e01ff commit fc4b2da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion web/__init__.py
Expand Up @@ -26,7 +26,6 @@
from debugerror import *
from application import *
from browser import *
import test
try:
import webopenid as openid
except ImportError:
Expand Down
6 changes: 3 additions & 3 deletions web/application.py
Expand Up @@ -133,7 +133,7 @@ def add_processor(self, processor):
self.processors.append(processor)

def request(self, localpart='/', method='GET', data=None,
host="0.0.0.0:8080", headers=None, https=False, **kw):
host="127.0.0.1:8080", headers=None, https=False, **kw):
"""Makes request to this application for the specified path and method.
Response will be a storage object with data, status and headers.
Expand Down Expand Up @@ -161,10 +161,10 @@ def request(self, localpart='/', method='GET', data=None,
...
>>> response = app.request("/redirect")
>>> response.headers['Location']
'http://0.0.0.0:8080/foo'
'http://127.0.0.1:8080/foo'
>>> response = app.request("/redirect", https=True)
>>> response.headers['Location']
'https://0.0.0.0:8080/foo'
'https://127.0.0.1:8080/foo'
The headers argument specifies HTTP headers as a mapping object
such as a dict.
Expand Down
5 changes: 4 additions & 1 deletion web/session.py
Expand Up @@ -4,6 +4,7 @@
"""

import os, time, datetime, random, base64
import os.path
try:
import cPickle as pickle
except ImportError:
Expand Down Expand Up @@ -217,7 +218,9 @@ class DiskStore(Store):
def __init__(self, root):
# if the storage root doesn't exists, create it.
if not os.path.exists(root):
os.mkdir(root)
os.makedirs(
os.path.abspath(root)
)
self.root = root

def _get_path(self, key):
Expand Down

0 comments on commit fc4b2da

Please sign in to comment.