Skip to content

Commit 144dfa2

Browse files
committed
Avoid possible name confusion for ListType
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent c29cb35 commit 144dfa2

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/packagedcode/models.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@
123123
"""
124124

125125

126-
class ListType(ListType):
126+
class BaseListType(ListType):
127127
"""
128128
ListType with a default of an empty list.
129129
"""
130130
def __init__(self, field, **kwargs):
131-
super(ListType, self).__init__(field=field, default=[], **kwargs)
131+
super(BaseListType, self).__init__(field=field, default=[], **kwargs)
132132

133133

134134
PackageId = namedtuple('PackageId', 'type name version')
@@ -361,7 +361,7 @@ class Repository(BaseModel):
361361
label='public repository',
362362
description='A flag set to true if this is a public repository.')
363363

364-
mirror_urls = ListType(URIType)
364+
mirror_urls = BaseListType(URIType)
365365
mirror_urls.metadata = dict(
366366
label='repository mirror urls',
367367
description='A list of URLs for mirrors of this repository.')
@@ -502,7 +502,7 @@ def resolve(self):
502502
# A normalized list of version constraints for this dep. This is package-
503503
# independent and should be a normalized data structure describing all the
504504
# different version range constraints
505-
# normalized_version_constraints = ListType(StringType())
505+
# normalized_version_constraints = BaseListType(StringType())
506506
raise NotImplementedError()
507507

508508

@@ -644,42 +644,42 @@ class Package(BaseModel):
644644
description='Release date of the package')
645645

646646
# FIXME: this would be simpler as a list where each Party has also a type
647-
authors = ListType(ModelType(Party))
647+
authors = BaseListType(ModelType(Party))
648648
authors.metadata = dict(
649649
label='authors',
650650
description='A list of party objects. Note: this model schema will change soon.')
651651

652-
maintainers = ListType(ModelType(Party))
652+
maintainers = BaseListType(ModelType(Party))
653653
maintainers.metadata = dict(
654654
label='maintainers',
655655
description='A list of party objects. Note: this model schema will change soon.')
656656

657-
contributors = ListType(ModelType(Party))
657+
contributors = BaseListType(ModelType(Party))
658658
contributors.metadata = dict(
659659
label='contributors',
660660
description='A list of party objects. Note: this model schema will change soon.')
661661

662-
owners = ListType(ModelType(Party))
662+
owners = BaseListType(ModelType(Party))
663663
owners.metadata = dict(
664664
label='owners',
665665
description='A list of party objects. Note: this model schema will change soon.')
666666

667-
packagers = ListType(ModelType(Party))
667+
packagers = BaseListType(ModelType(Party))
668668
packagers.metadata = dict(
669669
label='owners',
670670
description='A list of party objects. Note: this model schema will change soon.')
671671

672-
distributors = ListType(ModelType(Party))
672+
distributors = BaseListType(ModelType(Party))
673673
distributors.metadata = dict(
674674
label='distributors',
675675
description='A list of party objects. Note: this model schema will change soon.')
676676

677-
vendors = ListType(ModelType(Party))
677+
vendors = BaseListType(ModelType(Party))
678678
vendors.metadata = dict(
679679
label='vendors',
680680
description='A list of party objects. Note: this model schema will change soon.')
681681

682-
keywords = ListType(StringType())
682+
keywords = BaseListType(StringType())
683683
keywords.metadata = dict(
684684
label='keywords',
685685
description='A list of keywords or tags.')
@@ -691,14 +691,14 @@ class Package(BaseModel):
691691
description='URL to a reference documentation for keywords or '
692692
'tags (such as a Pypi or SF.net Trove map)')
693693

694-
metafile_locations = ListType(StringType())
694+
metafile_locations = BaseListType(StringType())
695695
metafile_locations.metadata = dict(
696696
label='metafile locations',
697697
description='A list of metafile locations for this package '
698698
'(such as a package.json, a setup.py). '
699699
'Relative to the package root directory or archive root')
700700

701-
metafile_urls = ListType(URIType())
701+
metafile_urls = BaseListType(URIType())
702702
metafile_urls.metadata = dict(
703703
label='metafile URLs',
704704
description='A list of metafile remote URLs for this package '
@@ -714,7 +714,7 @@ class Package(BaseModel):
714714
label='Notes',
715715
description='Notes, free text about this package')
716716

717-
download_urls = ListType(URIType())
717+
download_urls = BaseListType(URIType())
718718
download_urls.metadata = dict(
719719
label='Download URLs',
720720
description='A list of direct download URLs, possibly in SPDX VCS url form. '
@@ -732,7 +732,7 @@ class Package(BaseModel):
732732
label='bug tracking URL',
733733
description='URL to the issue or bug tracker for this package')
734734

735-
support_contacts = ListType(StringType())
735+
support_contacts = BaseListType(StringType())
736736
support_contacts.metadata = dict(
737737
label='Support contacts',
738738
description='A list of strings (such as email, urls, etc) for support contacts')
@@ -765,18 +765,18 @@ class Package(BaseModel):
765765
label='Top level Copyright',
766766
description='a top level copyright often asserted in package metadata')
767767

768-
copyrights = ListType(StringType())
768+
copyrights = BaseListType(StringType())
769769
copyrights.metadata = dict(
770770
label='Copyrights',
771771
description='A list of effective copyrights as detected and eventually summarized')
772772

773-
asserted_licenses = ListType(ModelType(AssertedLicense))
773+
asserted_licenses = BaseListType(ModelType(AssertedLicense))
774774
asserted_licenses.metadata = dict(
775775
label='asserted licenses',
776776
description='A list of asserted license objects representing '
777777
'the asserted licensing information for this package')
778778

779-
legal_file_locations = ListType(StringType())
779+
legal_file_locations = BaseListType(StringType())
780780
legal_file_locations.metadata = dict(
781781
label='legal file locations',
782782
description='A list of paths to legal files '
@@ -788,12 +788,12 @@ class Package(BaseModel):
788788
label='license expression',
789789
description='license expression: either resolved or detected license expression')
790790

791-
license_texts = ListType(StringType())
791+
license_texts = BaseListType(StringType())
792792
license_texts.metadata = dict(
793793
label='license texts',
794794
description='A list of license texts for this package.')
795795

796-
notice_texts = ListType(StringType())
796+
notice_texts = BaseListType(StringType())
797797
license_texts.metadata = dict(
798798
label='notice texts',
799799
description='A list of notice texts for this package.')
@@ -809,7 +809,7 @@ class Package(BaseModel):
809809
'The possible values for dependency grousp are:' + ', '.join(DEPENDENCY_GROUPS)
810810
)
811811

812-
related_packages = ListType(ModelType(RelatedPackage))
812+
related_packages = BaseListType(ModelType(RelatedPackage))
813813
related_packages.metadata = dict(
814814
label='related packages',
815815
description='A list of related_package objects for this package. '

0 commit comments

Comments
 (0)