@@ -153,6 +153,7 @@ def format_date(date_string):
153153 year = repo_data [constants .CAT_COPYRIGHT ][0 ][constants .PROP_RESULT ].get (constants .PROP_YEAR )
154154 if holder :
155155 codemeta_output [constants .CAT_CODEMETA_COPYRIGHTHOLDER ] = holder
156+
156157 if year :
157158 codemeta_output [constants .CAT_CODEMETA_COPYRIGHTYEAR ] = year
158159 if constants .CAT_DOWNLOAD_URL in repo_data :
@@ -162,7 +163,6 @@ def format_date(date_string):
162163 if constants .CAT_LOGO in repo_data :
163164 codemeta_output [constants .CAT_CODEMETA_LOGO ] = repo_data [constants .CAT_LOGO ][0 ][constants .PROP_RESULT ][constants .PROP_VALUE ]
164165 if constants .CAT_KEYWORDS in repo_data :
165- # codemeta_output[constants.CAT_CODEMETA_KEYWORDS] = repo_data[constants.CAT_KEYWORDS][0][constants.PROP_RESULT][constants.PROP_VALUE]
166166 codemeta_output [constants .CAT_CODEMETA_KEYWORDS ] = []
167167 for key in repo_data [constants .CAT_KEYWORDS ]:
168168 key_value = key [constants .PROP_RESULT ][constants .PROP_VALUE ]
@@ -703,25 +703,26 @@ def parse_contributors(raw):
703703 if name not in seen :
704704
705705 if re .search (constants .REGEXP_LTD_INC , name , re .IGNORECASE ):
706- type_contributor = "Organization"
706+ type_contributor = constants . TYPE_CONTRIBUTOR_ORGANIZATION
707707 else :
708- type_contributor = "Person"
708+ type_contributor = constants . TYPE_CONTRIBUTOR_PERSON
709709
710710 contributor = {
711- "@type" : type_contributor ,
712- "name" : name
711+ constants . PROP_CODEMETA_TYPE : type_contributor ,
712+ constants . PROP_NAME : name
713713 }
714+
714715 if "given_name" in result :
715- contributor ["givenName" ] = result ["given_name" ]
716+ contributor [constants . PROP_CODEMETA_GIVENAME ] = result ["given_name" ]
716717
717718 if "last_name" in result :
718- contributor ["familyName" ] = result ["last_name" ]
719+ contributor [constants . PROP_CODEMETA_FAMILYNAME ] = result ["last_name" ]
719720
720721 if "email" in result :
721- contributor ["email" ] = result ["email" ]
722+ contributor [constants . PROP_EMAIL ] = result ["email" ]
722723
723724 if "identifier" in result :
724- contributor ["@id" ] = result ["identifier" ]
725+ contributor [constants . PROP_CODEMETA_ID ] = result ["identifier" ]
725726
726727 contributors .append (contributor )
727728 seen .add (name )
@@ -741,13 +742,13 @@ def parse_contributors(raw):
741742 continue
742743
743744 if re .search (constants .REGEXP_LTD_INC , line , re .IGNORECASE ):
744- type_contributor = "Organization"
745+ type_contributor = constants . TYPE_CONTRIBUTOR_ORGANIZATION
745746 else :
746- type_contributor = "Person"
747+ type_contributor = constants . TYPE_CONTRIBUTOR_PERSON
747748
748749 contributors .append ({
749- "@type" : type_contributor ,
750- "name" : line
750+ constants . PROP_CODEMETA_TYPE : type_contributor ,
751+ constants . PROP_NAME : line
751752 })
752753
753754 seen .add (line )
0 commit comments