summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/addon
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/addon')
-rw-r--r--pyload/plugin/addon/Checksum.py10
-rw-r--r--pyload/plugin/addon/ExternalScripts.py8
-rw-r--r--pyload/plugin/addon/ExtractArchive.py10
-rw-r--r--pyload/plugin/addon/HotFolder.py4
-rw-r--r--pyload/plugin/addon/MergeFiles.py8
-rw-r--r--pyload/plugin/addon/UpdateManager.py6
6 files changed, 23 insertions, 23 deletions
diff --git a/pyload/plugin/addon/Checksum.py b/pyload/plugin/addon/Checksum.py
index 043a1861c..76a4954ac 100644
--- a/pyload/plugin/addon/Checksum.py
+++ b/pyload/plugin/addon/Checksum.py
@@ -10,7 +10,7 @@ from os import remove
from os.path import getsize, isfile, splitext
from pyload.plugin.Addon import Addon
-from pyload.utils import safe_join, fs_encode
+from pyload.utils import fs_join, fs_encode
def computeChecksum(local_file, algorithm):
@@ -104,7 +104,7 @@ class Checksum(Addon):
local_file = fs_encode(pyfile.plugin.lastDownload)
#download_folder = self.config['general']['download_folder']
- #local_file = fs_encode(safe_join(download_folder, pyfile.package().folder, pyfile.name))
+ #local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name))
if not isfile(local_file):
self.checkFailed(pyfile, None, "File does not exist")
@@ -164,7 +164,7 @@ class Checksum(Addon):
def packageFinished(self, pypack):
- download_folder = safe_join(self.config['general']['download_folder'], pypack.folder, "")
+ download_folder = fs_join(self.config['general']['download_folder'], pypack.folder, "")
for link in pypack.getChildren().itervalues():
file_type = splitext(link['name'])[1][1:].lower()
@@ -172,7 +172,7 @@ class Checksum(Addon):
if file_type not in self.formats:
continue
- hash_file = fs_encode(safe_join(download_folder, link['name']))
+ hash_file = fs_encode(fs_join(download_folder, link['name']))
if not isfile(hash_file):
self.logWarning(_("File not found"), link['name'])
continue
@@ -184,7 +184,7 @@ class Checksum(Addon):
data = m.groupdict()
self.logDebug(link['name'], data)
- local_file = fs_encode(safe_join(download_folder, data['NAME']))
+ local_file = fs_encode(fs_join(download_folder, data['NAME']))
algorithm = self.methods.get(file_type, file_type)
checksum = computeChecksum(local_file, algorithm)
if checksum == data['HASH']:
diff --git a/pyload/plugin/addon/ExternalScripts.py b/pyload/plugin/addon/ExternalScripts.py
index 139a7e3e7..137003595 100644
--- a/pyload/plugin/addon/ExternalScripts.py
+++ b/pyload/plugin/addon/ExternalScripts.py
@@ -6,7 +6,7 @@ import subprocess
from itertools import chain
from pyload.plugin.Addon import Addon
-from pyload.utils import safe_join
+from pyload.utils import fs_join
class ExternalScripts(Addon):
@@ -95,14 +95,14 @@ class ExternalScripts(Addon):
def downloadFinished(self, pyfile):
download_folder = self.config['general']['download_folder']
for script in self.scripts['download_finished']:
- filename = safe_join(download_folder, pyfile.package().folder, pyfile.name)
+ filename = fs_join(download_folder, pyfile.package().folder, pyfile.name)
self.callScript(script, pyfile.pluginname, pyfile.url, pyfile.name, filename, pyfile.id)
def packageFinished(self, pypack):
download_folder = self.config['general']['download_folder']
for script in self.scripts['package_finished']:
- folder = safe_join(download_folder, pypack.folder)
+ folder = fs_join(download_folder, pypack.folder)
self.callScript(script, pypack.name, folder, pypack.password, pypack.id)
@@ -126,7 +126,7 @@ class ExternalScripts(Addon):
def package_extracted(self, pypack):
download_folder = self.config['general']['download_folder']
for script in self.scripts['package_extracted']:
- folder = safe_join(download_folder, pypack.folder)
+ folder = fs_join(download_folder, pypack.folder)
self.callScript(script, pypack.name, folder, pypack.password, pypack.id)
diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py
index 29b2165ca..245b24322 100644
--- a/pyload/plugin/addon/ExtractArchive.py
+++ b/pyload/plugin/addon/ExtractArchive.py
@@ -52,7 +52,7 @@ if os.name != "nt":
from pyload.plugin.Addon import Addon, threaded, Expose
from pyload.plugin.Extractor import ArchiveError, CRCError, PasswordError
from pyload.plugin.internal.SimpleHoster import replace_patterns
-from pyload.utils import fs_encode, safe_join, uniqify
+from pyload.utils import fs_encode, fs_join, uniqify
class ArchiveQueue(object):
@@ -259,17 +259,17 @@ class ExtractArchive(Addon):
self.logInfo(_("Check package: %s") % pypack.name)
# determine output folder
- out = safe_join(dl, pypack.folder, destination, "") #: force trailing slash
+ out = fs_join(dl, pypack.folder, destination, "") #: force trailing slash
if subfolder:
- out = safe_join(out, pypack.folder)
+ out = fs_join(out, pypack.folder)
if not os.path.exists(out):
os.makedirs(out)
matched = False
success = True
- files_ids = [(safe_join(dl, pypack.folder, pylink['name']), pylink['id'], out) for pylink in pypack.getChildren().itervalues()]
+ files_ids = [(fs_join(dl, pypack.folder, pylink['name']), pylink['id'], out) for pylink in pypack.getChildren().itervalues()]
# check as long there are unseen files
while files_ids:
@@ -318,7 +318,7 @@ class ExtractArchive(Addon):
self.setPermissions(new_files)
for filename in new_files:
- file = fs_encode(safe_join(os.path.dirname(archive.filename), filename))
+ file = fs_encode(fs_join(os.path.dirname(archive.filename), filename))
if not os.path.exists(file):
self.logDebug("New file %s does not exists" % filename)
continue
diff --git a/pyload/plugin/addon/HotFolder.py b/pyload/plugin/addon/HotFolder.py
index f2c8a96a4..3d70853e6 100644
--- a/pyload/plugin/addon/HotFolder.py
+++ b/pyload/plugin/addon/HotFolder.py
@@ -8,7 +8,7 @@ import time
from shutil import move
from pyload.plugin.Addon import Addon
-from pyload.utils import fs_encode, safe_join
+from pyload.utils import fs_encode, fs_join
class HotFolder(Addon):
@@ -53,7 +53,7 @@ class HotFolder(Addon):
name = "%s_%s.txt" % (file, time.strftime("%H-%M-%S_%d%b%Y"))
- with open(safe_join(folder, "finished", name), "wb") as f:
+ with open(fs_join(folder, "finished", name), "wb") as f:
f.write(content)
self.core.api.addPackage(f.name, [f.name], 1)
diff --git a/pyload/plugin/addon/MergeFiles.py b/pyload/plugin/addon/MergeFiles.py
index 5efb8383b..f1981e5f1 100644
--- a/pyload/plugin/addon/MergeFiles.py
+++ b/pyload/plugin/addon/MergeFiles.py
@@ -8,7 +8,7 @@ import re
from traceback import print_exc
from pyload.plugin.Addon import Addon, threaded
-from pyload.utils import safe_join
+from pyload.utils import fs_join
class MergeFiles(Addon):
@@ -45,12 +45,12 @@ class MergeFiles(Addon):
download_folder = self.config['general']['download_folder']
if self.config['general']['folder_per_package']:
- download_folder = safe_join(download_folder, pack.folder)
+ download_folder = fs_join(download_folder, pack.folder)
for name, file_list in files.iteritems():
self.logInfo(_("Starting merging of"), name)
- final_file = open(safe_join(download_folder, name), "wb")
+ final_file = open(fs_join(download_folder, name), "wb")
for splitted_file in file_list:
self.logDebug("Merging part", splitted_file)
@@ -59,7 +59,7 @@ class MergeFiles(Addon):
pyfile.setStatus("processing")
try:
- with open(safe_join(download_folder, splitted_file), "rb") as s_file:
+ with open(fs_join(download_folder, splitted_file), "rb") as s_file:
size_written = 0
s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file)))
diff --git a/pyload/plugin/addon/UpdateManager.py b/pyload/plugin/addon/UpdateManager.py
index 0c803bea6..fe5efe04c 100644
--- a/pyload/plugin/addon/UpdateManager.py
+++ b/pyload/plugin/addon/UpdateManager.py
@@ -10,7 +10,7 @@ from os import path, remove, stat
from pyload.network.RequestFactory import getURL
from pyload.plugin.Addon import Expose, Addon, threaded
-from pyload.utils import safe_join
+from pyload.utils import fs_join
class UpdateManager(Addon):
@@ -240,7 +240,7 @@ class UpdateManager(Addon):
m = self.VERSION.search(content)
if m and m.group(2) == version:
- with open(safe_join("userplugins", prefix, filename), "wb") as f:
+ with open(fs_join("userplugins", prefix, filename), "wb") as f:
f.write(content)
updated.append((prefix, name))
@@ -282,7 +282,7 @@ class UpdateManager(Addon):
for root in ("userplugins", path.join(pypath, "pyload", "plugins")):
- filename = safe_join(root, type, file)
+ filename = fs_join(root, type, file)
try:
remove(filename)
except Exception, e: