Skip to content
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

Conversation

Pratikrocks
Copy link
Collaborator

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 = ''

def add_license(self) :
    self.has_license = True

def add_copyright(self):
    self.has_copyright = True    

`

This PR is meant to solve issue of #109

@Pratikrocks Pratikrocks force-pushed the adding_HasLicense_HasCopyright branch from fbae501 to f71958e Compare March 17, 2020 18:04
@Pratikrocks
Copy link
Collaborator Author

@MaJuRG kindly review this

Comment on lines +286 to +287
self.has_license = False
self.has_copyright = False
Copy link
Contributor

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?

Copy link
Collaborator Author

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

Comment on lines 292 to 296
def add_license(self) :
self.has_license = True

def add_copyright(self):
self.has_copyright = True
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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?

Copy link
Contributor

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...?

Copy link
Collaborator Author

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

Copy link
Contributor

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.

@Pratikrocks
Copy link
Collaborator Author

@MaJuRG do I need to make any changes further in this , as I think it suffices the requirements of the issues #109

@Pratikrocks Pratikrocks force-pushed the adding_HasLicense_HasCopyright branch from fe03d95 to f4bb26e Compare April 1, 2020 18:32
@Pratikrocks Pratikrocks requested a review from steven-esser April 2, 2020 16:21
@steven-esser
Copy link
Contributor

Closing due to stagnation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants