mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
WPD: put_file works
This commit is contained in:
parent
2d6b0badd0
commit
5c4f6df448
@ -303,8 +303,8 @@ class MTP_DEVICE(MTPDeviceBase):
|
|||||||
e.full_path,))
|
e.full_path,))
|
||||||
self.delete_file_or_folder(e)
|
self.delete_file_or_folder(e)
|
||||||
sid, pid = parent.storage_id, parent.object_id
|
sid, pid = parent.storage_id, parent.object_id
|
||||||
ans = self.dev.put_file(sid, pid, name, stream, size, callback)
|
ans = self.dev.put_file(pid, name, stream, size, callback)
|
||||||
ans['storage_id'] = parent.storage_id
|
ans['storage_id'] = sid
|
||||||
return parent.add_child(ans)
|
return parent.add_child(ans)
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,6 +63,8 @@ def main():
|
|||||||
try:
|
try:
|
||||||
devices = win_scanner()
|
devices = win_scanner()
|
||||||
pnp_id = dev.detect_managed_devices(devices)
|
pnp_id = dev.detect_managed_devices(devices)
|
||||||
|
if not pnp_id:
|
||||||
|
raise ValueError('Failed to detect device')
|
||||||
# pprint.pprint(dev.detected_devices)
|
# pprint.pprint(dev.detected_devices)
|
||||||
print ('Trying to connect to:', pnp_id)
|
print ('Trying to connect to:', pnp_id)
|
||||||
dev.open(pnp_id, '')
|
dev.open(pnp_id, '')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user