Skip to content

Commit

Permalink
Merge pull request #59 from lexara-prime-ai/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lexara-prime-ai authored Jul 8, 2024
2 parents 1c831ba + b5506c8 commit c6497e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hyper/hyper/error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
CEND = "\033[0m"


# -----------------------------------
"""Custom <error> handling."""

# -----------------------------------
class ErrorHandling:
def propagate_error(self, process_name: str, message: str):
print(
Expand All @@ -12,4 +16,4 @@ def propagate_error(self, process_name: str, message: str):
Info: {message}
Process: {process_name}
"""
)
)
11 changes: 11 additions & 0 deletions hyper/hyper/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, interval, num_rows):

# ---------------------------------------------------
"""Fetch data from WSPR database via <wspr_cdk>."""

# ---------------------------------------------------
async def fetch_data(self):
try:
Expand All @@ -31,6 +32,7 @@ async def fetch_data(self):

# ----------------------------------------------
"""Write data to <csv> file asynchronously."""

# ----------------------------------------------
async def write_to_csv(self):
"""
Expand Down Expand Up @@ -111,6 +113,10 @@ async def write_to_csv(self):
except Exception as e:
self.error_handling.propagate_error("write_to_csv", f"{e}")

# -----------------------------------
"""Display [output] via <stdout>."""

# -----------------------------------
async def display_data(self, data):
"""
Args: self, data -> WsprSpot dict.
Expand Down Expand Up @@ -168,6 +174,11 @@ async def __call__(self):
await asyncio.sleep(self.interval)


# ------------------------------
"""Define <input> arguments."""


# ------------------------------
def parse_args():
try:
parser = argparse.ArgumentParser(description="WSPR Spot Data Server")
Expand Down

0 comments on commit c6497e0

Please sign in to comment.