Skip to content

Commit fa34932

Browse files
committedMay 11, 2014
code style
1 parent c2b48f4 commit fa34932

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
 

‎examples/github.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
SECRET = ''
55
CALLBACK = ''
66

7-
client = Client(KEY, SECRET,
8-
site='https://api.github.com',
7+
client = Client(KEY, SECRET,
8+
site='https://api.github.com',
99
authorize_url='https://github.com/login/oauth/authorize',
1010
token_url='https://github.com/login/oauth/access_token')
1111

@@ -21,11 +21,11 @@
2121
print 'token', access_token.headers
2222

2323
print '-' * 80
24-
print 'get user info'
24+
print 'get user info'
2525
ret = access_token.get('/user')
2626
print ret.parsed
2727

2828
print '-' * 80
2929
print 'create a repos'
30-
ret = access_token.post('/user/repos', name = '__testrepost__', headers = {'content-type' : 'application/json'})
31-
print ret.parsed
30+
ret = access_token.post('/user/repos', name='test_repo', headers={'content-type': 'application/json'})
31+
print ret.parsed

‎pyoauth2/libs/request.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
import requests
32
import json
3+
import requests
44

55
from .response import Response
66

@@ -13,9 +13,9 @@ def __init__(self, method, uri, **opts):
1313
self.headers = opts.pop('headers', {})
1414
self.parse = opts.pop('parse', 'json')
1515
self.files = opts.pop('files', {})
16-
if 'content-type' in self.headers and self.headers['content-type'] == 'application/json' :
16+
if self.headers.get('content-type') == 'application/json':
1717
self.opts = json.dumps(opts)
18-
else :
18+
else:
1919
self.opts = opts
2020

2121
def __repr__(self):

0 commit comments

Comments
 (0)
Please sign in to comment.