Skip to content

Commit

Permalink
fixed #190
Browse files Browse the repository at this point in the history
  • Loading branch information
LoRexxar committed Oct 25, 2023
1 parent 256dead commit dbcf3e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions core/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def find_java_mvn(self, file_path):
root = tree.getroot()
childs = root.findall('.//%sdependency' % pom_ns)
for child in childs:
group_id = child.getchildren()[0].text
artifact_id = child.getchildren()[1].text
if len(child.getchildren()) > 2:
version = child.getchildren()[2].text
group_id = list(child)[0].text
artifact_id = list(child)[1].text
if len(list(child)) > 2:
version = list(child)[2].text
else:
version = 'The latest version'
module_ = artifact_id
Expand Down
16 changes: 8 additions & 8 deletions core/vendors.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ def check_vendor(self):
default_version = "unknown"
project_version = "unknown"
for parent in parents:
project_groupid = parent.getchildren()[0].text
project_artifactId = parent.getchildren()[1].text
project_version = parent.getchildren()[2].text
project_groupid = list(parent)[0].text
project_artifactId = list(parent)[1].text
project_version = list(parent)[2].text

# project version 格式检查
var_reg = "\${([\w\.\_-]+)}"
Expand Down Expand Up @@ -400,7 +400,7 @@ def check_vendor(self):
base_tags = root.findall(java_base_xpath_reg)

if base_tags:
btags = base_tags[0].getchildren()
btags = list(base_tags[0])
for btag in btags:
self.java_temp_vendor_list[btag.tag.replace("{%s}" % pom_ns, "")] = btag.text

Expand All @@ -418,10 +418,10 @@ def check_vendor(self):

childs = root.findall(xpath_reg)
for child in childs:
group_id = child.getchildren()[0].text
artifact_id = child.getchildren()[1].text
if len(child.getchildren()) > 2 and "version" in child.getchildren()[2].tag:
version = child.getchildren()[2].text
group_id = list(child)[0].text
artifact_id = list(child)[1].text
if len(list(child)) > 2 and "version" in list(child)[2].tag:
version = list(child)[2].text
else:
version = default_version

Expand Down

0 comments on commit dbcf3e5

Please sign in to comment.