diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-18 18:48:58 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-10-18 18:48:58 +0200 |
commit | 7bf51466431ba69a112732f737fcba847f01a729 (patch) | |
tree | 73d28295dce8ba7839befbaf570e20963e959e32 /module/plugins/internal/Extractor.py | |
parent | [Addon] Start periodical on plugin activation (diff) | |
download | pyload-7bf51466431ba69a112732f737fcba847f01a729.tar.xz |
[Extractor] Code cleanup
Diffstat (limited to 'module/plugins/internal/Extractor.py')
-rw-r--r-- | module/plugins/internal/Extractor.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 3ab5d6a0d..6bc1ddc71 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -5,7 +5,19 @@ import re from module.PyFile import PyFile from module.plugins.internal.Plugin import Plugin -from module.utils import fs_encode + + +def renice(pid, value): + if not value or os.name is "nt": + return + + try: + subprocess.Popen(["renice", str(value), str(pid)], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + bufsize=-1) + except Exception: + pass class ArchiveError(Exception): @@ -73,15 +85,14 @@ class Extractor(Plugin): @property def target(self): - return fs_encode(self.filename) + return encode(self.filename) def __init__(self, plugin, filename, out, fullpath=True, overwrite=False, excludefiles=[], - renice=0, - delete='No', + renice=False, keepbroken=False, fid=None): """ @@ -95,8 +106,7 @@ class Extractor(Plugin): self.fullpath = fullpath self.overwrite = overwrite self.excludefiles = excludefiles - self.renice = renice - self.delete = delete + self.priority = int(priority) self.keepbroken = keepbroken self.files = [] #: Store extracted files here |