summaryrefslogtreecommitdiffstats
path: root/module/Plugin.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-04-29 20:26:18 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-04-29 20:26:18 +0200
commit632fb7eb860675a0375b8e3a8669335ec97f6d81 (patch)
tree8b0cb62f009727b91923946e4e713017b739cea5 /module/Plugin.py
parentSome design modifications (diff)
downloadpyload-632fb7eb860675a0375b8e3a8669335ec97f6d81.tar.xz
fixed updater, moved config files, folder for each package now optional
Diffstat (limited to 'module/Plugin.py')
-rw-r--r--module/Plugin.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/Plugin.py b/module/Plugin.py
index 83610866d..59aa9c1d1 100644
--- a/module/Plugin.py
+++ b/module/Plugin.py
@@ -24,7 +24,6 @@ from os.path import join
from time import sleep
import sys
-from os.path import exists
from module.network.Request import Request
from os import makedirs
@@ -173,12 +172,13 @@ class Plugin():
def download(self, url, file_name, get={}, post={}, ref=True, cookies=True):
download_folder = self.parent.core.config['general']['download_folder']
- if self.pyfile.package.data["package_name"] != (self.parent.core.config['general']['link_file']):
+ if self.pyfile.package.data["package_name"] != (self.parent.core.config['general']['link_file']) and self.parent.core.xmlconfig.get("general", "folder_per_package", False):
self.pyfile.folder = self.pyfile.package.data["package_name"]
location = join(download_folder, self.pyfile.folder.decode(sys.getfilesystemencoding()))
- if not exists(location): makedirs(location)
+ makedirs(location)
file_path = join(location.decode(sys.getfilesystemencoding()), self.pyfile.status.filename.decode(sys.getfilesystemencoding()))
else:
file_path = join(download_folder, self.pyfile.status.filename.decode(sys.getfilesystemencoding()))
+ file_path = join(download_folder, self.pyfile.status.filename.decode(sys.getfilesystemencoding()))
self.pyfile.status.filename = self.req.download(url, file_path, get, post, ref, cookies)