添加了日志器

This commit is contained in:
MarkusJoe
2022-02-16 13:10:46 +08:00
parent d80d4358ad
commit 464f2526f9
4 files changed
+133

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/2/16
# @File Name: findrootdir.py
import os
class Checkout:
def __init__(self, path: str):
self.path = path.split('/')[:-1]
def checkout_path(self, path: str):
if os.path.exists(f'{path}/utils'):
return True
else:
return False
def run(self):
for i in range(len(self.path)):
current_path = '/'.join('/'.join(self.path).split('/')[:-i])
if self.checkout_path(current_path):
return current_path