Commit 95c7cda6 authored by vertighel's avatar vertighel
Browse files

Tried without luck to separate cli from sequencer

parent 6f38744a
Loading
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ Sequencer module for Observation Blocks (OBs) in JSON format
'''

# System modules
import argparse  # New import
import argparse
import importlib
import json
import os
@@ -18,7 +18,6 @@ from pathlib import Path # New import
# Other templates
from .utils.logger import log  # Corrected relative import


class Sequencer():
    '''
    Manage a sequence of JSON Observation Blocks (OBs)
@@ -303,6 +302,8 @@ class Sequencer():
            sys.exit(1)  # Exit if running standalone




def cli(): 
    '''
    Command line interface for sequencer
@@ -343,14 +344,13 @@ def cli():
    )

    args = parser.parse_args()
    seq = Sequencer(embedded=False)  # For CLI, always run not embedded    

    # If no arguments are given, or only 'target' is missing without --script
    if not args.target and not args.script:
        parser.print_help()
        sys.exit(0)

    seq = Sequencer(embedded=False)  # For CLI, always run not embedded

    if args.script:
        if not args.params:
            log.error("Error: --params must be provided when using --script.")
@@ -397,5 +397,8 @@ def cli():
            

if __name__ == "__main__":
    # This allows running with `python -m noctua.sequencer ...`
    '''
    If called alone
    '''
    cli()