Skip to content
Permalink
Browse files

Merge branch 'pr323'

  • Loading branch information...
warner committed Mar 10, 2019
2 parents a5e011f + 9464fa9 commit 995d3f546a33eec4f64df929848d86937d2003a7
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/wormhole/cli/cmd_send.py
@@ -3,6 +3,8 @@
import hashlib
import os
import sys

import stat
import tempfile
import zipfile

@@ -364,6 +366,22 @@ def _build_offer(self):
file=args.stderr)
return offer, fd_to_send

if stat.S_ISBLK(os.stat(what).st_mode):
fd_to_send = open(what, "rb")
filesize = fd_to_send.seek(0, 2)

offer["file"] = {
"filename": basename,
"filesize": filesize,
}
print(
u"Sending %s block device named '%s'" % (naturalsize(filesize),
basename),
file=args.stderr)

fd_to_send.seek(0)
return offer, fd_to_send

raise TypeError("'%s' is neither file nor directory" % args.what)

@inlineCallbacks

0 comments on commit 995d3f5

Please sign in to comment.
You can’t perform that action at this time.