Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from LFLab/patch/0.2.2
Browse files Browse the repository at this point in the history
* Deferred ClientSession() initialization
* bump to 0.2.2
  • Loading branch information
lanfon72 authored Dec 10, 2019
2 parents 4702d11 + 277f6d0 commit e7a060d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aioflowdock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .flowdock import Session
from .stream import EventStream

__version__ = '0.2.1'
__version__ = '0.2.2'
__all__ = ["Session", "EventStream"]
8 changes: 7 additions & 1 deletion aioflowdock/flowdock.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ def __init__(self, email, password="", url="", session=None, loop=None):
super().__init__(loop or get_event_loop())
self.email = email
self.password = password
self.session = session or ClientSession()
self._session = session
self.url = url or environ.get("FLOWDOCK_API_URL", DEFAULT_URL)
secret = ("%s:%s" % (email, password)).encode()
self.auth = "Basic " + b64encode(secret).decode()

@property
def session(self):
if self._session is None:
self._session = ClientSession()
return self._session

def stream(self, flows, options=None):
options = options or dict()
Expand Down

0 comments on commit e7a060d

Please sign in to comment.