Lists all the installed repos as well as their last start and finish
    times from the cron's perspective.
432123
def _list_repos():
    
    if not args["list"]:
        return
    
    #Just loop over the list of repos we have in a server instance. See if
    #they also exist in the db's status; if they do, include the start/end
    #times we have saved.
    from pyci.server import Server
    server = Server(testmode=args["nolive"])
    output = ["Repository           |      Started     |      Finished    | XML File Path",
              "--------------------------------------------------------------------------"]

    dbs = {} if "status" not in db else db["status"]
    fullfmt = "{0:<20} | {1:^16} | {2:^16} | {3}"
    for reponame, repo in server.repositories.items():
        if reponame in dbs:
            start = _fmt_time(dbs[reponame]["start"])
            end = _fmt_time(dbs[reponame]["end"])
        else:
            start = "Never"
            end = "Never"
        output.append(fullfmt.format(reponame, start, end, repo.filepath))

    info('\n'.join(output))
567577
def get_repositories(self):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_template
        catalogs = self._get_provider_session('repository_lookup_session').get_repositories()
        cat_list = []
        for cat in catalogs:
            cat_list.append(Repository(self._provider_manager, cat, self._runtime, self._proxy))
        return RepositoryList(cat_list)
271142
public function listCronsStatus()
    {
        /** @var SmileCron[] $smileCrons */
        $smileCrons = $this->repository->listCrons();

        /** @var CronInterface[] $crons */
        $crons = $this->getCrons();
        $cronAlias = array();

        foreach ($crons as $cron) {
            $cronAlias[$cron->getAlias()] = $cron;
        }

        if ($smileCrons) {
            foreach ($smileCrons as $smileCron) {
                if (isset($cronAlias[$smileCron->getAlias()])) {
                    $cronAlias[$smileCron->getAlias()] = $smileCron;
                }
            }
        }

        return $cronAlias;
    }
155165
def do_list(self, line):
        '''
        
        '''
        repo_names = self.network.repo_names
        print('Known repos:')
        print('    ' + '\n    '.join(repo_names))
676767
def _get_cron_info():
    '''
    
    '''
    owner = 'root'
    if __grains__['os'] == 'FreeBSD':
        group = 'wheel'
        crontab_dir = '/var/cron/tabs'
    elif __grains__['os'] == 'OpenBSD':
        group = 'crontab'
        crontab_dir = '/var/cron/tabs'
    elif __grains__['os_family'] == 'Solaris':
        group = 'root'
        crontab_dir = '/var/spool/cron/crontabs'
    elif __grains__['os'] == 'MacOS':
        group = 'wheel'
        crontab_dir = '/usr/lib/cron/tabs'
    else:
        group = 'root'
        crontab_dir = '/var/spool/cron'
    return owner, group, crontab_dir
1104716
def git_reset_all_repos(cat, hard=True, origin=False, clean=True):
    
    log = cat.log
    log.debug("gitter.git_reset_all_repos()")

    all_repos = cat.PATHS.get_all_repo_folders()
    for repo in all_repos:
        log.warning("Repo in: '{}'".format(repo))
        # Get the initial git SHA
        sha_beg = get_sha(repo)
        log.debug("Current SHA: '{}'".format(sha_beg))

        grepo = git.cmd.Git(repo)
        # Fetch first
        log.info("fetching")
        grepo.fetch()

        args = []
        if hard:
            args.append('--hard')
        if origin:
            args.append('origin/master')
        log.info("resetting")
        retval = grepo.reset(*args)
        if len(retval):
            log.warning("Git says: '{}'".format(retval))

        # Clean
        if clean:
            log.info("cleaning")
            # [q]uiet, [f]orce, [d]irectories
            retval = grepo.clean('-qdf')
            if len(retval):
                log.warning("Git says: '{}'".format(retval))

        sha_end = get_sha(repo)
        if sha_end != sha_beg:
            log.debug("Updated SHA: '{}'".format(sha_end))

    return
1225624
def _get_repos(self):
        
        result = {}
        for xmlpath in self.installed:
            repo = RepositorySettings(self, xmlpath)
            result[repo.name.lower()] = repo

        return result
991207
def pkg_list(self):
        
        options = [
            "-l",
            "--list"
        ]
        flag = ["--index", "--installed", "--name"]
        name = INDEX = installed = False
        for arg in self.args[2:]:
            if flag[0] == arg:
                INDEX = True
            if flag[1] in arg:
                installed = True
            if flag[2] == arg:
                name = True
            if arg not in flag:
                usage("")
                raise SystemExit()
        if (len(self.args) > 1 and len(self.args) <= 5 and
                self.args[0] in options):
            if self.args[1] in self.meta.repositories:
                PackageManager(binary=None).package_list(self.args[1],
                                                         name,
                                                         INDEX,
                                                         installed)
            else:
                usage(self.args[1])
        else:
            usage("")
