Browse Source

(feat) print -> python3

(feat) request -> python3
(fix) group members func

based on: f9773758be
master
Alexeev Nickolay 6 years ago
parent
commit
62bcee0935
  1. 5
      setup.py
  2. 10
      yandex_connect/base.py
  3. 2
      yandex_connect/directory.py

5
setup.py

@ -2,8 +2,11 @@
from setuptools import setup from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='yandex_connect', setup(name='yandex_connect',
version='0.01b', version='0.011b',
description='API Yandex Connect', description='API Yandex Connect',
url='http://github.com/zt50tz/yandex-connect', url='http://github.com/zt50tz/yandex-connect',
author='Alexeev Nick', author='Alexeev Nick',

10
yandex_connect/base.py

@ -13,13 +13,13 @@ import datetime
import inspect import inspect
def token_get_by_code(client_id, client_secret): def token_get_by_code():
import requests import requests
print 'Attempt to get oauth token for app' print ('Attempt to get oauth token for app')
client_id = input('Client id: ') client_id = input('Client id: ')
client_secret = input('Client secret: ') client_secret = input('Client secret: ')
print 'Open link in browser:' print ('Open link in browser:')
print 'https://oauth.yandex.ru/authorize?response_type=code&client_id=%s' % client_id print ('https://oauth.yandex.ru/authorize?response_type=code&client_id=%s' % client_id)
code = input('Enter code: ') code = input('Enter code: ')
auth = '%s:%s' % (client_id, client_secret) auth = '%s:%s' % (client_id, client_secret)
@ -34,7 +34,7 @@ def token_get_by_code(client_id, client_secret):
'code': code 'code': code
} }
) )
print r.text print (r.text)
def json_prepare_dump(obj): def json_prepare_dump(obj):

2
yandex_connect/directory.py

@ -317,7 +317,7 @@ class YandexConnectDirectory(YandexConnectBase):
:url man: https://tech.yandex.ru/connect/directory/api/concepts/groups/read-group-members-list-docpage/ :url man: https://tech.yandex.ru/connect/directory/api/concepts/groups/read-group-members-list-docpage/
:return: yandex request list - участники команды :return: yandex request list - участники команды
""" """
return self.request('groups/%s/members', method='get') return self.request('groups/%s/members' % group_id, method='get')
def group_member_add(self, group_id, type, id): def group_member_add(self, group_id, type, id):
""" """

Loading…
Cancel
Save