All Santiago() arguments are optional.

Renamed SimpleSantiago to Santiago.
This commit is contained in:
Nick Daly 2012-05-10 07:22:45 -05:00
parent b0f0f353db
commit 3ffbe02cb6

View File

@ -95,14 +95,15 @@ def load_data(server, item):
return eval(infile.read()) return eval(infile.read())
class SimpleSantiago(object): class Santiago(object):
"""This Santiago is a less extensible Santiago. """This Santiago is a less extensible Santiago.
The client and server are unified, and it has hardcoded support for The client and server are unified, and it has hardcoded support for
protocols. protocols.
""" """
def __init__(self, listeners, senders, hosting, consuming, me): def __init__(self, listeners = None, senders = None,
hosting = None, consuming = None, me = 0):
"""Create a Santiago with the specified parameters. """Create a Santiago with the specified parameters.
listeners and senders are both protocol-specific dictionaries containing listeners and senders are both protocol-specific dictionaries containing
@ -132,8 +133,10 @@ class SimpleSantiago(object):
self.me = me self.me = me
self.gpg = gnupg.GPG(use_agent = True) self.gpg = gnupg.GPG(use_agent = True)
self.listeners = self._create_connectors(listeners, "Listener") if listeners:
self.senders = self._create_connectors(senders, "Sender") self.listeners = self._create_connectors(listeners, "Listener")
if senders:
self.senders = self._create_connectors(senders, "Sender")
def _create_connectors(self, settings, connector): def _create_connectors(self, settings, connector):
"""Iterates through each protocol given, creating connectors for all. """Iterates through each protocol given, creating connectors for all.