Skip to content
Snippets Groups Projects
Commit 70d85694 authored by Sebastian Brommer's avatar Sebastian Brommer :hand_splayed_tone4:
Browse files

update prepare script

parent 87b7746c
Branches
No related tags found
No related merge requests found
#!/usr/bin/python3
import os
import sys
import classad
def get_job_ad():
import classad
instream = sys.stdin
route = ""
while True:
newline = instream.readline()
if newline.startswith("------"):
break
route += newline
inputstr = instream.read()
try:
job_ad = classad.parseOne(instream, parser=classad.Parser.Old)
except (SyntaxError, ValueError):
print(inputstr)
job_ad = classad.parseOne(inputstr, parser=classad.Parser.Auto)
except (SyntaxError, ValueError) as e:
print(f"Failed to parse ClassAd: {e}")
return None
return job_ad
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment