Skip to content

Commit 2bb5849

Browse files
authored
Merge pull request #35 from wj-Mcat/master
enable file-box stream data
2 parents b9947e3 + 62a53f8 commit 2bb5849

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.0
1+
0.2.1

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pyee
22
requests
3-
chatie-grpc>=0.17.dev4
3+
chatie-grpc>=0.18.12
44
qrcode

src/wechaty_puppet/file_box/file_box.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self, options: FileBoxOptionsBase):
6868

6969
elif isinstance(options, FileBoxOptionsStream):
7070
# TODO -> need to get into detail for stream sending
71-
pass
71+
self.stream = options.stream
7272

7373
elif isinstance(options, FileBoxOptionsQrCode):
7474
self.qrCode = options.qr_code
@@ -192,6 +192,10 @@ async def to_file(self, file_path: Optional[str] = None,
192192
with open(file_path, 'wb') as f:
193193
f.write(data)
194194

195+
elif file_box_type == FileBoxType.Stream:
196+
with open(file_path, 'wb+') as f:
197+
f.write(self.stream)
198+
195199
def to_base64(self) -> str:
196200
"""
197201
transfer file-box to base64 string

0 commit comments

Comments
 (0)