def disable(project=None): """ Disable a project. """ if project is None: show() return print config = ConfigHandling.get_config(project) if ConfigHandling.get_bool(project, 'project_enabled') == False: print "Already disabled: %s" % colors.cyan(project) show() return print "Disabling: %s" % colors.cyan(project) config['project_enabled'] = False config.write()
def is_enabled(project): if project == 'fabfile': return False return ConfigHandling.get_bool(project, 'project_enabled')
''' The fabfile. One to install, one to maintain, one to configure, and one to reset. Or just one to deploy them all. ''' project = __name__ # At first we load the config file. from fabfile import ConfigHandling config = ConfigHandling.load_config(project) # Now we configure our modules. from fabfile.PackageHelpers import PipPackages PipPackages.eggproxies = config['eggproxies'] # Then we detect and import (if enabled) the project py files. detected = [] enabled = [] import os from fabfile import projects subdirs = os.walk(os.curdir).next()[1] for subdir in subdirs: if projects.is_project(subdir): detected.append(subdir) project_cfg = ConfigHandling.load_config(subdir) if projects.is_enabled(subdir):