Package mathbench :: Package basement :: Module history_manager :: Class HistoryManager
[hide private]

Class HistoryManager

source code

object --+
         |
        HistoryManager

Manage the history of commands.

Instance Methods [hide private]
 
__init__(self, shell, history_dir, extension='session', max_file_nb=10)
Initialise the manager.
source code
 
get_history_files_info(self)
Return the list of dates corresponding to the available history files.
source code
 
load_session_at_date(self, dateinfo)
Iterate over the list of command corresponding to the session at a given date, described by a string in the following format:
source code
 
load_latest_session(self)
Load the latest session.
source code
 
check_not_too_many_file(self)
Check that there is not too many session file, and if there is remove the oldest.
source code
 
save_current_session(self)
Save the history of a given file into a shell.
source code
 
put_landmark(self)
Record the current length of the shell's history.
source code
 
get_landmark(self)
Record the length of the shell's history when the latest landmark was put.
source code
 
get_history_from_landmark(self)
Return the list of commands entered since the latest landmark.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  COMMANDS_SEPARATOR = '\x00\n'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, shell, history_dir, extension='session', max_file_nb=10)
(Constructor)

source code 

Initialise the manager.

history_dir

the directory where history files are supposed to be saved.
Overrides: object.__init__

load_session_at_date(self, dateinfo)

source code 

Iterate over the list of command corresponding to the session at a given date, described by a string in the following format:

YYYYMMDD-hhmmss

save_current_session(self)

source code 

Save the history of a given file into a shell.

Save the session only after the landmark.