2
2
3
3
import os
4
4
import io
5
- from typing import List
6
- from .functions import upload as d , types as t , deal_status , get_uploads as getUploads , download as _download
5
+ from .functions import upload as d ,deal_status , get_uploads as getUploads , download as _download
7
6
8
7
9
8
class Lighthouse :
@@ -14,7 +13,7 @@ def __init__(self, token: str = ""):
14
13
"No token provided: Please provide a token or set the LIGHTHOUSE_TOKEN environment variable"
15
14
)
16
15
17
- def upload (self , source : str , tag : str = '' ) -> t . Upload :
16
+ def upload (self , source : str , tag : str = '' ):
18
17
"""
19
18
Upload a file or directory to the Lighthouse.
20
19
@@ -26,7 +25,7 @@ def upload(self, source: str, tag: str = '') -> t.Upload:
26
25
except Exception as e :
27
26
raise e
28
27
29
- def uploadBlob (self , source : io .BufferedReader , filename : str , tag : str = '' ) -> t . Upload :
28
+ def uploadBlob (self , source : io .BufferedReader , filename : str , tag : str = '' ):
30
29
"""
31
30
Upload Blob a file or directory to the Lighthouse.
32
31
@@ -41,7 +40,7 @@ def uploadBlob(self, source: io.BufferedReader, filename: str, tag: str = '') ->
41
40
raise e
42
41
43
42
@staticmethod
44
- def downloadBlob (dist : io .BufferedWriter , cid : str , chunk_size = 1024 * 1024 * 10 ) -> t . Upload :
43
+ def downloadBlob (dist : io .BufferedWriter , cid : str , chunk_size = 1024 * 1024 * 10 ):
45
44
"""
46
45
Download a Blob (file or directory) from the Lighthouse.
47
46
@@ -59,7 +58,7 @@ def downloadBlob(dist: io.BufferedWriter, cid: str, chunk_size=1024*1024*10) ->
59
58
raise e
60
59
61
60
@staticmethod
62
- def downloadBlob (dist : io .BufferedWriter , cid : str , chunk_size = 1024 * 1024 * 10 ) -> t . Upload :
61
+ def downloadBlob (dist : io .BufferedWriter , cid : str , chunk_size = 1024 * 1024 * 10 ):
63
62
"""
64
63
Download Blob a file or directory to the Lighthouse.
65
64
@@ -74,7 +73,7 @@ def downloadBlob(dist: io.BufferedWriter, cid: str, chunk_size=1024*1024*10) ->
74
73
raise e
75
74
76
75
@staticmethod
77
- def getDealStatus (cid : str ) -> List [ t . DealData ] :
76
+ def getDealStatus (cid : str ):
78
77
"""
79
78
Get deal status from the Lighthouse.
80
79
@@ -87,7 +86,7 @@ def getDealStatus(cid: str) -> List[t.DealData]:
87
86
raise e
88
87
89
88
@staticmethod
90
- def getUploads (publicKey : str , pageNo : int = 1 ) -> List [ t . DealData ] :
89
+ def getUploads (publicKey : str , pageNo : int = 1 ):
91
90
"""
92
91
Get uploads from the Lighthouse.
93
92
@@ -101,7 +100,7 @@ def getUploads(publicKey: str, pageNo: int = 1) -> List[t.DealData]:
101
100
raise e
102
101
103
102
@staticmethod
104
- def download (cid : str ) -> bytes :
103
+ def download (cid : str ):
105
104
"""
106
105
Download content from the Lighthouse using its Content Identifier (CID).
107
106
@@ -114,7 +113,7 @@ def download(cid: str) -> bytes:
114
113
except Exception as e :
115
114
raise e
116
115
117
- def getTagged (self , tag : str ) -> t . Upload :
116
+ def getTagged (self , tag : str ):
118
117
"""
119
118
Retrieve an upload from the Lighthouse using its tag.
120
119
0 commit comments