Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.support.pygments.formatters.terminal256.EscapeSequence Class Reference

List of all members.

Public Member Functions

def __init__
def escape
def color_string
def reset_string

Public Attributes

 fg
 bg
 bold
 underline

Detailed Description

Definition at line 33 of file terminal256.py.


Constructor & Destructor Documentation

def MoinMoin.support.pygments.formatters.terminal256.EscapeSequence.__init__ (   self,
  fg = None,
  bg = None,
  bold = False,
  underline = False 
)

Definition at line 34 of file terminal256.py.

00034 
00035     def __init__(self, fg=None, bg=None, bold=False, underline=False):
00036         self.fg = fg
00037         self.bg = bg
00038         self.bold = bold
00039         self.underline = underline


Member Function Documentation

Definition at line 45 of file terminal256.py.

00045 
00046     def color_string(self):
00047         attrs = []
00048         if self.fg is not None:
00049             attrs.extend(("38", "5", "%i" % self.fg))
00050         if self.bg is not None:
00051             attrs.extend(("48", "5", "%i" % self.bg))
00052         if self.bold:
00053             attrs.append("01")
00054         if self.underline:
00055             attrs.append("04")
00056         return self.escape(attrs)

Here is the call graph for this function:

Definition at line 40 of file terminal256.py.

00040 
00041     def escape(self, attrs):
00042         if len(attrs):
00043             return "\x1b[" + ";".join(attrs) + "m"
00044         return ""

Here is the caller graph for this function:

Definition at line 57 of file terminal256.py.

00057 
00058     def reset_string(self):
00059         attrs = []
00060         if self.fg is not None:
00061             attrs.append("39")
00062         if self.bg is not None:
00063             attrs.append("49")
00064         if self.bold or self.underline:
00065             attrs.append("00")
00066         return self.escape(attrs)

Here is the call graph for this function:


Member Data Documentation

Definition at line 36 of file terminal256.py.

Definition at line 37 of file terminal256.py.

Definition at line 35 of file terminal256.py.

Definition at line 38 of file terminal256.py.


The documentation for this class was generated from the following file: