Skip to content

Instantly share code, notes, and snippets.

@zookos
zookos / test_oauth.py
Created January 20, 2011 23:55
oauth.py
# copied from https://github.com/simplegeo/python-oauth2 and modified
from simplegeo.shared import to_unicode
import hashlib, hmac, urllib
def escape(s):
"""Escape a URL including any /."""
return urllib.quote(to_unicode(s).encode('utf-8'), safe='~')
@zookos
zookos / gist:788970
Created January 20, 2011 23:54
oauth.py
# copied from https://github.com/simplegeo/python-oauth2 and modified
from simplegeo.shared import to_unicode
import hashlib, hmac, urllib
def escape(s):
"""Escape a URL including any /."""
return urllib.quote(to_unicode(s).encode('utf-8'), safe='~')
HACK Zooko-Ofsimplegeos-MacBook-Pro:~/playground/python-simplegeo-shared$ git diff
diff --git a/simplegeo/shared/__init__.py b/simplegeo/shared/__init__.py
index 7004958..a71412b 100644
--- a/simplegeo/shared/__init__.py
+++ b/simplegeo/shared/__init__.py
@@ -61,6 +61,8 @@ def is_valid_lat(x):
def is_valid_lon(x):
return is_numeric(x) and (x <= 180) and (x >= -180)
+DEFAULT_VALUE_OF_PRIVATE=# True or False goes here
#!/usr/bin/env python
from pyutil import benchutil
def meas(N, cand):
for i in range(N):
r = cand == 'x'*32
def meas_right(N):