mirror of
https://gitflic.ru/project/santaspeen/gitflic.git
synced 2026-04-08 00:36:23 +00:00
A bit rework / refactoring.
This commit is contained in:
19
examples/simple_auth.py
Normal file
19
examples/simple_auth.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from gitflic import Gitflic, GitflicAuth
|
||||
|
||||
# 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)
|
||||
|
||||
|
||||
def main():
|
||||
# Call method to get authorized user from API.
|
||||
user_me = gf.call("/user/me")
|
||||
print(user_me)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user