sqlbackend.py 文件源码

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

项目:tm-librarian 作者: FabricAttachedMemory 项目源码 文件源码
def create_shelf(self, shelf):
        """ Create one new shelf in the database.
            Input---
              shelf_data - list of shelf data to insert
            Output---
              shelf_data or error message
        """
        shelf.id = None     # DB engine will autochoose next id
        if not shelf.mode:
            shelf.mode = stat.S_IFREG + 0o666
        tmp = int(time.time())
        shelf.ctime = shelf.mtime = tmp
        if shelf.parent_id == 0:
            shelf.parent_id = 2  # is now a default for if it given to go in root
        shelf.id = self._cur.INSERT('shelves', shelf.tuple())
        return shelf
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号