Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (27 sloc) 1001 Bytes
#!/usr/bin/env python
Handy utility functions -- mostly for adjusting the sys path and/or
finding the Google App Engine SDK.
import sys
import os
def adjust_sys_path(dir_name='libs'):
Patch to search the libs folder. At the moment, I believe it's unable to
find .egg's, but it does search libs for imports before anything else.
root_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(root_dir, dir_name))
def find_gae_sdk(dir_name='libs'):
Correct any ImportError caused from being unable to find Google App
Engine's SDK. These normally occur when trying to run the application
from the commandline and/or when testing.
from gae_path.util import gae_sdk_path, add_gae_sdk_path
path = gae_sdk_path()
sys.path.extend([path + "/lib/yaml/lib",
path + "/lib/fancy_urllib",
path + "/lib/webob"])
Something went wrong with that request. Please try again.