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

Class to search for text in a file. More...

Public Member Functions

def __init__ (self)
 Constructor. More...
 
def addFilter (self, filter)
 Add a regular expression string to the list. More...
 
def clearResults (self)
 Clear results list (but not filters) More...
 
def grep (self, filename)
 Search for lines in the file that match any filter. More...
 

Detailed Description

Class to search for text in a file.

Attributes:

Definition at line 283 of file text.py.

Constructor & Destructor Documentation

◆ __init__()

def pscfpp.text.Grep.__init__ (   self)

Constructor.

Definition at line 288 of file text.py.

References pscfpp.text.Grep.filters, pscfpp.text.Grep.nFilter, and pscfpp.text.Grep.results.

Member Function Documentation

◆ addFilter()

def pscfpp.text.Grep.addFilter (   self,
  filter 
)

Add a regular expression string to the list.

Parameters
filterregular expression string

Definition at line 298 of file text.py.

References pscfpp.text.Grep.filters, pscfpp.text.Grep.nFilter, and pscfpp.text.Grep.results.

◆ clearResults()

def pscfpp.text.Grep.clearResults (   self)

Clear results list (but not filters)

Definition at line 306 of file text.py.

References pscfpp.text.Grep.nFilter, and pscfpp.text.Grep.results.

◆ grep()

def pscfpp.text.Grep.grep (   self,
  filename 
)

Search for lines in the file that match any filter.

Parameters
filenamename of file to search

Definition at line 315 of file text.py.

References pscfpp.text.Grep.filters, pscfpp.text.Grep.nFilter, and pscfpp.text.Grep.results.


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