Package portage :: Module output :: Class EOutput
[hide private]

Class EOutput

source code

object --+
         |
        EOutput

Performs fancy terminal formatting for status and informational messages.

The provided methods produce identical terminal output to the eponymous functions in the shell script /sbin/functions.sh and also accept identical parameters.

This is not currently a drop-in replacement however, as the output-related functions in /sbin/functions.sh are oriented for use mainly by system init scripts and ebuilds and their output can be customized via certain RC_* environment variables (see /etc/conf.d/rc). EOutput is not customizable in this manner since it's intended for more general uses. Likewise, no logging is provided.

Instance Methods [hide private]
 
__init__(self, quiet=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_write(self, f, s) source code
 
__eend(self, caller, errno, msg) source code
 
ebegin(self, msg)
Shows a message indicating the start of a process.
source code
 
eend(self, errno, *msg)
Indicates the completion of a process, optionally displaying a message via eerror if the process's exit status isn't 0.
source code
 
eerror(self, msg)
Shows an error message.
source code
 
einfo(self, msg)
Shows an informative message terminated with a newline.
source code
 
einfon(self, msg)
Shows an informative message terminated without a newline.
source code
 
ewarn(self, msg)
Shows a warning message.
source code
 
ewend(self, errno, *msg)
Indicates the completion of a process, optionally displaying a message via ewarn if the process's exit status isn't 0.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
BooleanType quiet
Specifies if output should be silenced.
IntType term_columns
Width of terminal in characters.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, quiet=False)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

ebegin(self, msg)

source code 

Shows a message indicating the start of a process.

Parameters:
  • msg (StringType) - A very brief (shorter than one line) description of the starting process.

eend(self, errno, *msg)

source code 

Indicates the completion of a process, optionally displaying a message via eerror if the process's exit status isn't 0.

Parameters:
  • errno (IntType) - A standard UNIX errno code returned by processes upon exit.
  • msg (StringType) - (optional) An error message, typically a standard UNIX error string corresponding to errno.

eerror(self, msg)

source code 

Shows an error message.

Parameters:
  • msg (StringType) - A very brief (shorter than one line) error message.

einfo(self, msg)

source code 

Shows an informative message terminated with a newline.

Parameters:
  • msg (StringType) - A very brief (shorter than one line) informative message.

einfon(self, msg)

source code 

Shows an informative message terminated without a newline.

Parameters:
  • msg (StringType) - A very brief (shorter than one line) informative message.

ewarn(self, msg)

source code 

Shows a warning message.

Parameters:
  • msg (StringType) - A very brief (shorter than one line) warning message.

ewend(self, errno, *msg)

source code 

Indicates the completion of a process, optionally displaying a message via ewarn if the process's exit status isn't 0.

Parameters:
  • errno (IntType) - A standard UNIX errno code returned by processes upon exit.
  • msg (StringType) - (optional) A warning message, typically a standard UNIX error string corresponding to errno.

Instance Variable Details [hide private]

term_columns

Width of terminal in characters. Defaults to the value specified by the shell's COLUMNS variable, else to the queried tty size, else to 80.
Type:
IntType