VirtualMailManager/MailLocation.py
changeset 122 30abf0abf8f8
parent 102 485d3f7d6981
child 133 2d5c4745efec
equal deleted inserted replaced
121:7ccc05774118 122:30abf0abf8f8
    12 from Exceptions import VMMMailLocationException as MLE
    12 from Exceptions import VMMMailLocationException as MLE
    13 import constants.ERROR as ERR
    13 import constants.ERROR as ERR
    14 
    14 
    15 RE_MAILLOCATION = """^\w{1,20}$"""
    15 RE_MAILLOCATION = """^\w{1,20}$"""
    16 
    16 
    17 class MailLocation:
    17 class MailLocation(object):
    18     """A wrapper class thats provide access to the maillocation table"""
    18     """A wrapper class thats provide access to the maillocation table"""
       
    19     __slots__ = ('__id', '__maillocation', '_dbh')
    19     def __init__(self, dbh, mid=None, maillocation=None):
    20     def __init__(self, dbh, mid=None, maillocation=None):
    20         """Creates a new MailLocation instance.
    21         """Creates a new MailLocation instance.
    21 
    22 
    22         Either mid or maillocation must be specified.
    23         Either mid or maillocation must be specified.
    23         
    24 
    24         Keyword arguments:
    25         Keyword arguments:
    25         dbh -- a pyPgSQL.PgSQL.connection
    26         dbh -- a pyPgSQL.PgSQL.connection
    26         mid -- the id of a maillocation (long)
    27         mid -- the id of a maillocation (long)
    27         maillocation -- the value of the maillocation (str)
    28         maillocation -- the value of the maillocation (str)
    28         """
    29         """