summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crocoite/controller.py4
-rw-r--r--crocoite/irc.py14
2 files changed, 9 insertions, 9 deletions
diff --git a/crocoite/controller.py b/crocoite/controller.py
index eb8908c..788a131 100644
--- a/crocoite/controller.py
+++ b/crocoite/controller.py
@@ -108,13 +108,13 @@ class SinglePageController:
def __init__ (self, url, logger, \
service, behavior=cbehavior.available, \
- settings=defaultSettings, handler=[]):
+ settings=defaultSettings, handler=None):
self.url = url
self.service = service
self.behavior = behavior
self.settings = settings
self.logger = logger.bind (context=type (self).__name__, url=url)
- self.handler = handler
+ self.handler = handler or []
def processItem (self, item):
for h in self.handler:
diff --git a/crocoite/irc.py b/crocoite/irc.py
index 2e14537..1f06158 100644
--- a/crocoite/irc.py
+++ b/crocoite/irc.py
@@ -124,9 +124,9 @@ class User:
""" IRC user """
__slots__ = ('name', 'modes')
- def __init__ (self, name, modes=set ()):
+ def __init__ (self, name, modes=None):
self.name = name
- self.modes = modes
+ self.modes = modes or set ()
def __eq__ (self, b):
return self.name == b.name
@@ -198,9 +198,9 @@ class ArgparseBot (bottom.Client):
__slots__ = ('channels', 'nick', 'parser', 'users', '_quit')
- def __init__ (self, host, port, ssl, nick, logger, channels=[], loop=None):
+ def __init__ (self, host, port, ssl, nick, logger, channels=None, loop=None):
super().__init__ (host=host, port=port, ssl=ssl, loop=loop)
- self.channels = channels
+ self.channels = channels or []
self.nick = nick
# map channel -> nick -> user
self.users = defaultdict (dict)
@@ -374,14 +374,14 @@ def jobExists (func):
class Chromebot (ArgparseBot):
__slots__ = ('jobs', 'tempdir', 'destdir', 'processLimit', 'blacklist')
- def __init__ (self, host, port, ssl, nick, logger, channels=[],
- tempdir=tempfile.gettempdir(), destdir='.', processLimit=1,
+ def __init__ (self, host, port, ssl, nick, logger, channels=None,
+ tempdir=None, destdir='.', processLimit=1,
blacklist={}, loop=None):
super().__init__ (host=host, port=port, ssl=ssl, nick=nick,
logger=logger, channels=channels, loop=loop)
self.jobs = {}
- self.tempdir = tempdir
+ self.tempdir = tempdir or tempfile.gettempdir()
self.destdir = destdir
self.processLimit = asyncio.Semaphore (processLimit)
self.blacklist = blacklist