-
Notifications
You must be signed in to change notification settings - Fork 953
Conversation
new fork
@LoRexxar 感谢,晚点我测试下 |
logs/ | ||
|
||
# tmp | ||
tmp/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmp目录不建议放在应用本地
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmp目录放在应用本地是为了兼容性
@@ -14,10 +14,8 @@ | |||
import os | |||
import re | |||
import json | |||
import fcntl | |||
import portalocker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
引入的新包应加入req.txt中
@@ -44,34 +42,29 @@ def init_list(self, data=None): | |||
if not os.path.exists(file_path): | |||
if isinstance(data, list): | |||
with open(file_path, 'w') as f: | |||
fcntl.flock(f, fcntl.LOCK_EX) | |||
portalocker.lock(f, portalocker.LOCK_EX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改为portalocker后,应编写对应的测试用例测试下linux下的兼容性
cobra/engine.py
Outdated
raise | ||
return SingleRule(target_directory, single_rule, files).process() | ||
except Exception as e: | ||
traceback.print_exc() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
异常打印后建议向上层抛出,避免因为某一个规则扫描失败导致整个任务失败
cobra/file.py
Outdated
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
pickup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处名字应同文件名
import logging | ||
from logging import handlers | ||
import colorlog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同引入
@@ -0,0 +1,472 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parsetab.py不应该提交上来
修改底层grep和find,windows支持...部分asl bug