'Sets all the easy attributes appropriately according to the
type.
This function is used to set all the trivial attributes
provided by objdict, the dictionary that specifies the types
of each attribute in each tko class.
:param
tko_obj: the original object that has the data being copied.
pb_obj: the new pb object that is being copied into.
objdict: specifies the type of each attribute in the class we
are working with.'

def set_trivial_attr(self, tko_obj, pb_obj, objdict):

    for (attr, attr_type) in objdict.iteritems():
        if (attr_type == datetime):
            t = getattr(tko_obj, attr)
            if (not t):
                self.set_attr_safely(pb_obj, attr, t, int)
            else:
                t = (mktime(t.timetuple()) + (1e-06 * t.microsecond))
                setattr(pb_obj, attr, long((t * 1000)))
        else:
            value = getattr(tko_obj, attr)
            self.set_attr_safely(pb_obj, attr, value, attr_type)
