start work on allowing "packages"
This commit is contained in:
@@ -10,6 +10,7 @@ import pytz
|
||||
from dateutil import parser as dateutilparser
|
||||
|
||||
import generate
|
||||
import util
|
||||
|
||||
class Actions:
|
||||
@staticmethod
|
||||
@@ -56,7 +57,7 @@ class Actions:
|
||||
|
||||
@staticmethod
|
||||
def generate(*args):
|
||||
subprocess.run(["helpers/generate.py", "--config", cliargs.config, *args], check=True)
|
||||
generate.main(["--config", config_path, *args])
|
||||
|
||||
@staticmethod
|
||||
def compile_presentation():
|
||||
@@ -83,7 +84,7 @@ if __name__ == "__main__":
|
||||
using_alias = commandname != "sequencer.py"
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--config", "-c", default=generate.CONFIG_FILE)
|
||||
parser.add_argument("--config", "-c", default=util.CONFIG_FILE)
|
||||
parser.add_argument("--skip", action='append')
|
||||
if not using_alias:
|
||||
parser.add_argument("action", nargs="?")
|
||||
@@ -92,10 +93,17 @@ if __name__ == "__main__":
|
||||
if cliargs.skip is None:
|
||||
cliargs.skip = []
|
||||
|
||||
config = generate.get_config(cliargs.config)
|
||||
config_path = util.get_normalized_config_path(cliargs.config)
|
||||
config_path = os.path.abspath(config_path)
|
||||
|
||||
if os.path.dirname(cliargs.config) != "":
|
||||
os.chdir(os.path.dirname(cliargs.config))
|
||||
config = util.get_config(config_path)
|
||||
|
||||
original_working_dir = os.getcwd()
|
||||
normalized_working_dir = original_working_dir
|
||||
|
||||
if os.path.dirname(config_path) != "":
|
||||
normalized_working_dir = os.path.dirname(config_path)
|
||||
os.chdir(normalized_working_dir)
|
||||
|
||||
if using_alias:
|
||||
dispatch(commandname)
|
||||
|
||||
Reference in New Issue
Block a user