PSCF v1.3
pscfpp.text.RecordEditor Class Reference

Class to modify selected Records in a file of records. More...

Public Member Functions

 __init__ (self)
 Constructor.
 setFilter (self, filter, field=0)
 Set filter string.
 setNew (self, new, field)
 Set new string.
 setIsTest (self, isTest)
 Set isTest flag, to decide whether to perform a dry run.
 editFile (self, filename)
 Open and edit the specified file of records.

Detailed Description

Class to modify selected Records in a file of records.

The editFile function searches for records in which one field matches a regular expression, and resets the value of another.

Definition at line 144 of file text.py.

Constructor & Destructor Documentation

◆ __init__()

pscfpp.text.RecordEditor.__init__ ( self)

Constructor.

Definition at line 149 of file text.py.

References hasFilter, hasNew, isReady, pscfpp.make.MakeMaker.isTest, and isTest.

Member Function Documentation

◆ setFilter()

pscfpp.text.RecordEditor.setFilter ( self,
filter,
field = 0 )

Set filter string.

Parameters
filterregular expression string
fieldindex of field to be searched for (filter)

Definition at line 161 of file text.py.

References filter, filterField, hasFilter, hasNew, and isReady.

◆ setNew()

pscfpp.text.RecordEditor.setNew ( self,
new,
field )

Set new string.

Parameters
newnew value for field
fieldindex of field to be modified

Definition at line 174 of file text.py.

References dataField, hasFilter, hasNew, isReady, and new.

◆ setIsTest()

pscfpp.text.RecordEditor.setIsTest ( self,
isTest )

Set isTest flag, to decide whether to perform a dry run.

Parameters
isTestif true, perform a dry run (no modificatin)

Definition at line 186 of file text.py.

References pscfpp.make.MakeMaker.isTest, and isTest.

◆ editFile()

pscfpp.text.RecordEditor.editFile ( self,
filename )

Open and edit the specified file of records.

Parameters
filenamename of file

Definition at line 194 of file text.py.

References dataField, filter, filterField, isReady, pscfpp.make.MakeMaker.isTest, isTest, and new.


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