Install sub addons
429454
protected function installSubAddons()
    {
        if ($subAddons = $this->addon->installs()) {
            foreach ($subAddons as $slug => $path) {
                app(self::class)->setSlug($slug)
                                ->setPath($this->path.'/'.$path)
                                ->install();
            }
        }
    }
893327
function install()
    {
        if (!$this->brew->hasInstalledNginx()) {
            $this->brew->installOrFail('nginx', []);
        }

        $this->installConfiguration();
        $this->installServer();
        $this->installNginxDirectory();
    }
847690
def install(client, force):
    """"""
    import pkg_resources
    from git.index.fun import hook_path as get_hook_path

    for hook in HOOKS:
        hook_path = Path(get_hook_path(hook, client.repo.git_dir))
        if hook_path.exists():
            if not force:
                click.echo(
                    'Hook already exists. Skipping {0}'.format(str(hook_path)),
                    err=True
                )
                continue
            else:
                hook_path.unlink()

        # Make sure the hooks directory exists.
        hook_path.parent.mkdir(parents=True, exist_ok=True)

        Path(hook_path).write_bytes(
            pkg_resources.resource_string(
                'renku.data', '{hook}.sh'.format(hook=hook)
            )
        )
        hook_path.chmod(hook_path.stat().st_mode | stat.S_IEXEC)
663604
def install(self):
        '''
        
        '''
        remote_path = os.path.join(self.venv, 'requirements.txt')
        put(self.requirements, remote_path)
        run('{pip} install -r {requirements}'.format(
            pip=self.pip(), requirements=remote_path))
1005714
def _auto_install(self):
        
        template = Template(template=self.manifest)
        sections = template.sections()
        images = self.d_client.images.list(filters={'label': 'vent'})
        add_sections = []
        status = (True, None)
        for image in images:
            ignore = False
            if ('Labels' in image.attrs['Config'] and
                'vent.section' in image.attrs['Config']['Labels'] and
                    not image.attrs['Config']['Labels']['vent.section'] in sections[1]):
                section = image.attrs['Config']['Labels']['vent.section']
                section_str = image.attrs['Config']['Labels']['vent.section'].split(
                    ':')
                template.add_section(section)
                if 'vent.name' in image.attrs['Config']['Labels']:
                    template.set_option(section,
                                        'name',
                                        image.attrs['Config']['Labels']['vent.name'])
                if 'vent.repo' in image.attrs['Config']['Labels']:
                    template.set_option(section,
                                        'repo',
                                        image.attrs['Config']['Labels']['vent.repo'])
                    git_path = join(self.path_dirs.plugins_dir,
                                    '/'.join(section_str[:2]))
                    # TODO clone it down
                    template.set_option(section, 'path', join(
                        git_path, section_str[-3][1:]))
                    # get template settings
                    # TODO account for template files not named vent.template
                    v_template = Template(template=join(
                        git_path, section_str[-3][1:], 'vent.template'))
                    tool_sections = v_template.sections()
                    if tool_sections[0]:
                        for s in tool_sections[1]:
                            section_dict = {}
                            options = v_template.options(s)
                            if options[0]:
                                for option in options[1]:
                                    option_name = option
                                    if option == 'name':
                                        # get link name
                                        template.set_option(section,
                                                            'link_name',
                                                            v_template.option(s, option)[1])
                                        option_name = 'link_name'
                                    opt_val = v_template.option(s, option)[1]
                                    section_dict[option_name] = opt_val
                            if section_dict:
                                template.set_option(section, s,
                                                    json.dumps(section_dict))
                if ('vent.type' in image.attrs['Config']['Labels'] and
                        image.attrs['Config']['Labels']['vent.type'] == 'repository'):
                    template.set_option(
                        section, 'namespace', '/'.join(section_str[:2]))
                    template.set_option(section, 'branch', section_str[-2])
                    template.set_option(section, 'version', section_str[-1])
                    template.set_option(section, 'last_updated', str(
                        datetime.utcnow()) + ' UTC')
                    if image.attrs['RepoTags']:
                        template.set_option(
                            section, 'image_name', image.attrs['RepoTags'][0])
                    else:
                        # image with none tag is outdated, don't add it
                        ignore = True
                    template.set_option(section, 'type', 'repository')
                if 'vent.groups' in image.attrs['Config']['Labels']:
                    template.set_option(section,
                                        'groups',
                                        image.attrs['Config']['Labels']['vent.groups'])
                template.set_option(section, 'built', 'yes')
                template.set_option(section, 'image_id',
                                    image.attrs['Id'].split(':')[1][:12])
                template.set_option(section, 'running', 'no')
                # check if image is running as a container
                containers = self.d_client.containers.list(
                    filters={'label': 'vent'})
                for container in containers:
                    if container.attrs['Image'] == image.attrs['Id']:
                        template.set_option(section, 'running', 'yes')
                if not ignore:
                    add_sections.append(section)
                    template.write_config()
        # TODO this check will always be true, need to actually validate the above logic
        if status[0]:
            status = (True, add_sections)
        return status
