From 7a2822a07df6c91c60decb51bdf6e4250e2a8116 Mon Sep 17 00:00:00 2001 From: banbooboo <1798736436@qq.com> Date: Wed, 30 Jun 2021 11:36:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=E5=8D=87=E7=BA=A7Werkzeug=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=B8=BA0.15.5=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=8A=A5=E9=94=99TypeError:=20required=20field=20?= =?UTF-8?q?=E2=80=9Ctype=5Fignores=E2=80=9C=20missing=20from=20Module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 862755e8..ec046cb4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,5 +6,5 @@ requests==2.20.0 pytest==3.0.6 pip==9.0.1 phply==1.0.0 -Werkzeug==0.15.3 +Werkzeug==0.15.5 ConcurrentLogHandler==0.9.1 From 099854847dc3a696d54289d044d8599d943c7883 Mon Sep 17 00:00:00 2001 From: banbooboo <1798736436@qq.com> Date: Wed, 30 Jun 2021 11:39:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E8=A7=A3=E5=86=B3python3.8=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=8A=A5clock=E5=87=BD=E6=95=B0=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cobra/pickup.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cobra/pickup.py b/cobra/pickup.py index 2396f2ff..9d9862c2 100644 --- a/cobra/pickup.py +++ b/cobra/pickup.py @@ -176,7 +176,13 @@ def __init__(self, absolute_path): """ def collect_files(self): - t1 = time.clock() + + version = sys.version + + if version[:3] == '3.7': + t1 = time.clock() + else: + t1 = time.perf_counter() self.files(self.absolute_path) self.result['no_extension'] = {'count': 0, 'list': []} for extension, values in self.type_nums.items(): @@ -197,7 +203,10 @@ def collect_files(self): self.result['no_extension']['list'].append(f) if self.result['no_extension']['count'] == 0: del self.result['no_extension'] - t2 = time.clock() + if version[:3] == "3.7": + t2 = time.clock() + else: + t2 = time.perf_counter() # reverse list count self.result = sorted(self.result.items(), key=lambda t: t[0], reverse=False) return self.result, self.file_sum, t2 - t1 From 81ec4c8bff880260914eefe8be982037aa255be5 Mon Sep 17 00:00:00 2001 From: banbooboo <1798736436@qq.com> Date: Wed, 30 Jun 2021 14:01:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E2=80=98feat:=E6=B7=BB=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95=EF=BC=8C=E6=B5=8B=E8=AF=95pickup?= =?UTF-8?q?=E7=9A=84collect=5Ffiles=E5=87=BD=E6=95=B0=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_pickup.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test_pickup.py diff --git a/tests/test_pickup.py b/tests/test_pickup.py new file mode 100644 index 00000000..b35b72be --- /dev/null +++ b/tests/test_pickup.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +""" + tests.pickup + ~~~~~~~~~~~~ + + Tests cobra.pickup + + :author: banbooboo <1798736436@qq.com> + :homepage: https://github.com/WhaleShark-Team/cobra + :license: MIT, see LICENSE for more details. + :copyright: Copyright (c) 2018 Feei. All rights reserved +""" + +from cobra.pickup import Directory +import os + +def test_vulnerabilities(): + + + dt =Directory(os.path.dirname(__file__)+"/vulnerabilities") + + assert dt.collect_files() \ No newline at end of file