mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-22 00:45:10 +00:00
docs: apply simplified technical english across docs and docstrings.
This commit is contained in:
@@ -237,7 +237,7 @@ class Exceptions:
|
||||
"""Authentication Error Occurred, is your token valid? Do you have permission to make this call?"""
|
||||
|
||||
class TooManyRequests(Exception):
|
||||
"""Rate Limited; Sent too many requests in a given amount of time."""
|
||||
"""Rate Limited. Sent too many requests in a given amount of time."""
|
||||
|
||||
class PageInvalid(Exception):
|
||||
"""Requested page does not exist."""
|
||||
|
||||
@@ -17,7 +17,7 @@ class InsertResult(Enum):
|
||||
|
||||
class HTTP(Vault):
|
||||
"""
|
||||
Key Vault using HTTP API with support for multiple API modes.
|
||||
Key Vault using HTTP API that can operate in several API modes.
|
||||
|
||||
Supported modes:
|
||||
- query: Uses GET requests with query parameters
|
||||
@@ -37,7 +37,7 @@ class HTTP(Vault):
|
||||
timeout: float = 10.0,
|
||||
):
|
||||
"""
|
||||
Initialize HTTP Vault.
|
||||
Initialise HTTP Vault.
|
||||
|
||||
Args:
|
||||
name: Vault name
|
||||
@@ -346,7 +346,7 @@ class HTTP(Vault):
|
||||
|
||||
def set_title(self, title: str):
|
||||
"""
|
||||
Set a title to be used for the next key insertions.
|
||||
Set a title for the next content key insertions.
|
||||
This is optional and will be sent with add_key requests if available.
|
||||
"""
|
||||
self.current_title = title
|
||||
@@ -355,7 +355,7 @@ class HTTP(Vault):
|
||||
self, service: str, kid: Union[UUID, str], key: str, title: Optional[str] = None
|
||||
) -> InsertResult:
|
||||
"""
|
||||
Insert a key and return detailed result information.
|
||||
Insert a content key and return detailed result information.
|
||||
This method provides more granular feedback than the standard add_key method.
|
||||
Available in both API modes.
|
||||
"""
|
||||
|
||||
@@ -13,8 +13,8 @@ class MySQL(Vault):
|
||||
|
||||
def __init__(self, name: str, host: str, database: str, username: str, no_push: bool = False, **kwargs):
|
||||
"""
|
||||
All extra arguments provided via **kwargs will be sent to pymysql.connect.
|
||||
This can be used to provide more specific connection information.
|
||||
All extra arguments given through **kwargs will be sent to pymysql.connect.
|
||||
Use this to give more specific connection information.
|
||||
"""
|
||||
super().__init__(name, no_push)
|
||||
self.slug = f"{host}:{database}:{username}"
|
||||
@@ -193,7 +193,7 @@ class MySQL(Vault):
|
||||
return names[0] if names else None
|
||||
|
||||
def has_table(self, name: str) -> bool:
|
||||
"""Check if the Vault has a Table with the specified name."""
|
||||
"""Return True if the Vault has a Table with the specified name."""
|
||||
conn = self.conn_factory.get()
|
||||
cursor = conn.cursor()
|
||||
|
||||
@@ -207,7 +207,7 @@ class MySQL(Vault):
|
||||
cursor.close()
|
||||
|
||||
def create_table(self, name: str):
|
||||
"""Create a Table with the specified name if not yet created."""
|
||||
"""Make a Table with the specified name if it does not exist yet."""
|
||||
if self.has_table(name):
|
||||
return
|
||||
|
||||
@@ -234,7 +234,7 @@ class MySQL(Vault):
|
||||
cursor.close()
|
||||
|
||||
def get_permissions(self) -> list:
|
||||
"""Get and parse Grants to a more easily usable list tuple array."""
|
||||
"""Get and parse Grants to a more usable list tuple array."""
|
||||
conn = self.conn_factory.get()
|
||||
cursor = conn.cursor()
|
||||
|
||||
@@ -256,7 +256,7 @@ class MySQL(Vault):
|
||||
cursor.close()
|
||||
|
||||
def has_permission(self, operation: str, database: Optional[str] = None, table: Optional[str] = None) -> bool:
|
||||
"""Check if the current connection has a specific permission."""
|
||||
"""Return True if the current connection has a specific permission."""
|
||||
grants = [x for x in self.permissions if x[0] == ["*"] or operation.upper() in x[0]]
|
||||
if grants and database:
|
||||
grants = [x for x in grants if x[1][0] in (database, "*")]
|
||||
|
||||
@@ -166,7 +166,7 @@ class SQLite(Vault):
|
||||
cursor.close()
|
||||
|
||||
def has_table(self, name: str) -> bool:
|
||||
"""Check if the Vault has a Table with the specified name."""
|
||||
"""Return True if the Vault has a Table with the specified name."""
|
||||
conn = self.conn_factory.get()
|
||||
cursor = conn.cursor()
|
||||
|
||||
@@ -177,7 +177,7 @@ class SQLite(Vault):
|
||||
cursor.close()
|
||||
|
||||
def create_table(self, name: str):
|
||||
"""Create a Table with the specified name if not yet created."""
|
||||
"""Make a Table with the specified name if it does not exist yet."""
|
||||
if self.has_table(name):
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user