summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-28 22:25:53 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-28 22:25:53 +0100
commit66c2411b04217a8ae5b9d5698e6d9d66cd997b42 (patch)
treecb452cf41927dc5fdc99c3ddd0e07da0eff747b2
parentpackage renaming in collector works (diff)
downloadpyload-66c2411b04217a8ae5b9d5698e6d9d66cd997b42.tar.xz
checksum is now optional
-rw-r--r--module/config/core_default.xml1
-rw-r--r--module/download_thread.py42
2 files changed, 22 insertions, 21 deletions
diff --git a/module/config/core_default.xml b/module/config/core_default.xml
index 56ac2825c..7f503ce18 100644
--- a/module/config/core_default.xml
+++ b/module/config/core_default.xml
@@ -38,6 +38,7 @@
<debug_mode>False</debug_mode>
<max_download_time>5</max_download_time>
<download_speed_limit>0</download_speed_limit>
+ <checksum>True</checksum>
</general>
<updates>
<search_updates>True</search_updates>
diff --git a/module/download_thread.py b/module/download_thread.py
index 3d4aa065d..3c008d000 100644
--- a/module/download_thread.py
+++ b/module/download_thread.py
@@ -128,28 +128,28 @@ class Download_Thread(threading.Thread):
location = join(pyfile.folder, status.filename)
pyfile.plugin.proceed(status.url, location)
-
- status.type = "checking"
- check, code = pyfile.plugin.check_file(location)
- """
- return codes:
- 0 - checksum ok
- 1 - checksum wrong
- 5 - can't get checksum
- 10 - not implemented
- 20 - unknown error
- """
- if code == 0:
- self.parent.parent.logger.info("Checksum ok ('%s')" % status.filename)
- elif code == 1:
- self.parent.parent.logger.info("Checksum not matched! ('%s')" % status.filename)
- elif code == 5:
- self.parent.parent.logger.debug("Can't get checksum for %s" % status.filename)
- elif code == 10:
- self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename)
- if not check:
- raise Checksum(code, location)
+ if self.parent.parent.xmlconfig.get("general", "checksum", True):
+ status.type = "checking"
+ check, code = pyfile.plugin.check_file(location)
+ """
+ return codes:
+ 0 - checksum ok
+ 1 - checksum wrong
+ 5 - can't get checksum
+ 10 - not implemented
+ 20 - unknown error
+ """
+ if code == 0:
+ self.parent.parent.logger.info("Checksum ok ('%s')" % status.filename)
+ elif code == 1:
+ self.parent.parent.logger.info("Checksum not matched! ('%s')" % status.filename)
+ elif code == 5:
+ self.parent.parent.logger.debug("Can't get checksum for %s" % status.filename)
+ elif code == 10:
+ self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename)
+ if not check:
+ raise Checksum(code, location)
status.type = "finished"