Skip to content

Commit

Permalink
Move static files out of src
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhijeetKrishnan committed Feb 16, 2024
1 parent 7300d92 commit 315ea77
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 62 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ requires-python = ">= 3.10"
dependencies = [
"discord.py",
"beautifulsoup4",
"pymediawiki",
"Requests",
"lxml"
]
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
beautifulsoup4
discord.py
pymediawiki
Requests
lxml
1 change: 0 additions & 1 deletion src/frame_service/json_directory/__init__.py

This file was deleted.

41 changes: 0 additions & 41 deletions src/frame_service/json_directory/json_directory.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/frame_service/json_directory/tests/json_directory.py

This file was deleted.

32 changes: 24 additions & 8 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

"""The entry point for the bot."""

import argparse
import logging
import os
import sched
import sys
import threading
import time
from typing import Any, Callable, Tuple

from frame_service import Wavu
from framedb import FrameDb
from heihachi import configurator
from heihachi import Configurator
from heihachi.bot import FrameDataBot

"How often to update the bot's frame data from the external service and write to file."
Expand All @@ -36,19 +36,35 @@ def periodic_function(scheduler: sched.scheduler, interval: float, function: Cal
scheduler.run()


def get_argparser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description="Heihachi bot")
parser.add_argument("config_file", type=str, help="Path to the config file")
parser.add_argument(
"--export_dir",
type=str,
default=os.path.join(os.getcwd(), "json_movelist"),
help="Path to the directory to export frame data to",
)
parser.add_argument("--format", type=str, default="json", help="Format to export frame data to")
return parser


def main() -> None:
parser = get_argparser()
args = parser.parse_args()
config_file_path = args.config_file
export_dir_path = args.export_dir
_format = args.format

# retrieve config
try:
config = configurator.Configurator.from_file(sys.argv[1]) # TODO: potentially use argparse
config = Configurator.from_file(config_file_path)
assert config is not None
logger.info(f"Config file loaded from {sys.argv[1]}")
logger.info(f"Config file loaded from {config_file_path}")
except FileNotFoundError:
logger.error(f"Config file not found at {sys.argv[1]}. Exiting...")
logger.error(f"Config file not found at {config_file_path}. Exiting...")
exit(1)

export_dir_path = os.path.join(os.getcwd(), "json_movelist")
_format = "json"

# initialize bot
try:
frame_service = Wavu()
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 315ea77

Please sign in to comment.