From 44a7cc031bc9afd7cfa0d6c1d5149430ce21bf46 Mon Sep 17 00:00:00 2001 From: Kari Barry Date: Wed, 7 Aug 2024 16:17:14 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=8D=20Enable=20CLI=20to=20bypass?= =?UTF-8?q?=20required=20flag=20"--beamline"=20if=20specified=20in=20env?= =?UTF-8?q?=20vars.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nslsii/sync_experiment/.DS_Store | Bin 6148 -> 0 bytes nslsii/sync_experiment/sync_experiment.py | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) delete mode 100644 nslsii/sync_experiment/.DS_Store diff --git a/nslsii/sync_experiment/.DS_Store b/nslsii/sync_experiment/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Fri, 9 Aug 2024 14:08:03 -0400 Subject: [PATCH 2/2] =?UTF-8?q?1=EF=B8=8F=E2=83=A3=20simplification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nslsii/sync_experiment/sync_experiment.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/nslsii/sync_experiment/sync_experiment.py b/nslsii/sync_experiment/sync_experiment.py index 6457b7f2..2e4e8522 100644 --- a/nslsii/sync_experiment/sync_experiment.py +++ b/nslsii/sync_experiment/sync_experiment.py @@ -189,12 +189,7 @@ def main(): args = parser.parse_args() - # Read from env: - if "BEAMLINE_ACRONYM" in os.environ: - beamline = os.environ["BEAMLINE_ACRONYM"] - # Override if in command line args: - if args.beamline: - beamline = args.beamline + beamline = args.beamline or os.getenv("BEAMLINE_ACRONYM") # Make required: if not beamline: raise ValueError("Beamline needs to be specified. Either provide -b, --beamline or set BEAMLINE_ACRONYM in env vars.")