CHAP.reader

File : reader.py Author : Valentin Kuznetsov Description: generic Reader module

Define a generic Reader object.

Module Contents

Classes

Reader

Generic file reader.

OptionParser

User based option parser

Functions

main

Main function

API

class CHAP.reader.Reader

Bases: CHAP.pipeline.PipelineItem

Generic file reader.

The job of any Reader in a Pipeline is to provide data stored in a file to the next PipelineItem. Note that a Reader used on its own disrupts the flow of data in a Pipeline – it does not receive or pass along any data returned by the previous PipelineItem.

Initialization

Constructor of PipelineItem class

read(filename)

Read and return the contents of filename as text

Parameters:

filename (str) – Name of file to read from

Returns:

entire contents of the file

Return type:

str

class CHAP.reader.OptionParser

User based option parser

Initialization

CHAP.reader.main(opt_parser=OptionParser)

Main function