Skip to content

Commit

Permalink
Refactor and address feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
  • Loading branch information
AyanSinhaMahapatra committed Jul 11, 2023
1 parent f117a76 commit 4456975
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/packagedcode/jar_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ def parse_scm_connection(scm_connection):


def get_datasource_id(package_type):
"""
Get the corresponding `datasource_id` for the given
`package_type`. This is a seperate function to avoid
cyclic imports.
"""
from packagedcode.maven import JavaJarManifestHandler
from packagedcode.maven import JavaOSGiManifestHandler

Expand All @@ -388,6 +393,7 @@ def get_datasource_id(package_type):
elif package_type == 'osgi':
return JavaOSGiManifestHandler.datasource_id


def is_id(s):
"""
Return True if `s` is some kind of id.
Expand Down
6 changes: 3 additions & 3 deletions src/packagedcode/maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,11 +1308,11 @@ def get_license_detections_for_extracted_license_statement(

for license_entry in new_extracted_license:
license_entry.pop("distribution")
if not license_entry.get("name", None):
if not license_entry.get("name"):
license_entry.pop("name")
if not license_entry.get("url", None):
if not license_entry.get("url"):
license_entry.pop("url")
if not license_entry.get("comments", None):
if not license_entry.get("comments"):
license_entry.pop("comments")

extracted_license_statement = saneyaml.dump(new_extracted_license)
Expand Down

0 comments on commit 4456975

Please sign in to comment.