Skip to content

Add libby client library#17

Open
mikelangmayr wants to merge 4 commits into
mainfrom
mike/create-libby-client
Open

Add libby client library#17
mikelangmayr wants to merge 4 commits into
mainfrom
mike/create-libby-client

Conversation

@mikelangmayr
Copy link
Copy Markdown
Collaborator

  • consolidate config file loading
  • extract shared core modules and use them across cli and client lib
  • use custom errors
  • add documentations

Comment thread libby/daemon.py

def config_peer_id(self) -> str: return self.peer_id or self._must("peer_id")
def config_bind(self) -> str: return self.bind or self._must("bind")
def config_address_book(self) -> Dict[str, str]: return self.address_book or self._must("address_book")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw we define config_address_book twice

Comment thread libby/daemon.py
self.topics: Dict[str, EvtHandler] = dict(getattr(type(self), "topics", {}))

@classmethod
def from_config(cls, cfg: Dict[str, Any]) -> "LibbyDaemon":
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also include transport and group id?

Comment thread libby/naming.py

def peer_id(group: str, scope: str) -> str:
"""Map a keyword's group/scope to the daemon peer id."""
return f"{group}_{scope}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why _ vs .?

Comment thread libby/naming.py
"""
if value == "":
return None
low = value.strip().lower()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we start a lookup table for fixed string values as this grows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants