dbrestore.py 文件源码

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

项目:tools 作者: apertoso 项目源码 文件源码
def check_module_timestamps(self, module_path=False, mtime=0):
        extensions = ('.py', '.xml', '.csv')
        "Walk the tree of a module to find the last updated file"
        for file in os.listdir(module_path):
            file_path = os.path.join(module_path, file)
            statinfo = os.stat(file_path)
            file_mtime = 0
            if stat.S_ISDIR(statinfo.st_mode):
                file_mtime = self.check_module_timestamps(file_path)
            elif stat.S_ISREG(statinfo.st_mode):
                if any(file.endswith(ex) for ex in extensions):
                    file_mtime = statinfo.st_mtime
            else:
                raise Exception(
                    'Unknown file mode in module path %s' % file_path)
            if file_mtime > mtime:
                mtime = file_mtime
        return mtime
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号