From 1d9e7cc1704dbb25b027eec3dd18cc2a6f097883 Mon Sep 17 00:00:00 2001 From: Midgard Date: Sun, 26 Jan 2020 01:33:08 +0100 Subject: [PATCH] Refactor loader to parser, remove hlds from app.py --- app/app.py | 4 ---- app/hlds/definitions.py | 2 +- app/hlds/{loader.py => parser.py} | 0 parse_hlds.py | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) rename app/hlds/{loader.py => parser.py} (100%) diff --git a/app/app.py b/app/app.py index 3ca6f5e..573bdde 100755 --- a/app/app.py +++ b/app/app.py @@ -15,7 +15,6 @@ from flask_migrate import Migrate, MigrateCommand from flask_oauthlib.client import OAuth, OAuthException from flask_script import Manager, Server -import hlds from admin import init_admin from login import init_login from models import db @@ -71,9 +70,6 @@ def register_plugins(app: Flask) -> Manager: # Initialize SQLAlchemy db.init_app(app) - # Load locations - locations = hlds.load_all() - # Initialize Flask-Migrate migrate = Migrate(app, db) app_manager = Manager(app) diff --git a/app/hlds/definitions.py b/app/hlds/definitions.py index a807eab..3d16f8c 100644 --- a/app/hlds/definitions.py +++ b/app/hlds/definitions.py @@ -2,7 +2,7 @@ from os import path import itertools -from .loader import parse_all_directory +from .parser import parse_all_directory __all__ = ["definitions"] diff --git a/app/hlds/loader.py b/app/hlds/parser.py similarity index 100% rename from app/hlds/loader.py rename to app/hlds/parser.py diff --git a/parse_hlds.py b/parse_hlds.py index 95028b3..9957f4d 100755 --- a/parse_hlds.py +++ b/parse_hlds.py @@ -2,7 +2,7 @@ import json from tatsu.util import asjson -from app.hlds.loader import parse_files +from app.hlds.parser import parse_files USAGE = """{0} [filename]...