Skip to content

Commit 363213d

Browse files
committed
增加Tab2的框架,和Frechet距离框架
1 parent 0f8552e commit 363213d

File tree

5 files changed

+30
-6
lines changed

5 files changed

+30
-6
lines changed

FrechetDistance.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
class FrechetDistance(object):
3+
def __init__(self) -> None:
4+
super().__init__()
5+
6+
def get_frechet_distance(self, repo_name):
7+
return 0

JavaGitMiner.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import jpype
3-
3+
from FrechetDistance import FrechetDistance
44

55
class GitMiner():
66
def __init__(self, jar_path = 'GitMiner-1.0-SNAPSHOT.jar') -> None:
@@ -9,6 +9,11 @@ def __init__(self, jar_path = 'GitMiner-1.0-SNAPSHOT.jar') -> None:
99
self.jar_path = os.path.join(os.path.abspath('.'), jar_path)
1010
# 开启JVM,且指定jar包, 或者.class文件位置
1111
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea", "-Djava.class.path=%s" % self.jar_path)
12+
self.frechet = FrechetDistance()
13+
14+
def get_repo_name_from_url(self,url):
15+
repo_name = ""
16+
return repo_name
1217

1318
def git_clone(self, url):
1419
# 引入java程序中的类.路径应该是项目中的package包路径.类名
@@ -18,6 +23,8 @@ def git_clone(self, url):
1823
# 执行类中的函数了
1924
res = mdg.generateNew(url)
2025
print(res)
26+
repo_name = self.get_repo_name_from_url(url)
27+
self.frechet.get_frechet_distance(repo_name)
2128
return res
2229

2330

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
app.secret_key = os.urandom(12)
1515
git_miner = GitMiner()
1616
repoDB = repoDB_Options()
17-
executor = ThreadPoolExecutor(2)
17+
executor = ThreadPoolExecutor(5)
1818

1919

2020
@app.before_request

repoDB_Options.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def get_repo_base_information(self, repo_name):
6161
]
6262
res['top_ten_frechet'] = source
6363

64+
65+
6466
return res
6567

6668
# 获得带有列名的数据库信息
@@ -251,5 +253,6 @@ def print_format_datas(self, datas):
251253
if __name__ == '__main__':
252254
repoDB = repoDB_Options()
253255
# datas = repoDB.get_FileContributorMatrix("FileContributorMatrix5")
254-
datas = repoDB.get_repo_base_information("a")
256+
# datas = repoDB.get_repo_base_information("a")
257+
datas = repoDB.get_repo_status()
255258
print(datas)

templates/repositories.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@ <h3 class="pb-3 mb-4 font-italic border-bottom">
3535
{# <td>{{ repo.REPOLOCALPATH }}</td>#}
3636
{# <td>{{ repo.CLONETIME }}</td>#}
3737
<td>
38-
<button type="button" class="btn btn-success">
39-
成功 <span class="badge badge-light">1</span>
40-
</button>
38+
{% if repo.CLONESTATUS == 0 %}
39+
<button type="button" class="btn btn-success">
40+
成功 <span class="badge badge-light">1</span>
41+
</button>
42+
{% else %}
43+
<button type="button" class="btn btn-primary">
44+
处理中 <span class="badge badge-light">1</span>
45+
</button>
46+
{% endif %}
47+
4148
</td>
4249
<td><a href="{{ url_for('show_repositories',repo_name =repo.REPONAME) }}">详情</a></td>
4350
</tr>

0 commit comments

Comments
 (0)