#!/usr/bin/python # create_rol_package # # creates new rol package directory hierarchy, includes SConstruct and SConscript files # note that rol's are a bit different from the other packages # # ejw, 10-Dec-2013 import os import sys #------------------------------------------------------------------------------------- #----------------------- define some long strings here ------------------------------- #------------------------------------------------------------------------------------- SConstruct = """# SConstruct for building Hall D readout lists # # ejw, 15-nov-2013 from halld_lib import init_halld_env, build_halld_rol # create standard environment based on command-line variables env = init_halld_env(Variables()) # modify environment if desired # build readout lists build_halld_rol(env) """ SConscript=""" # SConscript for readout lists # # to customize fill in package dependencies # # ejw, 15-nov-2013 Import('*') from halld_lib import define_dependencies, buildRol # set package dependencies define_dependencies(rolEnv,"rol") # override lib prefix for readout lists rolEnv.Replace(LIBPREFIX='') # build the rol buildRol(rolEnv) """ README=""" Note: to build readout lists you must log onto a computer that is running the same operating system as is running on the rocs. Then run scons from this directory. Elliott Wolin, 15-Nov-2013 """ #------------------------------------------------------------------------------------- #---------------------------- main program starts here ------------------------------- #------------------------------------------------------------------------------------- # get package name package = 'rol' # check if package exists if(os.path.exists(package)): print '?Package ' + package + ' already exists' sys.exit(0) # create directories os.makedirs(package) os.makedirs(package+'/doc') os.makedirs(package+'/src/prod') # create SConstruct file in package root directory s = open(package+'/SConstruct','w') s.write(SConstruct) s.close() # create README in package root directory s = open(package+'README','w') s.write(README) s.close() # create SConscript in src/prod s = open(package+'/src/prod/SConscript','w') s.write(SConscript) s.close() # done print '\n *** Created package rol ***\n' sys.exit(0)