964048
protected static function fetch_subsystems() {
        global $CFG;

        // NOTE: Any additions here must be verified to not collide with existing add-on modules and subplugins!!!

        $info = array(
            'access'      => null,
            'admin'       => $CFG->dirroot.'/'.$CFG->admin,
            'analytics'   => $CFG->dirroot . '/analytics',
            'antivirus'   => $CFG->dirroot . '/lib/antivirus',
            'auth'        => $CFG->dirroot.'/auth',
            'availability' => $CFG->dirroot . '/availability',
            'backup'      => $CFG->dirroot.'/backup/util/ui',
            'badges'      => $CFG->dirroot.'/badges',
            'block'       => $CFG->dirroot.'/blocks',
            'blog'        => $CFG->dirroot.'/blog',
            'bulkusers'   => null,
            'cache'       => $CFG->dirroot.'/cache',
            'calendar'    => $CFG->dirroot.'/calendar',
            'cohort'      => $CFG->dirroot.'/cohort',
            'comment'     => $CFG->dirroot.'/comment',
            'competency'  => $CFG->dirroot.'/competency',
            'completion'  => $CFG->dirroot.'/completion',
            'countries'   => null,
            'course'      => $CFG->dirroot.'/course',
            'currencies'  => null,
            'customfield' => $CFG->dirroot.'/customfield',
            'dbtransfer'  => null,
            'debug'       => null,
            'editor'      => $CFG->dirroot.'/lib/editor',
            'edufields'   => null,
            'enrol'       => $CFG->dirroot.'/enrol',
            'error'       => null,
            'favourites'  => $CFG->dirroot . '/favourites',
            'filepicker'  => null,
            'fileconverter' => $CFG->dirroot.'/files/converter',
            'files'       => $CFG->dirroot.'/files',
            'filters'     => $CFG->dirroot.'/filter',
            //'fonts'       => null, // Bogus.
            'form'        => $CFG->dirroot.'/lib/form',
            'grades'      => $CFG->dirroot.'/grade',
            'grading'     => $CFG->dirroot.'/grade/grading',
            'group'       => $CFG->dirroot.'/group',
            'help'        => null,
            'hub'         => null,
            'imscc'       => null,
            'install'     => null,
            'iso6392'     => null,
            'langconfig'  => null,
            'license'     => null,
            'mathslib'    => null,
            'media'       => $CFG->dirroot.'/media',
            'message'     => $CFG->dirroot.'/message',
            'mimetypes'   => null,
            'mnet'        => $CFG->dirroot.'/mnet',
            //'moodle.org'  => null, // Not used any more.
            'my'          => $CFG->dirroot.'/my',
            'notes'       => $CFG->dirroot.'/notes',
            'pagetype'    => null,
            'pix'         => null,
            'plagiarism'  => $CFG->dirroot.'/plagiarism',
            'plugin'      => null,
            'portfolio'   => $CFG->dirroot.'/portfolio',
            'privacy'     => $CFG->dirroot . '/privacy',
            'question'    => $CFG->dirroot.'/question',
            'rating'      => $CFG->dirroot.'/rating',
            'repository'  => $CFG->dirroot.'/repository',
            'rss'         => $CFG->dirroot.'/rss',
            'role'        => $CFG->dirroot.'/'.$CFG->admin.'/roles',
            'search'      => $CFG->dirroot.'/search',
            'table'       => null,
            'tag'         => $CFG->dirroot.'/tag',
            'timezones'   => null,
            'user'        => $CFG->dirroot.'/user',
            'userkey'     => $CFG->dirroot.'/lib/userkey',
            'webservice'  => $CFG->dirroot.'/webservice',
        );

        return $info;
    }
