Table of Contents

Class: OutputToFile sam/output/File.py

Handles producing a text file containing the contents of a Table.

Purpose: Saves a table into a text file.

Used by: doFile

Uses: libglade, gtk, gnome.ui, ErrorHandler

Attributes: None

SRS Refs: 3.2.1.6d, 3.2.1.7

Author: caedwa

Date: 18/7/02

Methods   
__init__
handleCancel
handleRadioToggle
handleSave
handleStreamidToggle
run
  __init__ 
__init__ ( self,  table )

Purpose: Creates a new instance of the class OutputToFile. If the environment variable RAMI_SAM_DIR is set, the glade file is looked for in that directory, otherwise looked for in the current directory. Hooks up the handlers.

Used by: doFile

Uses: None

Input: table : Table

Output: New instance of the class OutputToFile

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.6d, 3.2.1.7

Author: caedwa

Date: 18/702

  handleCancel 
handleCancel ( self,  *args )

Purpose: Handles the user clicking on the Cancel button. Hides the dialog box and mainquits out of the loop.

Used by: OutputToFile

Uses: gtk

Input: None

Output: None

Preconditions: A mainloop has been entered, the name of the fileoptions widget tree is "fileoptions".

Postconditions: None

SRS Refs: 3.2.1.7

Author: caedwa

Date: 18/7/02

  handleRadioToggle 
handleRadioToggle ( self,  *args )

Purpose: Handles the user clicking on one of the radio buttons which select the delimiter. Sets the __delimiter variable to the appropriate delimiter, or None if other has been selected (text will be read in when necessary).

Used by: OutputToFile

Uses: None

Input: *args : unused arguments

Output: None Preconditions: A mainloop has been entered, the name of the radio buttons in the glade file are "space_radio_button" and "tab_radio_button".

Postconditions: __delimiter is set to the appropriate string or None

SRS Refs: 3.2.1.7

Author: caedwa

Date: 18/7/02

  handleSave 
handleSave ( self,  *args )

Purpose: Handles the user clicking on the OK button, at which point a file must be produced containing the details of the table. An information box is displayed to the user if the file has been saved successfully.

Used by: OutputToFile

Uses: TableFile, ErrorHandler, gnome.ui

Input: *args : unused arguments

Output: None

Preconditions: The name of the text entry for the other radio button is "other_textentry", the name of the file entry box is "file-entry1", the name of the file options widget tree is "fileoptions".

Postconditions: None

SRS Refs: 3.2.1.6d

Author: caedwa

Date: 18/7/02

Exceptions   
CustomError( "Warning \"" + filename + "\" filename" + " already used", 1 )
  handleStreamidToggle 
handleStreamidToggle ( self,  *args )

Purpose: Handles the user clicking on one of the radio buttons which select the format of the output file. Sets the __usestreamid variable to 1 if the user has selected to use the stream id as an extra column, to 0 if the user has selected to combine the tables. Used by: OutputToFile

Uses: None

Input: *args : unused arguments

Output: None Preconditions: A mainloop has been entered, the name of the radio buttons in the glade file are "combine_radiobutton" and "streamid_radiobutton".

Postconditions: __usestreamid is set to 0 or 1

SRS Refs: 3.2.1.7

Author: mayadm

Date: 3/10/02

  run 
run ( self )

Purpose: Runs a mainloop for the user to select options for the output file before the file is created.

Used by: doFile

Uses: gtk

Input: None

Output: None

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.7

Author: caedwa

Date: 18/7/02


Table of Contents

This document was automatically generated on Wed Oct 30 23:04:21 2002 by HappyDoc version 2.0