mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-02 13:14:33 +01:00
Fixes typos according to the review
This commit is contained in:
@@ -33,7 +33,7 @@ class AppointmentsDBM(DBManager):
|
||||
|
||||
Args:
|
||||
db_path (:obj:`str`): the path (relative or absolute) to the system folder containing the database. A fresh
|
||||
database will be create if the specified path does not contain one.
|
||||
database will be created if the specified path does not contain one.
|
||||
|
||||
Raises:
|
||||
:obj:`ValueError`: If the provided ``db_path`` is not a string.
|
||||
@@ -148,7 +148,7 @@ class AppointmentsDBM(DBManager):
|
||||
by default.
|
||||
|
||||
Returns:
|
||||
:obj:`dict`: A dictionary with all the appointments stored in the database. An empty dictionary is there
|
||||
:obj:`dict`: A dictionary with all the appointments stored in the database. An empty dictionary if there
|
||||
are none.
|
||||
"""
|
||||
|
||||
@@ -453,7 +453,7 @@ class AppointmentsDBM(DBManager):
|
||||
Creates a flag that signals that an appointment has been triggered for every appointment in the given list
|
||||
|
||||
Args:
|
||||
uuids (:obj:`list`): a list of identifier for the appointments to flag.
|
||||
uuids (:obj:`list`): a list of identifiers for the appointments to flag.
|
||||
"""
|
||||
|
||||
with self.db.write_batch() as b:
|
||||
|
||||
@@ -99,7 +99,7 @@ class Builder:
|
||||
def update_states(watcher, missed_blocks_watcher, missed_blocks_responder):
|
||||
"""
|
||||
Updates the states of both the :mod:`Watcher <teos.watcher.Watcher>` and the
|
||||
:mod:`Responder <teos.responder.Responder>`. If both have pending blocks to process they need to be updates at
|
||||
:mod:`Responder <teos.responder.Responder>`. If both have pending blocks to process they need to be updated at
|
||||
the same time, block by block.
|
||||
|
||||
If only one instance has to be updated, ``populate_block_queue`` should be used.
|
||||
|
||||
@@ -3,7 +3,7 @@ from common.cryptographer import Cryptographer
|
||||
|
||||
|
||||
class NotEnoughSlots(ValueError):
|
||||
"""Raise this when trying to subtract more slots than a user has available"""
|
||||
"""Raised when trying to subtract more slots than a user has available"""
|
||||
|
||||
def __init__(self, user_pk, requested_slots):
|
||||
self.user_pk = user_pk
|
||||
@@ -12,7 +12,7 @@ class NotEnoughSlots(ValueError):
|
||||
|
||||
class IdentificationFailure(Exception):
|
||||
"""
|
||||
Raise this when a user can not be identified. Either the user public key cannot be recovered or the user is
|
||||
Raised when a user can not be identified. Either the user public key cannot be recovered or the user is
|
||||
not found within the registered ones.
|
||||
"""
|
||||
|
||||
@@ -45,7 +45,7 @@ class Gatekeeper:
|
||||
"""
|
||||
|
||||
if not is_compressed_pk(user_pk):
|
||||
raise ValueError("provided public key does not match expected format (33-byte hex string)")
|
||||
raise ValueError("Provided public key does not match expected format (33-byte hex string)")
|
||||
|
||||
if user_pk not in self.registered_users:
|
||||
self.registered_users[user_pk] = {"available_slots": self.default_slots}
|
||||
|
||||
@@ -17,7 +17,7 @@ class UsersDBM(DBManager):
|
||||
|
||||
Args:
|
||||
db_path (:obj:`str`): the path (relative or absolute) to the system folder containing the database. A fresh
|
||||
database will be create if the specified path does not contain one.
|
||||
database will be created if the specified path does not contain one.
|
||||
|
||||
Raises:
|
||||
:obj:`ValueError`: If the provided ``db_path`` is not a string.
|
||||
@@ -75,7 +75,7 @@ class UsersDBM(DBManager):
|
||||
user_pk (:obj:`str`): a 33-byte hex-encoded string identifying the user.
|
||||
|
||||
Returns:
|
||||
:obj:`dict`: A dictionary containing the appointment data if they ``key`` is found.
|
||||
:obj:`dict`: A dictionary containing the appointment data if the ``key`` is found.
|
||||
|
||||
Returns ``None`` otherwise.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user