From 1a05d470a2e39af20b148ad7530d6384ef8db295 Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Mon, 23 Jul 2007 21:21:36 +0000 Subject: [PATCH] fix version number assert error --- src/common.py | 7 +++++-- src/core.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common.py b/src/common.py index 205b3a24d..6a6adba7b 100644 --- a/src/common.py +++ b/src/common.py @@ -35,8 +35,11 @@ PROGRAM_NAME = "Deluge" PROGRAM_VERSION = "0.5.3" CLIENT_CODE = "DE" -CLIENT_VERSION = "".join(PROGRAM_VERSION.split('.'))+"0"*(4 - len(PROGRAM_VERSION.split('.'))) - +CLIENT_VERSION = ''.join(PROGRAM_VERSION.split('.')) +if len(CLIENT_VERSION) < 4: + CLIENT_VERSION = CLIENT_VERSION + '0'*(4-len(CLIENT_VERSION)) +elif len(CLIENT_VERSION) > 4: + CLIENT_VERSION = CLIENT_VERSION[:4] CONFIG_DIR = xdg.BaseDirectory.save_config_path('deluge') # the necessary substitutions are made at installation time diff --git a/src/core.py b/src/core.py index 40a7d3016..6cb34ed0c 100644 --- a/src/core.py +++ b/src/core.py @@ -188,7 +188,7 @@ class Manager: InvalidTorrentError) # Start up the core - assert(len(version) == 5) + assert(len(version) == 4) deluge_core.init(client_ID, int(version[0]), int(version[1]),