ulordapi.udfs¶
udfs¶
-
class
ulordapi.udfs.udfs.
Udfs
[source]¶ udfs class,including some operations about daemon program
-
start
(daemon=None)[source]¶ start udfs.if daemon is true, the udfs is a daemon,else the udfs is starting the current thread.
Parameters: daemon (bool) – if wait
-
-
class
ulordapi.udfs.udfs.
UdfsHelper
(host='127.0.0.1', port='5001')[source]¶ download and upload files from Ulord
-
cat
(udfshash)[source]¶ Retrieves the contents of a file identified by hash. :param udfshash: udfs hash :type udfshash:str :return: str(File contents)
-
downloadfile
(localfile)[source]¶ query the localfile from DB and then download from the udfs
Parameters: localfile (str) – a file path Returns: True os False
-
downloadhash
(filehash, filepath=None, Debug=False)[source]¶ download file from the UDFS according to the udfs hash
Parameters: - filehash (str) – file udfs hash
- filepath (str) – the path to save the file
- Debug (bool) – if Debug print the cost time
Returns: True or False
-
list
(filehash)[source]¶ list the udfshash chunks
Parameters: filehash (str) – a udfs hash Returns: a list chunks of the udfs hash
-
resumableDownload
(filehash, filename=None)[source]¶ resumable download
Parameters: - filehash (str) – file UDFS hash
- filename (str) – file path to save the file
Returns: True or False
-
update
(host='127.0.0.1', port='5001')[source]¶ update udfs dameon connection
Parameters: - host (str) – udfs daemon host
- port (str/int) – udfs daemon port
-