https://github.com/geodynamics/citcoms
Revision 723802a30257e94e003af4ff8a64981d2fc4cbac authored by Rajesh Kommu on 05 June 2014, 20:23:48 UTC, committed by Rajesh Kommu on 05 June 2014, 20:23:48 UTC
1 parent 4f1ae8b
Raw File
Tip revision: 723802a30257e94e003af4ff8a64981d2fc4cbac authored by Rajesh Kommu on 05 June 2014, 20:23:48 UTC
Removed references to Python and Pyre from chapter 2 of the manual
Tip revision: 723802a
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