Created
October 29, 2012 12:23
-
-
Save kindly/3973242 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import time | |
| import glob | |
| result = glob.glob('/home/david/Downloads/json/*') | |
| def run_documents(): | |
| for document in result: | |
| print document | |
| now = time.time() | |
| moo = requests.post('http://0.0.0.0/open-data/data/api/action/package_create', | |
| auth = ('ec', 'ecportal'), | |
| headers = {'content-type': 'application/json', "X-CKAN-API-Key": "406e6266-5d44-4853-ab05-56994f43431b"}, | |
| data = open(document).read() | |
| ) | |
| seconds = time.time() - now | |
| print seconds | |
| run_documents() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import nose
import cProfile
command = """nose.main(argv=['--ckan','--with-pylons=test-core.ini', 'ckan/tests', '-x', '-v'])"""
cProfile.runctx( command, globals(), locals(), filename="ckan.tests.profile" )
~