649602
def _check_repos(self, repos):
        """"""
        self._checking_repos = []
        self._valid_repos = []

        for repo in repos:
            worker = self.download_is_valid_url(repo)
            worker.sig_finished.connect(self._repos_checked)
            worker.repo = repo
            self._checking_repos.append(repo)
757962
def show_updates(self):
        
        dists = Distributions()
        if self.project_name:
            #Check for a single package
            pkg_list = [self.project_name]
        else:
            #Check for every installed package
            pkg_list = get_pkglist()
        found = None
        for pkg in pkg_list:
            for (dist, active) in dists.get_distributions("all", pkg,
                    dists.get_highest_installed(pkg)):
                (project_name, versions) = \
                        self.pypi.query_versions_pypi(dist.project_name)
                if versions:

                    #PyPI returns them in chronological order,
                    #but who knows if its guaranteed in the API?
                    #Make sure we grab the highest version:

                    newest = get_highest_version(versions)
                    if newest != dist.version:

                        #We may have newer than what PyPI knows about

                        if pkg_resources.parse_version(dist.version) < \
                            pkg_resources.parse_version(newest):
                            found = True
                            print(" %s %s (%s)" % (project_name, dist.version,
                                    newest))
        if not found and self.project_name:
            self.logger.info("You have the latest version installed.")
        elif not found:
            self.logger.info("No newer packages found at The Cheese Shop")
        return 0
1296456
public function listRepositoryEvents(): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/repos/:owner/:repo/events', $this->getActivity()->getOwner(),
                                                 $this->getActivity()->getRepo()));
    }
404648
def _find_next(server):
    
    from datetime import datetime
    #Re-load the database in case we have multiple instances of the script
    #running in memory.
    _load_db()
    result = None
    visited = []
    
    if "status" in db:
        for reponame, status in db["status"].items():
            vms("Checking cron status for {}: {}".format(reponame, status))
            start = None if "started" not in status else status["started"]
            end = None if "end" not in status else status["end"]
            running = start is not None and end is not None and start > end
            add = False
            
            if not running and end is not None:
                #Check the last time it was run and see if enough time has
                #elapsed.
                elapsed = (datetime.now() - end).seconds/60
                add = elapsed > server.cron.settings[reponame].frequency
                if not add:
                    vms("'{}' skipped because the interval hasn't ".format(reponame) +
                        "elapsed ({} vs. {})".format(elapsed, server.cron.settings[reponame].frequency))
            elif end is None:
                add = True

            if add:
                result = reponame
                break
            visited.append(reponame)
    else:
        db["status"] = {}        


    if result is None:
        #We still need to check the newly installed repos.            
        for reponame, repo in server.repositories.items():
            if reponame not in visited:
                #These are newly installed repos that have never run before.
                vms("Added '{}' as new repo for cron execution.".format(reponame))
                result = reponame
                break

    return result
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]
306408
def listdir_find_repos(where):
    
    stack = deque([(convert_path(where), '')])
    while stack:
        where, prefix = stack.pop()
        try:
            for name in sorted(os.listdir(where), reverse=True):
                fn = os.path.join(where, name)
                if name in REPO_PREFIXES:
                    if 1:  # os.path.exists(fn):
                        # yield name[1:], fn.rstrip(name)[:-1] # abspath
                        repo = REPO_PREFIXES[name](fn.rstrip(name)[:-1])
                        yield repo
                    stack.append((fn, prefix + name + '/'))
        except OSError as e:
            if e.errno == errno.EACCES:
                log.error("Skipping: %s", e)
            else:
                raise
515948
def list(reverse = false)
      requests = server.current_requests_full.reject do |request|
        # Find only pending (= unmerged) requests and output summary.
        # Explicitly look for local changes git does not yet know about.
        # TODO: Isn't this a bit confusing? Maybe display pending pushes?
        local.merged? request.head.sha
      end
      source = local.source
      if requests.empty?
        puts "No pending requests for '#{source}'."
      else
        puts "Pending requests for '#{source}':"
        puts "ID      Updated    Comments  Title".pink
        print_requests(requests, reverse)
      end
    end
1150167
public function listCommand()
    {
        $repositories = $this->driverComposite->getRepositories();
        foreach ($repositories as $repository) {
            $this->outputLine($repository->getRepositoryUrl());
        }
    }
1118215
def output_files(self):
        
        for item in self.source_files:
            yield os.path.join(self.address.repo, self.address.path, item)