aboutsummaryrefslogtreecommitdiff
path: root/sgdfi/_manager.py
diff options
context:
space:
mode:
Diffstat (limited to 'sgdfi/_manager.py')
-rwxr-xr-xsgdfi/_manager.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/sgdfi/_manager.py b/sgdfi/_manager.py
index d3b60a3..ac8eb11 100755
--- a/sgdfi/_manager.py
+++ b/sgdfi/_manager.py
@@ -8,8 +8,9 @@
import os.path as _path
-from os import makedirs as _makedirs, open as _open, fdopen as _fdopen, \
- O_WRONLY as _O_WRONLY, O_CREAT as _O_CREAT, O_EXCL as _O_EXCL
+from os import listdir as _listdir, makedirs as _makedirs, open as _open, \
+ fdopen as _fdopen, O_WRONLY as _O_WRONLY, O_CREAT as _O_CREAT, \
+ O_EXCL as _O_EXCL
from io import RawIOBase as _RawIOBase, TextIOWrapper as _TextIOWrapper
from sys import stdout as _stdout
from string import ascii_letters as _ascii_letters
@@ -433,6 +434,15 @@ class Manager(_Decoder):
return self.feed(open(path, "rb"), type = type, **kwargs)
+ def load_latest_dump(self):
+ """ Load the latest dump (shortcut for simplifying the reverse
+ engineering process). """
+
+ l = _listdir(self.__folder)
+ l.sort()
+
+ return self.load_dump(l[-1])
+
def load_dump(self, time, id = None):
""" Read from a saved dump (with headers). """