834634
def _setup_install_commands_from_kwargs(kwargs, keys=tuple()):
        """"""
        cmd_list = []
        if kwargs.get('override_channels', False) and 'channel' not in kwargs:
            raise TypeError('conda search: override_channels requires channel')

        if 'env' in kwargs:
            cmd_list.extend(['--name', kwargs.pop('env')])
        if 'prefix' in kwargs:
            cmd_list.extend(['--prefix', kwargs.pop('prefix')])
        if 'channel' in kwargs:
            channel = kwargs.pop('channel')
            if isinstance(channel, str):
                cmd_list.extend(['--channel', channel])
            else:
                cmd_list.append('--channel')
                cmd_list.extend(channel)

        for key in keys:
            if key in kwargs and kwargs[key]:
                cmd_list.append('--' + key.replace('_', '-'))

        return cmd_list
1206026
def install():
    
    from .core.import_hooks import ExtensionImporter
    importer = ExtensionImporter()
    sys.meta_path.append(importer)
571901
private void addSubComponents() {
        menuButton.setName("InternalFrameTitlePane.menuButton");
        iconButton.setName("InternalFrameTitlePane.iconifyButton");
        maxButton.setName("InternalFrameTitlePane.maximizeButton");
        closeButton.setName("InternalFrameTitlePane.closeButton");

        add(menuButton);
        add(iconButton);
        add(maxButton);
        add(closeButton);
    }
1255850
function get_installed_addons() {
            $installed_addons = array();
            foreach ( self::$_instances as $instance ) {
                if ( $instance->is_addon() && is_object( $instance->_parent_plugin ) ) {
                    if ( $this->_plugin->id == $instance->_parent_plugin->id ) {
                        $installed_addons[] = $instance;
                    }
                }
            }

            return $installed_addons;
        }
685844
public function install() {
		if (file_exists(__DIR__.'/../../../../../../mouf/no_commit/MoufUsers.php')) {
			$this->contentBlock->addFile(dirname(__FILE__)."/../../views/mouf_installer/moufusers_exists.php", $this);
			$this->template->toHtml();
			return;
		}
		
		$oldUmask = umask();
		umask(0);
		
		// Now, let's write the basic Mouf files:
		if (!file_exists(__DIR__."/../../../../../../mouf")) {
			mkdir(__DIR__."/../../../../../../mouf", 0775);
		}
		if (!file_exists(__DIR__."/../../../../../../mouf/no_commit")) {
			mkdir(__DIR__."/../../../../../../mouf/no_commit", 0775);
		}
		
		
		// Write Mouf.php (always):
		//if (!file_exists(__DIR__."/../../../../../../mouf/Mouf.php")) {
			$moufStr = "<?php
define('ROOT_PATH', realpath(__DIR__.'/..').DIRECTORY_SEPARATOR);
require_once __DIR__.'/../config.php';
if (defined('ROOT_URL')) {
	define('MOUF_URL', ROOT_URL.'vendor/mouf/mouf/');
}
		
require_once __DIR__.'/../vendor/autoload.php';
		
require_once 'MoufComponents.php';
?>";
		
			file_put_contents(__DIR__."/../../../../../../mouf/Mouf.php", $moufStr);
			// Change rights on Mouf.php, but ignore errors (the file might be writable but still belong to someone else).
			@chmod(__DIR__."/../../../../../../mouf/Mouf.php", 0664);
		//}
		
		
		
		// Write MoufComponents.php:
		if (!file_exists(__DIR__."/../../../../../../mouf/MoufComponents.php")) {
			$moufComponentsStr = "<?php
/**
 * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.
 */
		
use Mouf\MoufManager;
MoufManager::initMoufManager();
\$moufManager = MoufManager::getMoufManager();
		
?>";
		
			file_put_contents(__DIR__."/../../../../../../mouf/MoufComponents.php", $moufComponentsStr);
			chmod(__DIR__."/../../../../../../mouf/MoufComponents.php", 0664);
		}
		
		// Finally, let's generate the MoufUI.php file:
		if (!file_exists(__DIR__."/../../../../../../mouf/MoufUI.php")) {
			$moufUIStr = "<?php
/**
 * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.
 */
		
	?>";
		
			file_put_contents(__DIR__."/../../../../../../mouf/MoufUI.php", $moufUIStr);
			chmod(__DIR__."/../../../../../../mouf/MoufUI.php", 0664);
		}
		
		// Finally 2, let's generate the config.php file:
		if (!file_exists(__DIR__."/../../../../../../config.php")) {
			$moufConfig = "<?php
/**
 * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.
 * Use the UI to edit it instead.
 */
		
?>";
		
			file_put_contents(__DIR__."/../../../../../../config.php", $moufConfig);
			chmod(__DIR__."/../../../../../../config.php", 0664);
		}
		
		// Finally 3 :), let's generate the MoufUsers.php file:
		if (!file_exists(__DIR__."/../../../../../../mouf/no_commit/MoufUsers.php")) {
			$moufConfig = "<?php
/**
 * This contains the users allowed to access the Mouf framework.
 */
\$users[".var_export(userinput_to_plainstring($_REQUEST['login']), true)."] = array('password'=>".var_export(sha1(userinput_to_plainstring($_REQUEST['password'])), true).", 'options'=>null);
		
?>";
		
			file_put_contents(__DIR__."/../../../../../../mouf/no_commit/MoufUsers.php", $moufConfig);
			chmod(__DIR__."/../../../../../../mouf/no_commit/MoufUsers.php", 0664);
		}
		
		umask($oldUmask);
		
		header("Location: ".ROOT_URL);
		
		
	}
