mirror of
https://github.com/N4S4/synology-api.git
synced 2026-01-14 01:58:07 +00:00
#fix numpydoc
This commit is contained in:
@ -455,12 +455,12 @@ class DownloadStation(base_api.BaseApi):
|
||||
|
||||
Parameters
|
||||
----------
|
||||
url : str, Optional
|
||||
Download URL.
|
||||
file_path: str, Optional
|
||||
Download through file.
|
||||
destination : str
|
||||
Download destination.
|
||||
url: str, optional
|
||||
Download URL. Use either `url` or `file_path`.
|
||||
file_path: str, optional
|
||||
Path to a file (e.g. a .torrent) to download.
|
||||
destination: str, optional
|
||||
Download destination folder (default is "").
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
||||
@ -71,12 +71,13 @@ def get_data_for_request_from_file(file_path: str, fields: list[tuple]):
|
||||
----------
|
||||
file_path : str
|
||||
The file path to be parsed.
|
||||
fields : list of tuple[str, str] containing data
|
||||
fields : list of tuple[str, str]
|
||||
Fields to create the MultiPartEncoder.
|
||||
|
||||
Returns
|
||||
-------
|
||||
MultiPartEncoder Object to send to the post request
|
||||
|
||||
MultiPartEncoder
|
||||
MultiPartEncoder Object to send to the post request
|
||||
"""
|
||||
|
||||
p = Path(file_path).expanduser().resolve()
|
||||
@ -96,6 +97,11 @@ def get_data_for_request_from_file(file_path: str, fields: list[tuple]):
|
||||
def generate_gecko_boundary():
|
||||
"""
|
||||
Generate a boundary for MultiPartEncoder.
|
||||
|
||||
Returns
|
||||
-------
|
||||
str:
|
||||
The random boundary ----geckoformboundary{random_hex} for the MultiPartEncoder.
|
||||
"""
|
||||
random_hex = secrets.token_hex(16) # 16 byte = 32 caratteri esadecimali
|
||||
return f"----geckoformboundary{random_hex}"
|
||||
|
||||
Reference in New Issue
Block a user