( self )
| 41 | class SearchReplaceOp( IECore.Op ) : |
| 42 | |
| 43 | def __init__( self ) : |
| 44 | |
| 45 | IECore.Op.__init__( self, "Performs a search and replace on ASCII text files.", |
| 46 | IECore.FileNameParameter( |
| 47 | name = "result", |
| 48 | description = "The resulting file. Maya be the same as the input file.", |
| 49 | defaultValue = "", |
| 50 | allowEmptyString = True, |
| 51 | ) |
| 52 | ) |
| 53 | |
| 54 | self.parameters().addParameters( |
| 55 | [ |
| 56 | IECore.FileNameParameter( |
| 57 | name = "source", |
| 58 | description = "The source file.", |
| 59 | defaultValue = "", |
| 60 | extensions = "ma rib shk nk", |
| 61 | check = IECore.FileNameParameter.CheckType.MustExist, |
| 62 | allowEmptyString = False, |
| 63 | ), |
| 64 | IECore.FileNameParameter( |
| 65 | name = "destination", |
| 66 | description = "The destination file.", |
| 67 | defaultValue = "", |
| 68 | allowEmptyString = False, |
| 69 | ), |
| 70 | IECore.StringParameter( |
| 71 | name = "searchFor", |
| 72 | description = "The pattern to search for", |
| 73 | defaultValue = "", |
| 74 | ), |
| 75 | IECore.BoolParameter( |
| 76 | name = "regexpSearch", |
| 77 | description = "Enable to perform searching based on regular expressions", |
| 78 | defaultValue = False |
| 79 | ), |
| 80 | IECore.StringParameter( |
| 81 | name = "replaceWith", |
| 82 | description = "The string with which to replace patterns which match the search criteria", |
| 83 | defaultValue = "", |
| 84 | ) |
| 85 | ] |
| 86 | ) |
| 87 | |
| 88 | def doOperation( self, operands ) : |
| 89 |
nothing calls this directly
no test coverage detected