Added has copyright and has license attribute to delta objects - #141
Added has copyright and has license attribute to delta objects#141pratik0316 wants to merge 2 commits into
Conversation
Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com>
fbae501 to
f71958e
Compare
|
@MaJuRG kindly review this |
| self.has_license = False | ||
| self.has_copyright = False |
There was a problem hiding this comment.
Why do we need these again?
There was a problem hiding this comment.
@MaJuRG I provided it as attributes of every delta objects,as we can just check these booleans for determining weather the respective deltas has a license or copyright(either new or old file)
Depending on these booleans we can actually use the license Expression Library
| def add_license(self) : | ||
| self.has_license = True | ||
|
|
||
| def add_copyright(self): | ||
| self.has_copyright = True |
There was a problem hiding this comment.
Do we really need separate functions to simply change a field value?
There was a problem hiding this comment.
@MaJuRG ,no actually it can be modified a bit and made to change the values in place,But I thaught creating a function for it wold be a better approach to it.
There was a problem hiding this comment.
Yes. if all the function does is change a value, there is no need for it. We can add a function later if there is more complex operations to be done.
Also I question the need for these field anyway. Is there an issue regarding this or...?
There was a problem hiding this comment.
Yes I think the issue of #109 is meant for it i.g
There was a problem hiding this comment.
Ok then these fields are fine.
Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com>
fe03d95 to
f4bb26e
Compare
|
Closing due to stagnation. |
In this PR I added a the option to add the attribute has_license and has_copyright to the delta objects.
When either of the new file of the old file has a copyright or an license this attributes will be set to true,by default it is False
`
class Delta(object):
"""
A tuple reflecting a comparison of two files -- each of which is a File
object -- and the 'factors' (e.g., 'added', 'modified' etc.) and related
'score' that characterize that comparison.
"""
def init(self, score=0, new_file=None, old_file=None):
self.new_file = new_file if new_file else None
self.old_file = old_file if old_file else None
self.has_license = False
self.has_copyright = False
self.factors = []
self.score = score
self.status = ''
`
This PR is meant to solve issue of #109