File: sacct-proxy.py

package info (click to toggle)
snakemake 7.32.4-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,836 kB
  • sloc: python: 32,846; javascript: 1,287; makefile: 247; sh: 163; ansic: 57; lisp: 9
file content (25 lines) | stat: -rwxr-xr-x 680 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!python

import argparse
import subprocess as sp

parser = argparse.ArgumentParser()
parser.add_argument("--name")
parser.add_argument("--format")
parser.add_argument("-X", action="store_true")
parser.add_argument("--parsable2", action="store_true")
parser.add_argument("--noheader", action="store_true")
parser.add_argument("-n", action="store_true")
parser.add_argument("-u")
parser.add_argument("-o")


args = parser.parse_args()

if args.n and args.u and args.o:
    # mimic account query from the executor
    print("runner")
elif args.name:
    sp.call(["squeue", "--noheader", "--format", "%F|%T", "--name", args.name])
else:
    raise ValueError("Unsupported arguments")