Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion atarashi/libs/commentPreprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
args = None

def licenseComment(data):
match_list = ['source', 'free', 'under','use', 'copyright', 'grant', 'software', 'license','licence', 'agreement', 'distribute', 'redistribution', 'liability', 'rights', 'reserved', 'general', 'public', 'modify', 'modified', 'modification', 'permission','permitted' 'granted', 'distributed', 'notice', 'distribution', 'terms', 'freely', 'licensed', 'merchantibility','redistributed', 'see', 'read', '(c)', 'copying', 'legal', 'licensing', 'spdx']
match_list = ['source', 'free', 'under', 'use', 'copyright', 'grant', 'software', 'license', 'licence', 'agreement', 'distribute', 'redistribution', 'liability', 'rights', 'reserved', 'general', 'public', 'modify', 'modified', 'modification', 'permission', 'permitted', 'granted', 'distributed', 'notice', 'distribution', 'terms', 'freely', 'licensed', 'merchantibility', 'merchantability', 'redistributed', 'see', 'read', '(c)', 'copying', 'legal', 'licensing', 'spdx']

MLmapCount, CSLmapCount, SLmapCount = [], [], []
comment = ""
Expand Down
10 changes: 5 additions & 5 deletions atarashi/license/licenseDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def download_license(threads=os.cpu_count(), force=False):
licenses = jsonData.get('licenses')

version = jsonData.get('licenseListVersion').replace(".", "_")
releaseDate = jsonData.get('releaseDate')
releaseDate = jsonData.get('releaseDate').replace(':','-').replace('T','_').replace('Z','')
if licenses is not None:
fileName = releaseDate + '_' + version + '.csv'
directory = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -140,12 +140,12 @@ def fetch_license(license):
nextUrl = "https://spdx.org/licenses/{0}.json".format(licenseDict['shortname'])
licenseData = LicenseDownloader._download_json(nextUrl)
licenseDict['text'] = licenseData.get('licenseText')
licenseDict['url'] = licenseData.get('seeAlso')
licenseDict['url'] = ', '.join(licenseData.get('seeAlso', [])) if isinstance(licenseData.get('seeAlso'), list) else licenseData.get('seeAlso', '')
licenseDict['license_header'] = licenseData.get('standardLicenseHeader', '')
if 'There is no standard license header for the license' in licenseDict['license_header']:
licenseDict['license_header'] = ''

return pd.DataFrame(licenseDict, columns=csvColumns)
return pd.DataFrame([licenseDict], columns=csvColumns)

@staticmethod
def fetch_exceptional_license(license):
Expand All @@ -161,11 +161,11 @@ def fetch_exceptional_license(license):
nextUrl = "https://spdx.org/licenses/{0}.json".format(licenseDict['shortname'])
licenseData = LicenseDownloader._download_json(nextUrl)
licenseDict['text'] = licenseData.get('licenseExceptionText')
licenseDict['url'] = licenseData.get('seeAlso')
licenseDict['url'] = ', '.join(licenseData.get('seeAlso', [])) if isinstance(licenseData.get('seeAlso'), list) else licenseData.get('seeAlso', '')
licenseDict['license_header'] = licenseData.get('standardLicenseHeader', '')
if 'There is no standard license header for the license' in licenseDict['license_header']:
licenseDict['license_header'] = ''
return pd.DataFrame(licenseDict, columns=csvColumns)
return pd.DataFrame([licenseDict], columns=csvColumns)


if __name__ == "__main__":
Expand Down