RHESSysWorkflows  1.33
Namespaces | Variables
ImportRHESSysSource.py File Reference

Namespaces

 ImportRHESSysSource
 Import RHESSys source code into project directory; Will import either from the Git repository hosted on GitHub, from a local copy of the source tree.
 

Variables

string ImportRHESSysSource.PARAM_DB_REPO_URL = 'https://github.com/RHESSys/ParamDB.git'
 
string ImportRHESSysSource.paramDBDir = 'ParamDB'
 
string ImportRHESSysSource.paramDBName = 'params.sqlite'
 
tuple ImportRHESSysSource.TEMPLATE_PATH = os.path.join('templates', 'template.template')
 
tuple ImportRHESSysSource.ALLOMETRIC_PATH = os.path.join('allometry', 'allometric.txt')
 
string ImportRHESSysSource.RHESSYS_REPO_URL = 'https://github.com/RHESSys/RHESSys.git'
 
tuple ImportRHESSysSource.parser = argparse.ArgumentParser(description='Import RHESSys source code into project directory')
 
string ImportRHESSysSource.help = 'The configuration file.'
 
tuple ImportRHESSysSource.group = parser.add_mutually_exclusive_group()
 
tuple ImportRHESSysSource.args = parser.parse_args()
 
tuple ImportRHESSysSource.cmdline = RHESSysMetadata.getCommandLine()
 
 ImportRHESSysSource.configFile = None
 
tuple ImportRHESSysSource.context = Context(args.projectDir, configFile)
 
tuple ImportRHESSysSource.gisBase = context.config.get('GRASS', 'GISBASE')
 
tuple ImportRHESSysSource.gitPath = context.config.get('RHESSYS', 'PATH_OF_GIT')
 
tuple ImportRHESSysSource.makePath = context.config.get('RHESSYS', 'PATH_OF_MAKE')
 
tuple ImportRHESSysSource.metadata = RHESSysMetadata.readRHESSysEntries(context)
 
tuple ImportRHESSysSource.paths = RHESSysPaths(args.projectDir, metadata['rhessys_dir'])
 
tuple ImportRHESSysSource.paramDBPath = os.path.join(paths.DB_DIR, paramDBDir)
 
tuple ImportRHESSysSource.contents = os.listdir(paramDBPath)
 
tuple ImportRHESSysSource.toDelete = os.path.join(paramDBPath, entry)
 
string ImportRHESSysSource.gitCommand = "%s clone %s %s"
 
string ImportRHESSysSource.sha1Identifier = 'HEAD'
 
tuple ImportRHESSysSource.returnCode = os.system(gitCommand)
 
tuple ImportRHESSysSource.process = Popen(gitCommand, shell=True, stdout=PIPE, cwd=paramDBPath)
 
tuple ImportRHESSysSource.sha = processStdout.splitlines()
 
 ImportRHESSysSource.found = False
 
tuple ImportRHESSysSource.paramDB = os.path.join(paramDBPath, paramDBName)
 
tuple ImportRHESSysSource.templatePath = os.path.join(paramDBPath, TEMPLATE_PATH)
 
tuple ImportRHESSysSource.allometricPath = os.path.join(paramDBPath, ALLOMETRIC_PATH)
 
tuple ImportRHESSysSource.g2wSrc = os.path.join(args.sourceDir, 'g2w')
 
tuple ImportRHESSysSource.cfSrc = os.path.join(args.sourceDir, 'cf')
 
tuple ImportRHESSysSource.modelSrc = os.path.join(args.sourceDir, 'rhessys')
 
 ImportRHESSysSource.gitSHA1Command = None
 
tuple ImportRHESSysSource.branchRegex = re.compile('^\s*origin/(.+)$')
 
list ImportRHESSysSource.branches = []
 
tuple ImportRHESSysSource.m = branchRegex.match(line)
 
list ImportRHESSysSource.tags = []
 
 ImportRHESSysSource.permissions = stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR
 
tuple ImportRHESSysSource.buildPath = os.path.join(paths.RHESSYS_SRC, 'g2w')
 
 ImportRHESSysSource.makeCommand = makePath
 
tuple ImportRHESSysSource.g2wDest = os.path.join(paths.RHESSYS_BIN, 'g2w')
 
tuple ImportRHESSysSource.ratSrc = os.path.join(buildPath, 'AverageTables_Unix', 'rat')
 
tuple ImportRHESSysSource.ratDest = os.path.join(paths.RHESSYS_BIN, 'rat')
 
tuple ImportRHESSysSource.cfBinRegex = re.compile('^cf.+$')
 
 ImportRHESSysSource.cfBin = None
 
tuple ImportRHESSysSource.cfDest = os.path.join(paths.RHESSYS_BIN, cfBin)
 
tuple ImportRHESSysSource.src = os.path.join(buildPath, 'lairead')
 
tuple ImportRHESSysSource.dest = os.path.join(paths.RHESSYS_BIN, 'lairead')
 
tuple ImportRHESSysSource.rhessysBinRegex = re.compile('^rhessys.+$')
 
 ImportRHESSysSource.rhessysBin = None
 
tuple ImportRHESSysSource.rhessysSrc = os.path.join(buildPath, rhessysBin)
 
tuple ImportRHESSysSource.rhessysDest = os.path.join(paths.RHESSYS_BIN, rhessysBin)