Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- run: pip install -r dev-requirements.txt
- uses: abatilo/actions-poetry@v2
- run: poetry install
- run: ./pdoc.sh
- uses: actions/upload-pages-artifact@v2
with:
Expand Down
15 changes: 11 additions & 4 deletions jellyfish/_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ class Notifier:
'''

def __init__(self,
server_address: str = 'localhost:5002', server_api_token: str = 'development'):
self._server_address = server_address
server_address: str = 'localhost:5002',
server_api_token: str = 'development',
secure: bool = False):
'''
Create Notifier instance, providing the jellyfish address and api token.
Set secure to `True` for `wss` and `False` for `ws` connection (default).
'''

protocol = 'wss' if secure else 'ws'
self._server_address = f'{protocol}://{server_address}/socket/server/websocket'
self._server_api_token = server_api_token
self._websocket = None
self._ready = False
Expand Down Expand Up @@ -61,8 +69,7 @@ async def connect(self):
The handlers have to be defined before calling `connect`,
otherwise the messages won't be received.
'''
address = f'ws://{self._server_address}/socket/server/websocket'
async with client.connect(address) as websocket:
async with client.connect(self._server_address) as websocket:
try:
self._websocket = websocket
await self._authenticate()
Expand Down
9 changes: 7 additions & 2 deletions jellyfish/_room_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ class RoomApi:
'''Allows for managing rooms'''

def __init__(self,
server_address: str = 'localhost:5002', server_api_token: str = 'development'):
server_address: str = 'localhost:5002',
server_api_token: str = 'development',
secure: bool = False):
'''
Create RoomApi instance, providing the jellyfish address and api token.
Set secure to `True` for `https` and `False` for `http` connection (default).
'''

protocol = 'https' if secure else 'http'
self._configuration = jellyfish_api.Configuration(
host=f'http://{server_address}',
host=f'{protocol}://{server_address}',
access_token=server_api_token
)

Expand Down
2 changes: 1 addition & 1 deletion pdoc.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pdoc\
poetry run pdoc \
--favicon https://logo.swmansion.com/membrane/\?width\=100\&variant\=signetDark\
--logo https://logo.swmansion.com/membrane/\?width\=70\&variant\=signetDark\
-t doc_templates \
Expand Down