-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added has copyright and has license attribute to delta objects #141
Added has copyright and has license attribute to delta objects #141
Conversation
Signed-off-by: Pratikrocks <[email protected]>
fbae501
to
f71958e
Compare
@MaJuRG kindly review this |
self.has_license = False | ||
self.has_copyright = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need these again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
src/deltacode/__init__.py
Outdated
def add_license(self) : | ||
self.has_license = True | ||
|
||
def add_copyright(self): | ||
self.has_copyright = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need separate functions to simply change a field value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MaJuRG Should I change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think the issue of #109 is meant for it i.g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok then these fields are fine.
Signed-off-by: Pratikrocks <[email protected]>
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