EnterpriseyIntranet / nextcloud-API

NextCloud OCS API for Python
GNU General Public License v3.0
27 stars 27 forks source link

A fast pass on docstring or code would be nice :p #66

Open luffah opened 3 years ago

luffah commented 3 years ago

Hello, sorry to just reveal the thing and not proposing a PR. Actually, it would be easy to fix (but shall require a code review).

Below the function get_share_info have a docstring that is incoherent with working usecase.

>>> nxc.get_share_info(8).data
Traceback (most recent call last):
  File "/usr/lib/python3.6/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
  File "~/r_et_d/nextcloud/api_wrappers/share.py", line 73, in get_share_info
    return self.requester.get(self.get_local_url(sid))
  File "~/r_et_d/nextcloud/api_wrappers/share.py", line 12, in get_local_url
    return "/".join([self.LOCAL, additional_url])
TypeError: sequence item 1: expected str instance, int found
>>> nxc.get_share_info('8').data
[{'id': 8, ... }]
>>> nxc.get_share_info.__doc__
'\n        Get information about a given share\n\n        Args:\n            sid (int): share id\n\n        Returns:\n        '