diff options
-rw-r--r-- | module/config/core_default.xml | 1 | ||||
-rw-r--r-- | module/download_thread.py | 42 |
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" |