Fix imports

This commit is contained in:
Tim Van Baak 2020-01-18 17:20:16 -08:00
parent 49fe15995b
commit 3a161b026c
1 changed files with 6 additions and 6 deletions

View File

@ -17,18 +17,18 @@ def command_create(args):
settings are as desired before opening the lexicon for player joins. settings are as desired before opening the lexicon for player joins.
""" """
# Module imports # Module imports
import config from config import logger
from lexicon.manage import valid_name, create_lexicon from lexicon.manage import valid_name, create_lexicon
from user import UserModel from user import UserModel
# Verify arguments # Verify arguments
if not valid_name(args.lexicon): if not valid_name(args.lexicon):
config.logger.error("Lexicon name contains illegal characters: '{}'".format( logger.error("Lexicon name contains illegal characters: '{}'".format(
args.lexicon)) args.lexicon))
return -1 return -1
editor = UserModel.by(name=args.editor) editor = UserModel.by(name=args.editor)
if editor is None: if editor is None:
config.logger.error("Could not find user '{}'".format(args.editor)) logger.error("Could not find user '{}'".format(args.editor))
return -1 return -1
# Internal call # Internal call
@ -91,7 +91,7 @@ def command_config(args):
Interact with a lexicon's config Interact with a lexicon's config
""" """
# Module imports # Module imports
from config import logger from config import logger, json_ro, json_rw
from lexicon import LexiconModel from lexicon import LexiconModel
# Verify arguments # Verify arguments
@ -105,11 +105,11 @@ def command_config(args):
# Internal call # Internal call
if args.get: if args.get:
with config.json_ro(lex.config_path) as cfg: with json_ro(lex.config_path) as cfg:
config_get(cfg, args.get) config_get(cfg, args.get)
if args.set: if args.set:
with config.json_rw(lex.config_path) as cfg: with json_rw(lex.config_path) as cfg:
config_set(cfg, args.set) config_set(cfg, args.set)
# #