https://github.com/geodynamics/citcoms
Raw File
Tip revision: 60c9538a11a48ae533f752115f5456df3c302303 authored by Eh Tan on 16 January 2012, 21:25:08 UTC
Merged r18932, r19073, and r19192 from trunk to v3.1 branch
Tip revision: 60c9538
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