Display selected repository.
324244
def hook_action(action, repo_id):
    """"""
    github = GitHubAPI(user_id=current_user.id)
    repos = github.account.extra_data['repos']

    if repo_id not in repos:
        abort(404)

    if action == 'disable':
        if github.remove_hook(repo_id, repos[repo_id]['full_name']):
            db.session.commit()
            return redirect(url_for('.index'))
        else:
            abort(400)
    elif action == 'enable':
        if github.create_hook(repo_id, repos[repo_id]['full_name']):
            db.session.commit()
            return redirect(url_for('.index'))
        else:
            abort(400)
    else:
        abort(400)
891990
def show(self):
        """"""

        # noinspection PyPackageRequirements
        from IPython.display import Image, display

        fname = self.render()
        display(Image(filename=fname))
187843
def do_show(self, repo):
        '''
        
        '''
        self.abort_on_nonexisting_effective_repo(repo, 'show')

        repo = self.network.get_repo(repo)
        repo.print_attributes()
992224
def catalog(query)
      get('/v2/_catalog'.freeze)['repositories'].select do |image|
        image =~ /^#{query}/
      end.map { |image_name| { 'name' => image_name } }
    end
522771
def describe_repositories(self, registry_id=None, repository_names=None):
        
        if repository_names:
            for repository_name in repository_names:
                if repository_name not in self.repositories:
                    raise RepositoryNotFoundException(repository_name, registry_id or DEFAULT_REGISTRY_ID)

        repositories = []
        for repository in self.repositories.values():
            # If a registry_id was supplied, ensure this repository matches
            if registry_id:
                if repository.registry_id != registry_id:
                    continue
            # If a list of repository names was supplied, esure this repository
            # is in that list
            if repository_names:
                if repository.name not in repository_names:
                    continue
            repositories.append(repository.response_object)
        return repositories
605029
def display(self) -> typing.Union[None, report.Report]:
        """"""
        return (
            self._project.current_step.report
            if self._project and self._project.current_step else
            None
        )
1326850
public void addRepository(RepositoryAdmin repositoryAdmin, String repository)
    {
        try {
            if (repository != null)
            {
                boolean duplicate = false;
                for (Repository repo : repositoryAdmin.listRepositories())
                {
                    if (repository.equalsIgnoreCase(repo.getURI()))
                        duplicate = true;
                }
                if (!duplicate)
                {
                    Repository repo = repositoryAdmin.addRepository(repository);
                    if (repo == null)
                        repositoryAdmin.removeRepository(repository);   // Ignore repos not found
                }
            }
        } catch (Exception e) {
            // Ignore exception e.printStackTrace();
        }
    }
