Package gofer :: Package agent :: Module config :: Class Reader
[hide private]
[frames] | no frames]

Class Reader

source code

File reader. post-process directives.

Instance Methods [hide private]
 
__init__(self, path) source code
str
readline(self)
read the next line.
source code
 
close(self) source code
list
__post(self, input)
Post-process file content for directives.
source code
[str,..]
__import(self, ln)
Procecss an i{import} directive and return the result.
source code
str
__repl(self, ln)
Replace variables contained in the line.
source code
 
__str__(self) source code
Class Variables [hide private]
  MACROS = {'%{hostname}': 'localhost.localdomain', '%{messaging...
Instance Variables [hide private]
int idx
The line index.
str path
The path to a file to read.
dict vdict
The variable dictionary.
Method Details [hide private]

readline(self)

source code 

read the next line.

Returns: str
The line of None on EOF.

__post(self, input)

source code 

Post-process file content for directives.

Parameters:
  • input (list) - The file content (lines).
Returns: list
The post processed content.

__import(self, ln)

source code 

Procecss an i{import} directive and return the result.

Parameters:
  • ln (str) - A line containing the directive.
Returns: [str,..]
The import result (lines).

__repl(self, ln)

source code 

Replace variables contained in the line.

Parameters:
  • ln (str) - A file line.
Returns: str
The line w/ vars replaced.

Class Variable Details [hide private]

MACROS

Value:
{'%{hostname}': socket.gethostname(), '%{messaging.url}': _cnfvalue, '\
%{messaging.cacert}': _cnfvalue, '%{messaging.clientcert}': _cnfvalue,\
}