Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
atsuoishimoto committed Dec 9, 2020
1 parent 47029ee commit 498c134
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 13 deletions.
19 changes: 16 additions & 3 deletions raindropio/__init__.py
Expand Up @@ -22,6 +22,19 @@

from .api import API, create_oauth2session # noqa
from .models import Collection # noqa
from .models import (Access, AccessLevel, BrokenLevel, CollectionRef, DictModel,
FontColor, Group, Raindrop, RaindropType, User, UserConfig,
UserFiles, UserRef, View)
from .models import (
Access,
AccessLevel,
BrokenLevel,
CollectionRef,
DictModel,
FontColor,
Group,
Raindrop,
RaindropType,
User,
UserConfig,
UserFiles,
UserRef,
View,
)
4 changes: 2 additions & 2 deletions raindropio/api.py
Expand Up @@ -12,8 +12,8 @@
def create_oauth2session(*args: Any, **kwargs: Any) -> OAuth2Session:
session = OAuth2Session(*args, **kwargs)

# session.register_compliance_hook("access_token_response", update_expires)
# session.register_compliance_hook("refresh_token_response", update_expires)
# session.register_compliance_hook("access_token_response", update_expires)
# session.register_compliance_hook("refresh_token_response", update_expires)
return session


Expand Down
6 changes: 3 additions & 3 deletions raindropio/models.py
Expand Up @@ -6,7 +6,7 @@
from typing import Any, ClassVar, Dict, List, Optional, Sequence, Union

from dateutil.parser import parse as dateparse
from jashin.dictattr import ItemAttr, SequenceAttr, DictModel
from jashin.dictattr import DictModel, ItemAttr, SequenceAttr

from .api import API

Expand Down Expand Up @@ -265,9 +265,9 @@ def create(
args["cover"] = cover
if collection is not None:
if isinstance(collection, (Collection, CollectionRef)):
args["collection"] = {'$id': collection.id}
args["collection"] = {"$id": collection.id}
else:
args["collection"] = {'$id': collection}
args["collection"] = {"$id": collection}
if type is not None:
args["type"] = type
if html is not None:
Expand Down
6 changes: 5 additions & 1 deletion samples/flasktest/app.py
Expand Up @@ -41,7 +41,11 @@ def approved():
include_client_id=True,
)

with API(token, client_id=client_id, client_secret=client_secret,) as api:
with API(
token,
client_id=client_id,
client_secret=client_secret,
) as api:
collections = Collection.get_roots(api)

return render_template_string(COLLECTIONS, collections=collections)
Expand Down
5 changes: 3 additions & 2 deletions samples/new_bookmark.py
Expand Up @@ -7,6 +7,7 @@

collection = Collection.create(api, title="Test collection")

raindrop = Raindrop.create(api, link="https://www.python.org/", tags=["abc", "def"], collection=collection)
raindrop = Raindrop.create(
api, link="https://www.python.org/", tags=["abc", "def"], collection=collection
)
print(raindrop.title)

2 changes: 1 addition & 1 deletion tests/test_api.py
Expand Up @@ -19,7 +19,7 @@ def test_refresh() -> None:
resp = Response()
resp.status_code = 200
updated = {"access_token": "updated", "expires_at": time.time() + 100000}
resp._content = json.dumps(updated).encode() # type: ignore
resp._content = json.dumps(updated).encode() # type: ignore

m.return_value = resp
api.get("https://localhost", {})
Expand Down
5 changes: 4 additions & 1 deletion tests/test_user.py
Expand Up @@ -21,7 +21,10 @@
"fullName": "test user",
"groups": [
{
"collections": [2000, 3000,],
"collections": [
2000,
3000,
],
"hidden": False,
"sort": 0,
"title": "My Collections",
Expand Down

0 comments on commit 498c134

Please sign in to comment.