ATLAS Offline Software
Loading...
Searching...
No Matches
AtlCoolConsole.HistoryConsole Class Reference
Inheritance diagram for AtlCoolConsole.HistoryConsole:
Collaboration diagram for AtlCoolConsole.HistoryConsole:

Public Member Functions

 __init__ (self, locals=None, filename="<console>", histfile=os.path.join(os.environ["HOME"], historyFile))
 init_history (self, histfile)
 save_history (self, histfile)

Public Attributes

 save_history

Detailed Description

This class extends InteractiveConsole with command line history. The
history can be accessed with the usual CURSOR UP keystroke. It is also
stored to a file '%s' in the user's home directory.

Definition at line 24 of file AtlCoolConsole.py.

Constructor & Destructor Documentation

◆ __init__()

AtlCoolConsole.HistoryConsole.__init__ ( self,
locals = None,
filename = "<console>",
histfile = os.path.join( os.environ["HOME"], historyFile) )

Definition at line 31 of file AtlCoolConsole.py.

34 histfile = os.path.join( os.environ["HOME"], historyFile) ):
35 code.InteractiveConsole.__init__( self )
36 self.init_history( histfile )
37

Member Function Documentation

◆ init_history()

AtlCoolConsole.HistoryConsole.init_history ( self,
histfile )

Definition at line 38 of file AtlCoolConsole.py.

38 def init_history( self, histfile ):
39 readline.parse_and_bind( "tab: complete" )
40 readline.set_history_length( 100 )
41 if hasattr( readline, "read_history_file" ):
42 try:
43 readline.read_history_file( histfile )
44 except IOError:
45 pass
46 atexit.register( self.save_history, histfile )
47

◆ save_history()

AtlCoolConsole.HistoryConsole.save_history ( self,
histfile )

Definition at line 48 of file AtlCoolConsole.py.

48 def save_history( self, histfile ):
49 readline.write_history_file( histfile )
50
51
52

Member Data Documentation

◆ save_history

AtlCoolConsole.HistoryConsole.save_history

Definition at line 46 of file AtlCoolConsole.py.


The documentation for this class was generated from the following file: