Skip to content

Commit

Permalink
using pathlib to check for hutch
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaushik Malapati authored and Kaushik Malapati committed Nov 15, 2024
1 parent 8f050df commit decbbb7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/epicsArchChecker
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The script also runs epicsArchVerify for LCLS2 hutches.
import argparse
import os
import subprocess
from pathlib import Path

import ophyd.signal
from prettytable import PrettyTable
Expand All @@ -23,10 +24,10 @@ LCLS1_HUTCHES = ["xpp", "xcs", "mfx", "cxi", "mec"]


def is_lcls2(path):
path = str.lower(path)
if any(hutch in path for hutch in LCLS2_HUTCHES):
path = Path(str.lower(path))
if any(hutch in path.parts for hutch in LCLS2_HUTCHES):
return True
elif any(hutch in path for hutch in LCLS1_HUTCHES):
elif any(hutch in path.parts for hutch in LCLS1_HUTCHES):
return False
else:
return None
Expand Down

0 comments on commit decbbb7

Please sign in to comment.