def _setup_flavor(env, flavor): """Setup a flavor, providing customization hooks to modify CloudBioLinux installs. Specify flavor as a name, in which case we look it up in the standard flavor directory (contrib/flavor/your_flavor), or as a path to a flavor directory outside of cloudbiolinux. """ env.flavor = Flavor(env) env.flavor_dir = None if flavor: # setup the directory for flavor customizations if os.path.isabs(flavor): flavor_dir = flavor else: flavor_dir = os.path.join(os.path.dirname(__file__), "..", "contrib", "flavor", flavor) assert os.path.exists(flavor_dir), \ "Did not find directory {0} for flavor {1}".format(flavor_dir, flavor) env.flavor_dir = flavor_dir # Load python customizations to base configuration if present py_flavor = "{0}flavor".format( os.path.split(os.path.realpath(flavor_dir))) flavor_custom_py = os.path.join(flavor_dir, "{0}.py".format(py_flavor)) if os.path.exists(flavor_custom_py): sys.path.append(flavor_dir) mod = __import__(flavor_dir, fromlist=[py_flavor]) env.logger.info("This is a %s" % env.flavor.name)
def _setup_flavor(env, flavor): """Setup a flavor, providing customization hooks to modify CloudBioLinux installs. Specify flavor as a name, in which case we look it up in the standard flavor directory (contrib/flavor/your_flavor), or as an absolute path to a flavor directory outside of cloudbiolinux. """ env.flavor = Flavor(env) env.flavor_dir = None if flavor: # set the directory for flavor customizations if os.path.isabs(flavor) or os.path.exists(flavor): flavor_dir = flavor else: flavor_dir = os.path.join(os.path.dirname(__file__), '..', 'contrib', 'flavor', flavor) assert os.path.exists(flavor_dir), \ "Did not find directory {0} for flavor {1}".format(flavor_dir, flavor) env.flavor_dir = flavor_dir flavor_name = os.path.split(flavor_dir)[-1] # Reinstantiate class if custom defined import cloudbio.flavor try: env.flavor = getattr(cloudbio.flavor, flavor_name.capitalize())(env) except AttributeError: pass env.flavor.name = flavor_name # Load python customizations to base configuration if present for ext in ["", "flavor"]: py_flavor = os.path.split(os.path.realpath(flavor_dir))[1] + ext flavor_custom_py = os.path.join(flavor_dir, "{0}.py".format(py_flavor)) if os.path.exists(flavor_custom_py): sys.path.append(flavor_dir) mod = __import__(py_flavor, fromlist=[py_flavor]) env.logger.info(env.flavor) env.logger.info("This is a %s flavor" % env.flavor.name)
def __init__(self, env): Flavor.__init__(self,env) self.name = "Boinc Flavor"
def __init__(self, env): Flavor.__init__(self, env) self.name = "Millstone Flavor"
def __init__(self, env): print "-> In GVLFlavor" Flavor.__init__(self, env) self.name = "GVL Flavor"
def __init__(self, env): Flavor.__init__(self,env) self.name = "Seal Flavor"
def __init__(self, env): Flavor.__init__(self, env) self.name = "Bio* cross-lang flavor"
def __init__(self, env): Flavor.__init__(self, env) self.name = "Boinc Flavor"
def __init__(self, env): Flavor.__init__(self,env) self.name = "Bio* cross-lang flavor"
def __init__(self, env): Flavor.__init__(self,env) self.name = "Phylogeny Flavor"
def __init__(self, env): Flavor.__init__(self, env) self.name = "NeCTAR Flavor"
def __init__(self, env): Flavor.__init__(self, env) self.name = "Seal Flavor"