def __init__(self, user): BiteObject.__init__(self) match = re.match(r'([^<]*)<([^>]*)>', user) if match is None: raise Exception("Invalid format of user: %r" % user) name, email = match.groups() self.name = name.strip() self.email = email.strip()
def __init__(self, date): BiteObject.__init__(self) if not date: self.date = time.gmtime() elif isinstance(date, basestring): self.date = time.strptime(date) else: raise Exception("Could not create date from %r" % date)
def __init__(self, user, date, title, fields): """ :param fields: is a dictionary with field_name=update_object """ BiteObject.__init__(self) self.user = user self.date = date self.title = title for field, value in fields.iteritems(): assert isinstance(value, basestring), "%r must be obj_id string" % field self.fields = fields
def __init__(self, user, date, message): BiteObject.__init__(self) self.user = user self.date = date assert isinstance(message, basestring), "message must be string" self.message = message
def __init__(self, user, date, fields): BiteObject.__init__(self) self.user = user self.date = date self.fields = fields