tabview
index
/home/ut3hax/bin/tabview

# tabview.py -- View a tab-delimited file in a spreadsheet-like display.
# Contributed by A.M. Kuchling <amk@amk.ca>
#
# The tab-delimited file is displayed on screen.  The highlighted
# position is shown in the top-left corner of the screen; below it are
# shown the contents of that cell.
#
#  Movement keys are:
#    Cursor keys: Move the highlighted cell, scrolling if required.
#    Q or q     : Quit
#    TAB        : Page right a screen
#    Home       : Move to the start of this line
#    End        : Move to the end of this line
#    PgUp/PgDn  : Move a page up or down
#    Insert     : Memorize this position
#    Delete     : Return to memorized position (if any)
#
# TODO : 
#    A 'G' for Goto: enter a cell like AA260 and move there
#    A key to re-read the tab-delimited file
#
# Possible projects:
#    Allow editing of cells, and then saving the modified data
#    Add formula evaluation, and you've got a simple spreadsheet
# program.  (Actually, you should allow displaying both via curses and
# via a Tk widget.)  
#

 
Modules
       
curses
re
string

 
Classes
       
TabFile

 
class TabFile
     Methods defined here:
__init__(self, scr, filename, column_width=20)
display(self)
Refresh the current display
move_to_end(self)
Move the highlighted location to the end of the current line.

 
Functions
       
main(stdscr)
str2yx(s)
Convert a string like A1 to a coordinate pair like 0,0
yx2str(y, x)
Convert a coordinate pair like 1,26 to AA2

 
Data
        coord_pat = <_sre.SRE_Pattern object>