Skip to content

Commit 2690500

Browse files
committed
Add comment, docstring and format code
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent f1b8085 commit 2690500

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/licensedcode/models.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ class License(object):
107107

108108
# if this is a license exception, the license key this exception applies to
109109
is_exception = __attrib(default=False)
110-
111-
#if the license falls in unknwon category then this flag should be set to true
110+
111+
# if the license falls in unknwon category then this flag should be set to true
112112
is_unknown = __attrib(default=False)
113113
# SPDX key for SPDX licenses
114114
spdx_license_key = __attrib(default=None)
@@ -343,7 +343,7 @@ def validate(licenses, verbose=False, no_dupe_urls=False):
343343
)
344344
if not lic.owner:
345345
error('No owner')
346-
346+
347347
if lic.is_unknown:
348348
if not "unknown" in lic.key:
349349
error('is_unknown should not be true')
@@ -868,9 +868,14 @@ def setup(self):
868868

869869
self.license_expression = expression.render()
870870
self.license_expression_object = expression
871-
871+
872872
@property
873873
def has_unknown(self):
874+
"""
875+
Return True if any of this rule licenses is an unknown license.
876+
"""
877+
# TODO: consider using the license_expression_object and the is_unknown
878+
# license flag instead
874879
return self.license_expression and 'unknown' in self.license_expression
875880

876881
def validate(self, licensing=None):

0 commit comments

Comments
 (0)