Closed blvdek closed 3 months ago
To make docs pass you can add:
.. autoclass:: NcSession
:members:
at the end of Session.rst
And create LoginFlowV2.rst
file with such content(and include it in index.rst):
.. py:currentmodule:: nc_py_api.loginflow_v2
LoginFlow V2
============
Two base classes for working with Nextcloud. The first for working as a client, the second as an application.
All required functionality is incorporated in them, they contains all other classes required to work with the Nextcloud.
.. autoclass:: _LoginFlowV2API
:inherited-members:
:members:
.. autoclass:: Credentials
:inherited-members:
:members:
.. autoclass:: LoginFlow
:inherited-members:
:members:
and for tests(test_init_poll, test_init_poll_async) as this stuff is not for AppAPI:
nc_any
should be nc_client
and anc_any
should be anc_client
def test_init_poll(nc_client):
lf = nc_client.loginflow_v2.init()
...
this help to not trigger these tests for NextcloudApp
class.
Attention: Patch coverage is 78.35052%
with 21 lines
in your changes are missing coverage. Please review.
Project coverage is 95.72%. Comparing base (
ddce6bf
) to head (2cba348
).
As I understand this should be used like this:
import nc_py_api
if __name__ == "__main__":
nc = nc_py_api.Nextcloud(nextcloud_url="http://stable29.local")
r = nc.loginflow_v2.init()
print(r) # here open link in browser and agree to connect
r2 = nc.loginflow_v2.poll(r.token)
print(r2)
print(nc.capabilities)
print(nc.files.listdir())
Thank you for your pull request and interest in Nextcloud and nc_py_api, after changing the URL I will gladly merge it. :)
Thanks again, good job :)
Thank you too
Changes proposed in this pull request: