gdesk.core.history module¶
- class gdesk.core.history.History(logdir)¶
Bases:
object
- define_tables()¶
- execfetch(query, parameters=())¶
- import_command_history(other_logfile)¶
- init_server(logdir=None)¶
- logcmd(cmd)¶
- make_retrieve_query(count=20, part='', from_id=None, distinct=False, back=True, prefix=True)¶
- retrievecmd(part='', from_id=None, distinct=True, back=True, prefix=True)¶
- storepath(path, delete_old_entry=True, category='image')¶
- tail(count=20, part='', from_id=None, distinct=False, back=True, prefix=True, reverse=True)¶
- yield_recent_paths(count=20, category='image')¶
- class gdesk.core.history.LogDir(rootpath)¶
Bases:
object
- find_log_path()¶
Find a suitable rootpath/log.N path.
Which logpath contains an active lock file? Create a new log.N if needed.
- get_active_lock_files()¶
- make_lock_file(lock_file)¶
Make a empty lock file in the logpath.
A windows readlock is attached to the file. The lock will be removed by windows if the process dies. When booting another instance of Ghawk, this lock file will be used (the possibility to removed it) to detect if the logpath is currently in use by another Ghawk process.
- release_lock_file()¶
Release and remove the current lock file.
When this process dies, the lock is removed by windows but the file is not removed.
- remove_inactive_log_dirs()¶