1
0
mirror of https://github.com/balkian/bitter.git synced 2024-12-22 08:28:12 +00:00

Fixed JSON regression

This commit is contained in:
J. Fernando Sánchez 2017-12-19 20:44:55 +01:00
parent 9c82dea298
commit 27bc3557b2
3 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ test: $(addprefix test-,$(PYMAIN))
testall: $(addprefix test-,$(PYVERSIONS)) testall: $(addprefix test-,$(PYVERSIONS))
test-%: build-% test-%: build-%
docker run --rm -w /usr/src/app/ -v $$PWD/tests/credentials.json:/usr/src/app/tests/credentials.json --entrypoint=/usr/local/bin/python -ti '$(REPO)/$(NAME):$(VERSION)-python$*' setup.py test --addopts "-vvv -s --pdb" ; docker run --rm -w /usr/src/app/ --env-file $$PWD/.env -v $$PWD/tests/credentials.json:/usr/src/app/tests/credentials.json --entrypoint=/usr/local/bin/python -ti '$(REPO)/$(NAME):$(VERSION)-python$*' setup.py test --addopts "-vvv -s --pdb" ;
pip_test-%: pip_test-%:
docker run --rm -v $$PWD/dist:/dist/ -ti python:$* pip install /dist/$(NAME)-$(VERSION).tar.gz ; docker run --rm -v $$PWD/dist:/dist/ -ti python:$* pip install /dist/$(NAME)-$(VERSION).tar.gz ;

View File

@ -1 +1 @@
0.7.5 0.7.6

View File

@ -153,7 +153,7 @@ def read_file(filename, tail=False):
while True: while True:
line = f.readline() line = f.readline()
if line not in (None, '', '\n'): if line not in (None, '', '\n'):
tweet = json.load(line.strip()) tweet = json.loads(line.strip())
yield tweet yield tweet
else: else:
if tail: if tail:
@ -440,7 +440,7 @@ def download_tweet(wq, tweetid, write=True, folder="downloaded_tweets", update=F
tweet = None tweet = None
if update or not cached: if update or not cached:
tweet = get_tweet(wq, tweetid) tweet = get_tweet(wq, tweetid)
js = json.dump(tweet, indent=2) js = json.dumps(tweet, indent=2)
if write: if write:
if tweet: if tweet:
write_tweet_json(js, folder) write_tweet_json(js, folder)