traildb.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:traildb-python 作者: traildb 项目源码 文件源码
def add(self, uuid, tstamp, values):
        """Add an event in TrailDB.

        uuid -- UUID of this event.
        tstamp -- Timestamp of this event (datetime or integer).
        values -- value of each field.
        """
        if isinstance(tstamp, datetime):
            tstamp = int(time.mktime(tstamp.timetuple()))
        n = len(self.ofields)
        value_array = (c_char_p * n)(*values)
        value_lengths = (c_uint64 * n)(*[len(v) for v in values])
        f = lib.tdb_cons_add(self._cons, uuid_raw(uuid), tstamp, value_array,
                             value_lengths)
        if f:
            raise TrailDBError("Too many values: %s" % values[f])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号