JohnDoee / deluge-client

A very lightweight pure-python Deluge RPC Client
MIT License
89 stars 14 forks source link

Add context manager magic methods #33

Closed nolanbconaway closed 4 years ago

nolanbconaway commented 4 years ago

Hi 👋 ! First time contributor here! I added a quick context manager method here and hacked together some tests (though i don't have a deluge server running locally so i'll need the CI to run to check if the tests perform as expected).

This would allow users to connect to deluge via an API like:

with DelugeRPCClient('..') as client:
    # do stuff, connection is opened/closed automagically

Whaddya think?

nolanbconaway commented 4 years ago

@JohnDoee looks like the test failures are due to an invalid download URL for deluge 2. i am not very familiar with the CI flow, do you know how this might get remedied? see https://ci.appveyor.com/project/AndersJensen/deluge-client/builds/29383963/job/6oupomow89ra9y9r

JohnDoee commented 4 years ago

Seems like they moved the Windows installer for Deluge. There is no official stable windows binary yet so we'll have to just use the archived one.

If you change download link to http://download.deluge-torrent.org/archive/2.0/deluge-2.0b1-win32-setup.exe in https://github.com/JohnDoee/deluge-client/blob/develop/.appveyor.yml#L33 then it should be all good.

nolanbconaway commented 4 years ago

That did the trick! Ready for 👀 @JohnDoee

JohnDoee commented 4 years ago

Looks good, thanks! I'll get a release out with it.