Exemple #1
0
    def __init__(self, site):
        """
        Command initialization.

        Parameters:
            site    Site object to add to backend
        """
        BaseCommand.__init__(self)

        if not ISite.providedBy(site):
            raise AttributeError("Invalid site parametee. Should implement ISite")

        self.site = site
Exemple #2
0
    def __init__(self, name, domain):
        """
        Command initialization.

        Parameters:
            name    Host name
            domain  Domain name
        """
        BaseCommand.__init__(self)

        if not self.name_re.match(name):
            raise AttributeError(r"Invalid host name. Should match /^[\w\d_-]+$/")
        if not self.domain_re.match(domain):
            raise AttributeError(r"Invalid domain name. Should match /^[\w\d\._-]+$/")

        self.name = name
        self.domain = domain
Exemple #3
0
    def __init__(self, name, domain):
        """
        Command initialization.

        Parameters:
            name    Host name (may use wilcards characher *)
            domain  Domain name (may use wilcards characher *)
        """
        BaseCommand.__init__(self)

        # Parameters check
        if not self.name_re.match(name):
            raise AttributeError("Invalid host name. Should match /^[\w\d\*_-]+$/")
        if not self.domain_re.match(domain):
            raise AttributeError("Invalid domain name. Should match /^^[\w\d\*\._-]+$/")

        self.name = name
        self.domain = domain
        self.executed = Event()
 def __init__(self):
     """
     Command initialization
     """
     BaseCommand.__init__(self)
     CommandSubject.__init__(self)