tables.py 文件源码

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

项目:YoutubeTV 作者: dude56987 项目源码 文件源码
def deleteValue(self,name):
        '''
        Delete a value with name name.
        '''
        # clean up names to avoid stupid
        debug.add('deleting value ',name)
        # figure out the path to the named value file
        if name in self.names:
            filePath=self.namePaths[name]
            # remove the metadata entry
            del self.namePaths[name]
            # write changes to database metadata file
            writeFile(pathJoin(self.path,'names.table'),pickle(self.namePaths))
            # update the length and names attributes
            self.names=self.namePaths.keys()
            self.length=len(self.names)
        else:
            return False
        if pathExists(filePath):
            # remove the file accocated with the value
            removeFile(filePath)
            return True
        else:
            return False
################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号