Ejemplo n.º 1
0
 def __str__(self):
     output = []
     shown_repos = self._shown_repos
     unknown_repo = self._unknown_repo
     if shown_repos or self._unknown_repo:
         output.append("Portage tree and overlays:\n")
     show_repo_paths = list(shown_repos)
     for repo_path, repo_index in shown_repos.items():
         show_repo_paths[repo_index] = repo_path
     if show_repo_paths:
         for index, repo_path in enumerate(show_repo_paths):
             output.append(" " + teal("[" + str(index) + "]") + " %s\n" % repo_path)
     if unknown_repo:
         output.append(" " + teal("[?]") + " indicates that the source repository could not be determined\n")
     return "".join(output)
Ejemplo n.º 2
0
	def __str__(self):
		output = []
		shown_repos = self._shown_repos
		unknown_repo = self._unknown_repo
		if shown_repos or self._unknown_repo:
			output.append("Repositories:\n")
		show_repo_paths = list(shown_repos)
		for repo_path, repo_index in shown_repos.items():
			show_repo_paths[repo_index] = repo_path
		if show_repo_paths:
			for index, repo_path in enumerate(show_repo_paths):
				output.append(" "+teal("["+str(index)+"]")+" %s\n" % repo_path)
		if unknown_repo:
			output.append(" "+teal("[?]") + \
				" indicates that the source repository could not be determined\n")
		return "".join(output)
Ejemplo n.º 3
0
	def __str__(self):
		"""
		In python-2.x, str() can trigger a UnicodeEncodeError here,
		so call __str__() directly.
		"""
		output = []
		shown_repos = self._shown_repos
		unknown_repo = self._unknown_repo
		if shown_repos or self._unknown_repo:
			output.append("Portage tree and overlays:\n")
		show_repo_paths = list(shown_repos)
		for repo_path, repo_index in shown_repos.items():
			show_repo_paths[repo_index] = repo_path
		if show_repo_paths:
			for index, repo_path in enumerate(show_repo_paths):
				output.append(" "+teal("["+str(index)+"]")+" %s\n" % repo_path)
		if unknown_repo:
			output.append(" "+teal("[?]") + \
				" indicates that the source repository could not be determined\n")
		return "".join(output)
Ejemplo n.º 4
0
	def __str__(self):
		"""
		In python-2.x, str() can trigger a UnicodeEncodeError here,
		so call __str__() directly.
		"""
		output = []
		shown_repos = self._shown_repos
		unknown_repo = self._unknown_repo
		if shown_repos or self._unknown_repo:
			output.append("Portage tree and overlays:\n")
		show_repo_paths = list(shown_repos)
		for repo_path, repo_index in shown_repos.items():
			show_repo_paths[repo_index] = repo_path
		if show_repo_paths:
			for index, repo_path in enumerate(show_repo_paths):
				output.append(" "+teal("["+str(index)+"]")+" %s\n" % repo_path)
		if unknown_repo:
			output.append(" "+teal("[?]") + \
				" indicates that the source repository could not be determined\n")
		return "".join(output)
Ejemplo n.º 5
0
    def print_messages(self, show_repos):
        """Performs the actual output printing of the pre-formatted
        messages

        @param show_repos: bool.
        """
        for msg in self.print_msg:
            if isinstance(msg, str):
                writemsg_stdout("%s\n" % (msg, ), noiselevel=-1)
                continue
            myprint, self.verboseadd, repoadd = msg
            if self.verboseadd:
                myprint += " " + self.verboseadd
            if show_repos and repoadd:
                myprint += " " + teal("[%s]" % repoadd)
            writemsg_stdout("%s\n" % (myprint, ), noiselevel=-1)
Ejemplo n.º 6
0
	def print_messages(self, show_repos):
		"""Performs the actual output printing of the pre-formatted
		messages

		@param show_repos: bool.
		"""
		for msg in self.print_msg:
			if isinstance(msg, basestring):
				writemsg_stdout("%s\n" % (msg,), noiselevel=-1)
				continue
			myprint, self.verboseadd, repoadd = msg
			if self.verboseadd:
				myprint += " " + self.verboseadd
			if show_repos and repoadd:
				myprint += " " + teal("[%s]" % repoadd)
			writemsg_stdout("%s\n" % (myprint,), noiselevel=-1)
		return