diff --git a/apsbss/apsbss.py b/apsbss/apsbss.py index b87b284..0f9b8f2 100755 --- a/apsbss/apsbss.py +++ b/apsbss/apsbss.py @@ -407,10 +407,6 @@ def get_options(): subcommand.add_parser("beamlines", help="print list of beamlines") - msg = "print current ESAF(s) and proposal(s)" ", DEPRECATED: use 'list' instead" - p_sub = subcommand.add_parser("current", help=msg) - p_sub.add_argument("beamlineName", type=str, help="Beamline name") - p_sub = subcommand.add_parser("runs", help="print APS run cycle names") p_sub.add_argument( "-f", @@ -502,34 +498,6 @@ def sorter(entry): printColumns(server.runs) -def cmd_current(args): - """ - Handle ``current`` command. - - DEPRECATED: use ``list`` instead - - PARAMETERS - - args - *obj* : - Object returned by ``argparse`` - """ - warnings.warn("Command 'current' is deprecated, use 'list' instead.") - records = getCurrentProposals(args.beamlineName) - tNow = datetime.datetime.now().isoformat(sep=" ") - if len(records) == 0: - print(f"No current proposals for {args.beamlineName}") - else: - printProposalTable(records, f"Current Proposal(s): {args.beamlineName} at {tNow}") - - sector = args.beamlineName.split("-")[0] - records = server.current_esafs(sector) - if len(records) == 0: - print(f"No current ESAFs for sector {sector}") - else: - printEsafTable(records, f"Current ESAF(s): sector {sector} at {tNow}") - - def cmd_esaf(args): """ Handle ``esaf`` command. @@ -564,7 +532,7 @@ def cmd_list(args): if not len(run) or run in "now current".split(): run = server.current_run - # elif run == "all": + # elif run == "all": # TODO: re-enable # run = server.runs elif run in "future next".split(): runs = server.runs @@ -640,9 +608,6 @@ def main(): elif args.subcommand == "clear": epicsClear(args.prefix) - elif args.subcommand == "current": - cmd_current(args) - elif args.subcommand == "runs": cmd_runs(args) diff --git a/apsbss/servers.py b/apsbss/servers.py index 6f47849..ff603ef 100644 --- a/apsbss/servers.py +++ b/apsbss/servers.py @@ -174,6 +174,7 @@ def esafs(self, sector, run): return results + # TODO: rename to esaf def get_esaf(self, esaf_id): """ Return ESAF as a dictionary. @@ -190,6 +191,7 @@ def get_esaf(self, esaf_id): raise EsafNotFound(f"{esaf_id=!r}") return dict(record.data) + # TODO: rename to proposal def get_proposal(self, proposal_id, beamline, run): """ Return proposal as a dictionary. diff --git a/apsbss/tests/test_apsbss.py b/apsbss/tests/test_apsbss.py index a17e8b1..bbe173f 100644 --- a/apsbss/tests/test_apsbss.py +++ b/apsbss/tests/test_apsbss.py @@ -2,7 +2,6 @@ General tests of the apsbss module """ -import datetime import pathlib import socket import subprocess @@ -255,14 +254,6 @@ def test_apsbss_commands_beamlines(argv): assert args.subcommand == sys.argv[1] -def test_apsbss_commands_current(argv): - sys.argv = argv + ["current", "9-ID-B,C"] - args = apsbss.get_options() - assert args is not None - assert args.subcommand == sys.argv[1] - assert args.beamlineName == sys.argv[2] - - def test_apsbss_commands_runs(argv): sys.argv = argv + [ "runs",