From 7265682a4d57d88956cb54f98f7a470465bbf417 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 18 Aug 2014 00:52:24 +0200 Subject: cleanup semicolons, whitespace and mutable default arguments --- sleekxmpp/plugins/xep_0323/timerreset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sleekxmpp/plugins/xep_0323/timerreset.py') diff --git a/sleekxmpp/plugins/xep_0323/timerreset.py b/sleekxmpp/plugins/xep_0323/timerreset.py index 578f1efe..f36d95e5 100644 --- a/sleekxmpp/plugins/xep_0323/timerreset.py +++ b/sleekxmpp/plugins/xep_0323/timerreset.py @@ -23,7 +23,7 @@ class _TimerReset(Thread): t.cancel() # stop the timer's action if it's still waiting """ - def __init__(self, interval, function, args=[], kwargs={}): + def __init__(self, interval, function, *args, **kwargs): Thread.__init__(self) self.interval = interval self.function = function -- cgit v1.2.3 From 3dd379cdf12d885e26f8ec26c54879a95d5f0b84 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 18 Aug 2014 15:15:14 +0200 Subject: Revert "cleanup semicolons, whitespace and mutable default arguments" This reverts commit 7265682a4d57d88956cb54f98f7a470465bbf417. --- sleekxmpp/plugins/xep_0323/timerreset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sleekxmpp/plugins/xep_0323/timerreset.py') diff --git a/sleekxmpp/plugins/xep_0323/timerreset.py b/sleekxmpp/plugins/xep_0323/timerreset.py index f36d95e5..578f1efe 100644 --- a/sleekxmpp/plugins/xep_0323/timerreset.py +++ b/sleekxmpp/plugins/xep_0323/timerreset.py @@ -23,7 +23,7 @@ class _TimerReset(Thread): t.cancel() # stop the timer's action if it's still waiting """ - def __init__(self, interval, function, *args, **kwargs): + def __init__(self, interval, function, args=[], kwargs={}): Thread.__init__(self) self.interval = interval self.function = function -- cgit v1.2.3 From afc939708ff71e168f9204f1eab8823b7dc9f875 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Mon, 18 Aug 2014 00:52:24 +0200 Subject: cleanup semicolons, whitespace and mutable default arguments --- sleekxmpp/plugins/xep_0323/timerreset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sleekxmpp/plugins/xep_0323/timerreset.py') diff --git a/sleekxmpp/plugins/xep_0323/timerreset.py b/sleekxmpp/plugins/xep_0323/timerreset.py index 578f1efe..f36d95e5 100644 --- a/sleekxmpp/plugins/xep_0323/timerreset.py +++ b/sleekxmpp/plugins/xep_0323/timerreset.py @@ -23,7 +23,7 @@ class _TimerReset(Thread): t.cancel() # stop the timer's action if it's still waiting """ - def __init__(self, interval, function, args=[], kwargs={}): + def __init__(self, interval, function, *args, **kwargs): Thread.__init__(self) self.interval = interval self.function = function -- cgit v1.2.3 From 073e85381a86069e931369bb5353cab2a2e3682d Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 23 Aug 2014 14:25:35 +0200 Subject: fix args, kwargs which were broken with #310. this is essentially the same but working --- sleekxmpp/plugins/xep_0323/timerreset.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sleekxmpp/plugins/xep_0323/timerreset.py') diff --git a/sleekxmpp/plugins/xep_0323/timerreset.py b/sleekxmpp/plugins/xep_0323/timerreset.py index f36d95e5..398b47c1 100644 --- a/sleekxmpp/plugins/xep_0323/timerreset.py +++ b/sleekxmpp/plugins/xep_0323/timerreset.py @@ -23,7 +23,12 @@ class _TimerReset(Thread): t.cancel() # stop the timer's action if it's still waiting """ - def __init__(self, interval, function, *args, **kwargs): + def __init__(self, interval, function, args=None, kwargs=None): + if not kwargs: + kwargs = {} + if not args: + args = [] + Thread.__init__(self) self.interval = interval self.function = function -- cgit v1.2.3