1226156
def display_select_list(list)
      HighLine.track_eof = false
      long_result = HighLine.new.choose do |menu|
        list.each_with_index do |item, i|
           menu.choice((i < 9) ? " #{item}" : item)
        end
        menu.header = "Select a repository to clone"
      end
      long_result && long_result.gsub(/\s+#.*$/,'').gsub(/^\ /,'')
    end
443651
def use_isolated_repository_view(self):
        """"""
        self._repository_view = ISOLATED
        # self._get_provider_session('asset_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_isolated_repository_view()
            except AttributeError:
                pass
236422
def view(self, repo):
        
        status = "{0}disabled{1}".format(self.meta.color["RED"],
                                         self.meta.color["ENDC"])
        self.form["Status:"] = status
        self.form["Default:"] = "no"
        if repo in self.meta.default_repositories:
            self.form["Default:"] = "yes"
        if (repo in self.meta.repositories and
                os.path.isfile(self.meta.lib_path + "{0}_repo/PACKAGES."
                               "TXT".format(repo))):
            status = "{0}enabled{1}".format(self.meta.color["GREEN"],
                                            self.meta.color["ENDC"])
            if repo != "sbo":
                data = self.repository_data(repo)
                size = units(data[1], data[2])
                self.form["Repo id:"] = repo
                self.form["Repo url:"] = self.all_repos[repo]
                self.form["Total compressed packages:"] = "{0} {1}".format(
                    str(size[1][0]), str(size[0][0]))
                self.form["Total uncompressed packages:"] = "{0} {1}".format(
                    str(size[1][1]), str(size[0][1]))
                self.form["Number of packages:"] = data[0]
                self.form["Status:"] = status
                self.form["Last updated:"] = data[3]
        elif (repo == "sbo" and os.path.isfile(self.meta.lib_path + "{0}_repo/"
                                               "SLACKBUILDS.TXT".format(repo))):
            status = "{0}enabled{1}".format(self.meta.color["GREEN"],
                                            self.meta.color["ENDC"])
            sum_sbo_pkgs = 0
            for line in (Utils().read_file(
                    self.meta.lib_path + "sbo_repo/SLACKBUILDS."
                    "TXT").splitlines()):
                if line.startswith("SLACKBUILD NAME: "):
                    sum_sbo_pkgs += 1
            changelog_txt = Utils().read_file(
                self.meta.log_path + "sbo/ChangeLog.txt")
            last_upd = changelog_txt.split("\n", 1)[0]
            self.form["Repo id:"] = repo
            self.form["Repo url:"] = self.all_repos[repo]
            self.form["Total compressed packages:"] = ""
            self.form["Total uncompressed packages:"] = ""
            self.form["Number of packages:"] = sum_sbo_pkgs
            self.form["Status:"] = status
            self.form["Last updated:"] = last_upd
        print("")
        for key, value in sorted(self.form.iteritems()):
            print self.meta.color["GREY"] + key + self.meta.color["ENDC"], value
        print("")
        raise SystemExit()
765258
def show():
    """"""
    env = get_environment()

    for key, val in sorted(env.env.items(), key=lambda item: item[0]):
        click.secho('%s = %s' % (key, val))
315728
def print_dependencies(_run):
    """"""
    print('Dependencies:')
    for dep in _run.experiment_info['dependencies']:
        pack, _, version = dep.partition('==')
        print('  {:<20} == {}'.format(pack, version))

    print('\nSources:')
    for source, digest in _run.experiment_info['sources']:
        print('  {:<43}  {}'.format(source, digest))

    if _run.experiment_info['repositories']:
        repos = _run.experiment_info['repositories']
        print('\nVersion Control:')
        for repo in repos:
            mod = COLOR_DIRTY + 'M' if repo['dirty'] else ' '
            print('{} {:<43}  {}'.format(mod, repo['url'], repo['commit']) +
                  ENDC)
    print('')
90161
def get_repository(name):
    '''
    
    '''
    # Putting quotes around the parameter protects against command injection
    cmd = 'Get-PSRepository "{0}"'.format(name)
    no_ret = _pshell(cmd)
    return name not in list_modules()
598370
def repository_data(self, repo):
        
        sum_pkgs, size, unsize, last_upd = 0, [], [], ""
        for line in (Utils().read_file(
                self.meta.lib_path + repo + "_repo/PACKAGES.TXT").splitlines()):
            if line.startswith("PACKAGES.TXT;"):
                last_upd = line[14:].strip()
            if line.startswith("PACKAGE NAME:"):
                sum_pkgs += 1
            if line.startswith("PACKAGE SIZE (compressed):  "):
                size.append(line[28:-2].strip())
            if line.startswith("PACKAGE SIZE (uncompressed):  "):
                unsize.append(line[30:-2].strip())
        if repo in ["salix", "slackl"]:
            log = Utils().read_file(
                self.meta.log_path + "{0}/ChangeLog.txt".format(repo))
            last_upd = log.split("\n", 1)[0]
        return [sum_pkgs, size, unsize, last_upd]
827523
def choose(self):
        
        keys = """
 at the right side for enable or to the
left side for disable.

Keys: SPACE   select or deselect the highlighted repositories,
             move it between the left and right lists
          ^       move the focus to the left list
          $       move the focus to the right list
        TAB     move focus
      ENTER   press the focused button

      Disabled  <-------- REPOSITORIES ------->  Enabled"""
        self.read_enabled()
        self.read_disabled()
        text, title, backtitle, status = keys, " Repositories ", "", False
        self.selected = DialogUtil(self.disabled, text, title, backtitle,
                                   status).buildlist(self.enabled)
        if self.selected is not None:
            self.update_repos()
        else:
            self.selected = self.enabled
        self.clear_screen()
        self.reference()
949708
def get_repository_tags(self, namespace, repository):
        """"""
        return self._http_call(self.TAGS, get,
                               namespace=namespace, repository=repository)
273064
def get_repositories_by_composition(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceBinSession.get_bins_by_resource
        catalogs = self._get_provider_session('composition_repository_session').get_repositories_by_composition(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Repository(self._provider_manager, cat, self._runtime, self._proxy))
        return RepositoryList(cat_list)