Formatting

This commit is contained in:
Felix Breidenstein 2020-03-30 00:29:00 +02:00
parent 66c1150f60
commit 820f2daba4
3 changed files with 4 additions and 3 deletions

View file

@ -42,10 +42,12 @@ def check_single_profile():
print("--profile is required when you have more than one database.")
sys.exit(1)
def list_profiles():
files = os.listdir(f"{DATA_DIR}/databases")
return [x.split(".")[0] for x in files]
def get_session(profile_name):
if not profile_name:
profile_name = check_single_profile()

View file

@ -5,6 +5,7 @@ from helper import get_session, list_profiles, build_database_filename, build_ru
import sys
import click
@click.command(name="info")
def command():
for profile in list_profiles():

View file

@ -16,7 +16,6 @@ except ImportError:
from yaml import Loader, Dumper
@click.command(name="validate")
def command():
for profile in list_profiles():
@ -24,7 +23,6 @@ def command():
db_path = build_database_filename(profile)
rules_path = build_rules_filename(profile)
# Rules
if os.path.exists(rules_path) and os.path.isfile(rules_path):
with open(rules_path) as fh: