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

Update ClientWrapper.py #1514

Closed
wants to merge 1 commit into from

Conversation

jimruxton
Copy link

Added the comparison to Event class so examples are compatible with python3 :
def lt(self,other):
return self._run_at< other._run_at

Added the comparison to Event class so examples are compatible with python3 :  
 def __lt__(self,other):
    return self._run_at< other._run_at
Copy link
Member

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jimruxton ,

Thanks for this and congratulations on your first pull request!

After looking at what we've done elsewhere, it would actually be good to target this at our 0.10 branch, so would you mind doing the same edit against this link, then do a new Pull Request but select our 0.10 branch on the left and it should work as intended:
https://github.com/OpenLightingProject/ola/blob/0.10/python/ola/ClientWrapper.py

We also run Travis continuous integration which has found a few minor issues with your changes, see them here (I've also commented against the relevant lines and offered suggested fixes):
https://travis-ci.org/OpenLightingProject/ola/jobs/457080510#L1166

@@ -46,6 +46,9 @@ def __init__(self, time_ms, callback):

def __cmp__(self, other):
return cmp(self._run_at, other._run_at)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://travis-ci.org/OpenLightingProject/ola/jobs/457080510#L1166

python/ola/ClientWrapper.py:49:1: W293 blank line contains whitespace

Suggested change

@@ -46,6 +46,9 @@ def __init__(self, time_ms, callback):

def __cmp__(self, other):
return cmp(self._run_at, other._run_at)

def __lt__(self,other):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://travis-ci.org/OpenLightingProject/ola/jobs/457080510#L1167

python/ola/ClientWrapper.py:50:18: E231 missing whitespace after ','

Suggested change
def __lt__(self,other):
def __lt__(self, other):

@@ -46,6 +46,9 @@ def __init__(self, time_ms, callback):

def __cmp__(self, other):
return cmp(self._run_at, other._run_at)

def __lt__(self,other):
return self._run_at< other._run_at
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://travis-ci.org/OpenLightingProject/ola/jobs/457080510#L1168

python/ola/ClientWrapper.py:51:24: E225 missing whitespace around operator

Suggested change
return self._run_at< other._run_at
return self._run_at < other._run_at

@peternewman peternewman added this to the 0.11.0 milestone Nov 20, 2018
@peternewman
Copy link
Member

Hi @jimruxton , are you interested in trying to fix the comments either for our master branch or ideally for our 0.10 branch? I think they should be fairly easy to do (I've not tried it, but I think in theory you can take the suggested fixes from my comments and easily integrate them, see https://help.github.com/articles/incorporating-feedback-in-your-pull-request/#applying-a-suggested-change ).

@peternewman
Copy link
Member

I'm closing this as it's been superceded by @brucelowekamp and others work in #1605 which is in 0.10 and will be in master shortly. Thanks for your efforts on it anyway @jimruxton .

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