Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

修改底层grep和find #539

Closed
wants to merge 38 commits into from
Closed

修改底层grep和find #539

wants to merge 38 commits into from

Conversation

LoRexxar
Copy link

@LoRexxar LoRexxar commented Sep 5, 2017

修改底层grep和find,windows支持...部分asl bug

@FeeiCN
Copy link
Owner

FeeiCN commented Sep 5, 2017

@LoRexxar 感谢,晚点我测试下

logs/

# tmp
tmp/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tmp目录不建议放在应用本地

Copy link
Author

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
Copy link
Owner

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)
Copy link
Owner

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()
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同引入

@@ -0,0 +1,472 @@

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parsetab.py不应该提交上来

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants