amt_import_solver.py 文件源码

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

项目:AutoMergeTool 作者: xgouchet 项目源码 文件源码
def __write_merged_imports(self, file: TextIOWrapper, imports: list):
        """
        Sorts and write the given imports to the file, adding a blank line between
        each group
        f -- the file object (needs write permission)
        imports -- the list of imports
        """
        sorted_imports = self.sort_imports(imports)
        previous_group = -1
        for imp in sorted_imports:
            group = self.get_import_group(imp)
            if not (group == previous_group):
                if not (previous_group == -1):
                    file.write("\n")
                previous_group = group
            file.write(imp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号