https://github.com/geodynamics/citcoms
Revision 83b32f9d7148e41d8dd964910ff8cc5a995d7f8f authored by Rajesh Kommu on 05 February 2014, 23:18:38 UTC, committed by Rajesh Kommu on 05 February 2014, 23:18:38 UTC
and Cookbook10 have been converted and the C versions of the config files are
located in the corresponding examples/Cookbook directory
1 parent 8fde56f
Raw File
Tip revision: 83b32f9d7148e41d8dd964910ff8cc5a995d7f8f authored by Rajesh Kommu on 05 February 2014, 23:18:38 UTC
Initial checkin of the Python to C config file conversion tool. Cookbooks 1-8,
Tip revision: 83b32f9
citcoms_datadir
#!/usr/bin/env python

def get_var():
    # get your username on this machine, and make it upper case
    import os
    var = os.environ.get("USER")
    return var.upper()


# invariant prefix of datadir
prefix = "/scratch/"

# invariant suffix of datadir
suffix = ""

# get the machine-dependent part of datadir
var_path = get_var()

# construct the full string for datadir
print "%s%s%s" % ( prefix, var_path, suffix )
back to top