Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
orgua committed Aug 14, 2023
1 parent bcf2678 commit 3d42535
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
19 changes: 12 additions & 7 deletions software/python-package/shepherd_sheep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
from pathlib import Path
from typing import Union

from shepherd_core.data_models import ShpModel, FirmwareDType
from shepherd_core.data_models.task import EmulationTask, FirmwareModTask
from shepherd_core.data_models import FirmwareDType
from shepherd_core.data_models import ShpModel
from shepherd_core.data_models.content import extract_firmware
from shepherd_core.data_models.content import firmware_to_hex
from shepherd_core.data_models.content import modify_firmware
from shepherd_core.data_models.task import EmulationTask
from shepherd_core.data_models.task import FirmwareModTask
from shepherd_core.data_models.task import HarvestTask
from shepherd_core.data_models.task import ProgrammingTask
from shepherd_core.data_models.task import prepare_task
from shepherd_core.data_models.task import extract_tasks
from shepherd_core.data_models.content import extract_firmware
from shepherd_core.data_models.content import modify_firmware
from shepherd_core.data_models.content import firmware_to_hex
from shepherd_core.data_models.task import prepare_task

from . import sysfs_interface
from .eeprom import EEPROM
Expand Down Expand Up @@ -53,14 +55,17 @@
"ShepherdDebug",
"run_emulator",
"run_harvester",
"run_programmer",
"run_firmware_mod",
"run_task",
"ShepherdIOException",
"log",
"flatten_list",
]


def context_stack() -> ExitStack:
""" Enables a nicer Exit-Behaviour
"""Enables a nicer Exit-Behaviour
Returns: an exit-stack to use optionally
"""
Expand Down
10 changes: 5 additions & 5 deletions software/python-package/shepherd_sheep/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import gevent
import yaml
import zerorpc
from shepherd_core import logger as log
from shepherd_core import CalibrationCape
from shepherd_core.data_models import ShpModel
from shepherd_core.data_models.base.cal_measurement import CalMeasurementCape
Expand All @@ -30,11 +31,11 @@
from shepherd_core.data_models.testbed import ProgrammerProtocol
from shepherd_core.inventory import Inventory

from shepherd_sheep.task_handling import task_handler
from . import __version__
from . import run_emulator
from . import run_harvester
from . import run_programmer
from . import run_task
from . import sysfs_interface
from .eeprom import EEPROM
from .eeprom import CapeData
Expand All @@ -51,7 +52,7 @@
try:
from periphery import GPIO
except ModuleNotFoundError:
print("WARNING: Periphery-Package missing - hardware-access will not work") # noqa: T201
log.warning("Periphery-Package missing - hardware-access will not work")


# TODO: correct docs
Expand Down Expand Up @@ -193,13 +194,12 @@ def run(mode: str, parameters: dict, verbose: int):
@cli.command(
short_help="Runs a task or set of tasks with provided config/task file.",
)
@click.argument( # TODO: to option - with default
@click.argument( # TODO: to option - with default
"config",
type=click.Path(exists=True, readable=True, file_okay=True, dir_okay=False),
)
def task(config: Union[Path, ShpModel]):
task_handler(config)

run_task(config)


@cli.group(
Expand Down

0 comments on commit 3d42535

Please sign in to comment.