File: Options.rst

package info (click to toggle)
nc-py-api 0.19.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,320 kB
  • sloc: python: 12,415; makefile: 238; xml: 100; javascript: 56; sh: 14
file content (43 lines) | stat: -rw-r--r-- 1,097 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
.. _options:

Options
-------

.. automodule:: nc_py_api.options
   :members:

Usage examples
^^^^^^^^^^^^^^

Using kwargs
""""""""""""

.. note:: The names of the options if you wish to specify it in ``kwargs`` is **lowercase**.

.. code-block:: python

    nc_client = Nextcloud(xdebug_session="PHPSTORM", npa_nc_cert=False)

Will set `XDEBUG_SESSION` to ``"PHPSTORM"`` and `NPA_NC_CERT` to ``False``.

With .env
"""""""""

Place **.env** file in your project's directory, and it will be automatically loaded using `dotenv <https://github.com/theskumar/python-dotenv>`_

`Loading occurs only once, when "nc_py_api" is imported into the Python interpreter.`

Modifying at module level
"""""""""""""""""""""""""

Import **nc_py_api** and modify options by setting values you need directly in **nc_py_api.options**,
and all newly created classes will respect that.

.. code-block:: python

    import nc_py_api

    nc_py_api.options.NPA_TIMEOUT = None
    nc_py_api.options.NPA_TIMEOUT_DAV = None

.. note:: In case you debugging PHP code it is always a good idea to set **Timeouts** to ``None``.