Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
Little tweaks to Unlogged
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloromeira committed May 6, 2018
1 parent 969bf4a commit 47f1fab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions onegram/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .session import Login
from .session import login, logout
from .session import Login, Unlogged
from .session import login, logout, close

from .actions import follow, unfollow
from .actions import like, unlike
Expand Down
9 changes: 8 additions & 1 deletion onegram/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,17 @@ def login(*args, **kwargs):


@_sessionaware
def logout(session):
def close(session):
session.close()


logout = close


def unlogged(*args, **kwargs):
return Unlogged(*args, **kwargs).open()


def _load_settings(custom_settings={}):
settings = {k:getattr(settings_module, k)
for k in dir(settings_module) if k.isupper()}
Expand Down

0 comments on commit 47f1fab

Please sign in to comment.