import os import sys import imp # load script configuration parameters from PWD # this will ensure that only the configredrfi.py file on current directory is # loaded PWD = os.environ['PWD'] try: configredrfi = imp.load_source('configredrfi', os.path.join(PWD, 'configredrfi.py')) from configredrfi import * except IOError: error_message = """No configredrfi.py file was found in %s use 'redrfi --help' for help\n""" % (PWD) sys.exit(error_message) #------------------------------------------------------------------------------- # Create folders if they don't existent for folder in [aips_output, plots_output, webpage_folder]: if not os.path.isdir(folder): print 'Folder "%s" does not exist' % (folder) create_folder = raw_input('Create folder [y]/n: ') if create_folder in ['y', '']: print 'Creating folder "%s"\n' % (folder) os.mkdir(folder,0777)