PSCF v1.1
Public Member Functions | List of all members
pscfpp.text.Wrapper Class Reference

Class to wrap line breaks. More...

Public Member Functions

def __init__ (self, eol='\n', nIndent=0)
 Constructor. More...
 
def clear (self)
 Clear mutable attributes (column and text). More...
 
def append (self, string)
 Add contents of string to wrapped text. More...
 
def __str__ (self)
 Return string containing wrapped text (self.text). More...
 
def __repr__ (self)
 Return string containing wrapped text (self.text). More...
 

Detailed Description

Class to wrap line breaks.

Definition at line 12 of file text.py.

Constructor & Destructor Documentation

◆ __init__()

def pscfpp.text.Wrapper.__init__ (   self,
  eol = '\n',
  nIndent = 0 
)

Constructor.

Data attributes:

  • eol : end-of-line character
  • nIndent : number of spaces preceding each line
  • column : current column index (cursor)
  • limit : maximum number of columns (78 by default)
  • text : string containing resuling wrapped text
Parameters
eolend-of-line character
nIndentnumber of space preceding each line

Definition at line 28 of file text.py.

References pscfpp.text.Wrapper.column, pscfpp.text.Wrapper.eol, pscfpp.text.Wrapper.limit, pscfpp.text.Wrapper.nIndent, and pscfpp.text.Wrapper.text.

Member Function Documentation

◆ clear()

def pscfpp.text.Wrapper.clear (   self)

Clear mutable attributes (column and text).

Definition at line 38 of file text.py.

References pscfpp.text.Wrapper.column, and pscfpp.text.Wrapper.text.

◆ append()

def pscfpp.text.Wrapper.append (   self,
  string 
)

Add contents of string to wrapped text.

Parameters
stringinput string

Definition at line 47 of file text.py.

References pscfpp.text.Wrapper.column, pscfpp.text.Wrapper.eol, pscfpp.text.Wrapper.limit, pscfpp.text.Wrapper.nIndent, and pscfpp.text.Wrapper.text.

◆ __str__()

def pscfpp.text.Wrapper.__str__ (   self)

Return string containing wrapped text (self.text).

Definition at line 64 of file text.py.

References pscfpp.text.Wrapper.text.

Referenced by pscfpp.field.Field.write(), pscfpp.output.Thermo.write(), and pscfpp.output.State.write().

◆ __repr__()

def pscfpp.text.Wrapper.__repr__ (   self)

Return string containing wrapped text (self.text).

Definition at line 70 of file text.py.

References pscfpp.text.Wrapper.text.


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