diff options
author | Alice Ferrazzi <alicef@gentoo.org> | 2017-07-28 03:55:25 +0900 |
---|---|---|
committer | Alice Ferrazzi <alicef@gentoo.org> | 2017-07-28 03:55:25 +0900 |
commit | 679d3d29139f150fc7cb5cc0e9c8255ec5d5da85 (patch) | |
tree | fa62d251dc1ecd2d34cc2363681390b82c8b780e /elivepatch_client/client/patch.py | |
parent | fix message for cve option (diff) | |
download | elivepatch-679d3d29139f150fc7cb5cc0e9c8255ec5d5da85.tar.gz elivepatch-679d3d29139f150fc7cb5cc0e9c8255ec5d5da85.tar.bz2 elivepatch-679d3d29139f150fc7cb5cc0e9c8255ec5d5da85.zip |
adding incremental patches feature in progress
- made function for list and save patches
Diffstat (limited to 'elivepatch_client/client/patch.py')
-rw-r--r-- | elivepatch_client/client/patch.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/elivepatch_client/client/patch.py b/elivepatch_client/client/patch.py new file mode 100644 index 0000000..ba086b5 --- /dev/null +++ b/elivepatch_client/client/patch.py @@ -0,0 +1,24 @@ + +import os + + +class ManaGer(object): + + def __init__(self): + self.tmp_patch = os.path.join('/tmp', 'elivepatch') + if not os.path.exists(self.tmp_patch): + os.mkdir(self.tmp_patch) + + def list(self): + patch_filename = [] + for (dirpath, dirnames, filenames) in os.walk(self.tmp_patch): + patch_filename.extend(filenames) + break + print('List of current patches:') + print(patch_filename) + + def save(self, patch): + i = 0 + while os.path.exists("elivepatch_%s.patch" % i): + i += 1 + fh = open("elivepatch_%s.patch" % i, "w")
\ No newline at end of file |