Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
pymemri
Commits
fb390ba1
Commit
fb390ba1
authored
2 years ago
by
Aziz Berkay Yesilyurt
Browse files
Options
Download
Email Patches
Plain Diff
enable typing
parent
b0a32686
dev
aziz/tweet_schema
disable_cert_verify
eelco/export-schema-json
v0.1.2
v0.1.0
v0.0.52
v0.0.51
v0.0.50
v0.0.48
v0.0.47
v0.0.46
v0.0.45
v0.0.44
v0.0.43
v0.0.42
v0.0.41
v0.0.40
v0.0.39
1 merge request
!279
add py.typed to enable typing
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pymemri/pod/api.py
+3
-3
pymemri/pod/api.py
pymemri/pod/client.py
+4
-3
pymemri/pod/client.py
pymemri/py.typed
+0
-0
pymemri/py.typed
setup.cfg
+3
-0
setup.cfg
with
10 additions
and
6 deletions
+10
-6
pymemri/pod/api.py
+
3
-
3
View file @
fb390ba1
...
...
@@ -224,19 +224,19 @@ class PodAPI:
def
oauth2get_access_token
(
self
,
platform
:
str
,
)
->
Any
:
)
->
Dict
:
return
self
.
post
(
"oauth2/access_token"
,
{
"platform"
:
platform
},
).
json
()
def
oauth2authorize
(
self
,
*
,
platform
:
str
,
code
:
str
,
redirect_uri
:
str
)
->
Any
:
def
oauth2authorize
(
self
,
*
,
platform
:
str
,
code
:
str
,
redirect_uri
:
str
)
->
Dict
[
str
,
str
]
:
return
self
.
post
(
"oauth2/authorize"
,
{
"platform"
:
platform
,
"authCode"
:
code
,
"redirectUri"
:
redirect_uri
},
).
json
()
def
oauth2get_authorization_url
(
self
,
platform
:
str
,
scopes
:
str
,
redirect_uri
:
str
)
->
Any
:
def
oauth2get_authorization_url
(
self
,
platform
:
str
,
scopes
:
str
,
redirect_uri
:
str
)
->
Dict
:
return
self
.
post
(
"oauth2/auth_url"
,
{
...
...
This diff is collapsed.
Click to expand it.
pymemri/pod/client.py
+
4
-
3
View file @
fb390ba1
...
...
@@ -6,6 +6,7 @@ from typing import Any, Dict, List, Optional, Type, TypeVar, Union
import
numpy
as
np
from
loguru
import
logger
from
typing_extensions
import
Unpack
from
pymemri.data.schema.itembase
import
ItemBase
...
...
@@ -117,7 +118,7 @@ class PodClient:
return
self
.
_upload_image
(
photo
.
data
,
asyncFlag
=
asyncFlag
)
def
add_to_schema
(
self
,
*
items
:
List
[
Union
[
object
,
typ
e
]]):
def
add_to_schema
(
self
,
*
items
:
Unpack
[
Union
[
Type
[
ItemBase
],
ItemBas
e
]]):
create_items
=
[]
for
item
in
items
:
if
not
(
isinstance
(
item
,
ItemBase
)
or
issubclass
(
item
,
ItemBase
)):
...
...
@@ -628,7 +629,7 @@ class PodClient:
oauth_token_secret
=
oauth_token_secret
,
)
def
oauth2_authorize
(
self
,
*
,
platform
,
code
,
redirect_uri
):
def
oauth2_authorize
(
self
,
*
,
platform
,
code
,
redirect_uri
)
->
str
:
try
:
return
self
.
api
.
oauth2authorize
(
code
=
code
,
platform
=
platform
,
redirect_uri
=
redirect_uri
...
...
@@ -637,7 +638,7 @@ class PodClient:
logger
.
error
(
e
)
return
None
def
get_oauth2_authorization_url
(
self
,
platform
,
scopes
,
redirect_uri
):
def
get_oauth2_authorization_url
(
self
,
platform
,
scopes
,
redirect_uri
)
->
str
:
try
:
return
self
.
api
.
oauth2get_authorization_url
(
platform
,
scopes
,
redirect_uri
)
except
PodError
as
e
:
...
...
This diff is collapsed.
Click to expand it.
pymemri/py.typed
0 → 100644
+
0
-
0
View file @
fb390ba1
This diff is collapsed.
Click to expand it.
setup.cfg
+
3
-
0
View file @
fb390ba1
...
...
@@ -53,3 +53,6 @@ console_scripts =
plugin_from_template = pymemri.template.formatter:plugin_from_template
create_plugin_config = pymemri.template.config:create_plugin_config
simulate_oauth1_flow = pymemri.plugin.cli:simulate_oauth1_flow
[options.package_data]
{name} = py.typed
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets