petersbingham / dae-py-relay-controller

Python code for controlling Denkovi usb relay boards.
https://denkovi.com/
14 stars 14 forks source link

Implement close method for linux FTD2XX driver #9

Closed Joan-Garcia-Guzman closed 5 years ago

Joan-Garcia-Guzman commented 6 years ago

Hi, could you please merge this bugfix? It fixes the close method for linux platforms

petersbingham commented 6 years ago

Hi

You need to squash all your commits. If you need help doing this please let me know.


From: Joan Garcia notifications@github.com Sent: 26 October 2018 10:59 To: petersbingham/dae-py-relay-controller Cc: Peter Bingham; Comment Subject: Re: [petersbingham/dae-py-relay-controller] Implement close method for linux FTD2XX driver (#9)

@Joan-Garcia-Guzman commented on this pull request.


In dae_RelayBoard/dae_RelayBoard_D2XX.pyhttps://github.com/petersbingham/dae-py-relay-controller/pull/9#discussion_r228471520:

@@ -39,7 +39,6 @@ def init(self):

 #currently only gets first board
 def initialise(self, *args):

Ok, I have reverted the changes and removed the raise from linux driver. Could you please check it? Many thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/petersbingham/dae-py-relay-controller/pull/9#discussion_r228471520, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMnDeKJD4X2nWg0NO50PYBLr2XrRZogDks5uot0CgaJpZM4Xd_ig.

petersbingham commented 6 years ago

In addition to the squash. You can also remove the:

else: pass

at the end of the function.


From: Peter Bingham petersbingham@hotmail.co.uk Sent: 26 October 2018 14:58 To: petersbingham/dae-py-relay-controller; petersbingham/dae-py-relay-controller Cc: Comment Subject: Re: [petersbingham/dae-py-relay-controller] Implement close method for linux FTD2XX driver (#9)

Hi

You need to squash all your commits. If you need help doing this please let me know.


From: Joan Garcia notifications@github.com Sent: 26 October 2018 10:59 To: petersbingham/dae-py-relay-controller Cc: Peter Bingham; Comment Subject: Re: [petersbingham/dae-py-relay-controller] Implement close method for linux FTD2XX driver (#9)

@Joan-Garcia-Guzman commented on this pull request.


In dae_RelayBoard/dae_RelayBoard_D2XX.pyhttps://github.com/petersbingham/dae-py-relay-controller/pull/9#discussion_r228471520:

@@ -39,7 +39,6 @@ def init(self):

 #currently only gets first board
 def initialise(self, *args):

Ok, I have reverted the changes and removed the raise from linux driver. Could you please check it? Many thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/petersbingham/dae-py-relay-controller/pull/9#discussion_r228471520, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMnDeKJD4X2nWg0NO50PYBLr2XrRZogDks5uot0CgaJpZM4Xd_ig.

Joan-Garcia-Guzman commented 5 years ago

Hi Peter!

Sorry for the delay, have been very busy. I think I squashed the commits into only 1 containing all the changes. Tell me if that's what you wanted or I did something wrong.

Thanks!

petersbingham commented 5 years ago

The commits are not squashed. If you look at the top of the page, at the commits tab, you can see that the commits is 4. This needs to be 1.

See here for details: https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git

I think the best option is for you to do the soft reset, assuming that you've no other later changes:

git reset --soft HEAD~4 &&
git commit

You will then need to do a force push, since you've changed the history.

Let me know if you need any more help.

petersbingham commented 5 years ago

Another thing. I think you will have to set the bb to None after closing:

        if self.bb is not None:
            self.bb.close()
            self.bb = None

I can make this change though when I up the version number post merge.

petersbingham commented 5 years ago

I've added this fix myself.