[Pkg-owncloud-commits] [python-owncloud] 26/33: get rid of useuploadlimit and downloadlimit
Sandro Knauß
hefee-guest at moszumanska.debian.org
Fri Nov 22 01:49:48 UTC 2013
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch upstream
in repository python-owncloud.
commit 8acc7fdc7ad8ccf7ac32b3be5d4224abf1e4a654
Author: hefee <hefee at netzguerilla.net>
Date: Sat Nov 16 19:10:48 2013 +0100
get rid of useuploadlimit and downloadlimit
---
csync/csync.py | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/csync/csync.py b/csync/csync.py
index bfe0f67..d0b1645 100755
--- a/csync/csync.py
+++ b/csync/csync.py
@@ -150,16 +150,17 @@ class ownCloudSync():
error(self.ctx, 'csync_init', r)
if DEBUG:
print 'Initialization done.'
- if self.cfg.has_key('usedownloadlimit') or self.cfg.has_key('useuploadlimit'):
+ if (self.cfg.has_key('downloadlimit') and self.cfg['downloadlimit']) or \
+ (self.cfg.has_key('uploadlimit') and self.cfg['uploadlimit']):
if csynclib.csync_version(CSYNC_VERSION_INT(0,81,0)) is None:
print 'Bandwidth throttling requires ocsync version >= 0.81.0, ignoring limits'
else:
- if self.cfg.has_key('usedownloadlimit') and self.cfg['usedownloadlimit'] and self.cfg.has_key('downloadlimit'):
+ if self.cfg.has_key('downloadlimit') and self.cfg['downloadlimit']:
dlimit = ctypes.c_int(int(self.cfg['downloadlimit']) * 1000)
if DEBUG:
print 'Download limit: ', dlimit.value
csynclib.csync_set_module_property(self.ctx, 'bandwidth_limit_download', ctypes.pointer(dlimit))
- if self.cfg.has_key('useuploadlimit') and self.cfg['useuploadlimit'] and self.cfg.has_key('uploadlimit'):
+ if self.cfg.has_key('uploadlimit') and self.cfg['uploadlimit']:
ulimit = ctypes.c_int(int(self.cfg['uploadlimit']) * 1000)
if DEBUG:
print 'Upload limit: ', ulimit.value
@@ -263,6 +264,10 @@ def getConfig(parser):
else:
if c.has_section('BWLimit'):
cfg = dict(c.items('BWLimit') + c.items('ownCloud'))
+ if not cfg['useuploadlimit']:
+ cfg['uploadlimit'] = None
+ if not cfg['usedownloadlimit']:
+ cfg['downloadlimit'] = None
else:
if DEBUG:
print 'config file has no section [BWLimit]'
@@ -363,13 +368,9 @@ Password options:
parser.add_argument('--url', nargs='?', default = None,
help = "URL to sync to.")
if csynclib.csync_version(CSYNC_VERSION_INT(0,81,0)) is not None:
- parser.add_argument('--usedownloadlimit', action = 'store_true', default = None,
- help = "Use download limit.")
- parser.add_argument('--useuploadlimit', action = 'store_true', default = None,
- help = "Use upload limit.")
- parser.add_argument('--downloadlimit', nargs = '?', default = 0,
+ parser.add_argument('--downloadlimit', nargs = '?', default = None,
help = "Download limit in KB/s.")
- parser.add_argument('--uploadlimit', nargs = '?', default = 0,
+ parser.add_argument('--uploadlimit', nargs = '?', default = None,
help = "Upload limit in KB/s.")
if keyring:
parser.add_argument('--use-keyring', action = 'store_true', default = False,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/python-owncloud.git
More information about the Pkg-owncloud-commits
mailing list