Created
June 20, 2012 13:11
-
-
Save barneygale/2959824 to your computer and use it in GitHub Desktop.
This file contains 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 json | |
import nerdnu | |
import os | |
import re | |
import reddit | |
from nerdnu import app | |
data_dir = 'data' | |
def write_raw(filename, data): | |
with app.open_resource(os.path.join(data_dir, filename), 'w') as handle: | |
handle.write(data) | |
def write_json(filename, data): | |
write_raw(filename, json.dumps(data, indent=4)) | |
import subreddit, wiki, forum, query, logs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Traceback (most recent call last):
File "compile.py", line 20, in
m.compile()
File "/home/reddit/nerdnu/nerdnu/compile/query.py", line 160, in compile
write_json('statuses.json', out)
File "/home/reddit/nerdnu/nerdnu/compile/init.py", line 17, in write_json
write_raw(filename, json.dumps(data, indent=4))
File "/home/reddit/nerdnu/nerdnu/compile/init.py", line 13, in write_raw
with app.open_resource(os.path.join(data_dir, filename), 'w') as handle:
TypeError: open_resource() takes exactly 2 arguments (3 given)