Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mqt.run: args doesn't like spaces #47

Open
IanHeywood opened this issue Aug 7, 2015 · 0 comments
Open

mqt.run: args doesn't like spaces #47

IanHeywood opened this issue Aug 7, 2015 · 0 comments
Labels

Comments

@IanHeywood
Copy link

Trying to pass the following TaQL string to stefcal via the args switch in mqt.run:

SCAN_NUMBER > 3 && SCAN_NUMBER < 7

but the process bails out because it just selects the SCAN_NUMBER part. I've tried enclosing quotes (single and double) and backslash-spaces. Parameters with spaces in the tdlconf file itself are interpreted fine.

Am I missing a trick or is this a bug?

Here's my filthy stopgap solution:

def pokeTDLconf(filename,param,value):
        lines = []
        f = open(filename,'r')
        line = f.readline()
        while line:
                lines.append(line.rstrip('\n'))
                line = f.readline()
        f.close()
        f = open(filename,'w')
        for line in lines:
                parts = line.replace(' ','').split('=')
                if parts[0] == param:
                        print >>f,parts[0]+' = '+value
                else:
                        print >>f,line
        f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant