Archived
添加了日志器
This commit is contained in:
4 files changed
+133
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user