570492
def add(modname, features, required_version, installed_version=None,
        optional=False):
    """"""
    global DEPENDENCIES
    for dependency in DEPENDENCIES:
        if dependency.modname == modname:
            raise ValueError("Dependency has already been registered: %s"\
                             % modname)
    DEPENDENCIES += [Dependency(modname, features, required_version,
                                installed_version, optional)]
1334017
def import_submodules(name, submodules=None):
    """"""
    sys.path.insert(0, name)
    if submodules:
        for submodule in submodules:
            import_string('{0}.{1}'.format(name, submodule))
    else:
        for item in pkgutil.walk_packages([name]):
            import_string('{0}.{1}'.format(name, item[1]))
191960
def include_required_submodules!
      class_eval do
        @sorcery_config.submodules = ::Sorcery::Controller::Config.submodules
        @sorcery_config.submodules.each do |mod|
          # TODO: Is there a cleaner way to handle missing submodules?
          # rubocop:disable Lint/HandleExceptions
          begin
            include Submodules.const_get(mod.to_s.split('_').map(&:capitalize).join)
          rescue NameError
            # don't stop on a missing submodule. Needed because some submodules are only defined
            # in the controller side.
          end
          # rubocop:enable Lint/HandleExceptions
        end
      end
    end
926325
def addonModules(cls, recurse=True):
        
        prop = '_{0}__addon_modules'.format(cls.__name__)
        out = set()

        # lookup base classes
        if recurse:
            for base in cls.__bases__:
                if issubclass(base, AddonManager):
                    out.update(base.addonModules(recurse))

        # always use the highest level for any given key
        out.update(getattr(cls, prop, set()))
        return out
883920
def _add_numeric_methods_add_sub_disabled(cls):
        
        cls.__add__ = make_invalid_op('__add__')
        cls.__radd__ = make_invalid_op('__radd__')
        cls.__iadd__ = make_invalid_op('__iadd__')
        cls.__sub__ = make_invalid_op('__sub__')
        cls.__rsub__ = make_invalid_op('__rsub__')
        cls.__isub__ = make_invalid_op('__isub__')
57207
def handle_addSubmodule(repo, **kwargs):
    """"""
    log.info('addSubmodule: %s %s' %(repo, kwargs))
    try:
        proxy = repo.addSubmodule(**kwargs)
        return [serialize(proxy, type='submodule', url=proxy.url)]
    except RepoError, e:
        raise