Update example

This commit is contained in:
SantaSpeen 2022-03-17 21:35:14 +03:00
parent 2118cc7767
commit f8dd15ef5b

View File

@ -32,23 +32,16 @@ All examples in [examples](./examples) dir.
```python
from gitflic import Gitflic, GitflicAuth
token = "token_here" # https://gitflic.ru/settings/oauth/token/create
# Your authentication token.
# See: https://gitflic.ru/settings/oauth/token/create
token = "token_here"
# Creating authorized session with our token.
gf_session = GitflicAuth(token)
gf = Gitflic(gf_session)
me_call = gf.call("/user/me")
print(me_call)
# Register call
gf.user = gf.reg_call("/user")
# Request "https://api.gitflic.ru/user/me"
me_with_reg = gf.user(end="/me")
print(me_with_reg)
print("Is me_with_reg equals me_call:", me_with_reg == me_call)
# Request "https://api.gitflic.ru/user/a4189db1-3e4f-4c2e-8adf-19c58c28e61f"
author = gf.user("/a4189db1-3e4f-4c2e-8adf-19c58c28e61f")
print("\nAuthor: ", author)
# Call method to get authorized user from API.
user_me = gf.call("/user/me")
print(user_me)
```