Package madgraph :: Package iolibs :: Module file_writers :: Class FileWriter
[hide private]
[frames] | no frames]

Class FileWriter

source code

object --+    
         |    
      file --+
             |
            FileWriter
Known Subclasses:

Generic Writer class. All writers should inherit from this class.

Nested Classes [hide private]
  FileWriterError
Exception raised if an error occurs in the definition or the execution of a Writer.
Instance Methods [hide private]
file object
__init__(self, name, opt='w')
Initialize file to write to
source code
 
write_line(self, line)
Write a line with proper indent and splitting of long lines for the language in question.
source code
 
write_comment_line(self, line)
Write a comment line, with correct indent and line splits, for the language in question
source code
 
write_comments(self, lines)
Write set of comment lines, with correct indent and line splits, for the language in question
source code
None
writelines(self, lines)
Extends the regular file.writeline() function to write out nicely formatted code
source code

Inherited from file: __delattr__, __enter__, __exit__, __getattribute__, __iter__, __new__, __repr__, __setattr__, close, fileno, flush, isatty, next, read, readinto, readline, readlines, seek, tell, truncate, write, xreadlines

Inherited from object: __format__, __hash__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from file: closed, encoding, errors, mode, name, newlines, softspace

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, opt='w')
(Constructor)

source code 

Initialize file to write to

Returns: file object
Overrides: object.__init__

writelines(self, lines)

source code 

Extends the regular file.writeline() function to write out nicely formatted code

Returns: None
Overrides: file.writelines