jp (file/send): --name can now be specified
This commit is contained in:
parent
82b8250fac
commit
d51dc5b2eb
1 changed files with 5 additions and 2 deletions
|
|
@ -47,6 +47,7 @@ class Send(base.CommandBase):
|
|||
self.parser.add_argument("-b", "--bz2", action="store_true", help=_(u"make a bzip2 tarball"))
|
||||
self.parser.add_argument("-d", "--path", type=base.unicode_decoder, help=(u"path to the directory where the file must be stored"))
|
||||
self.parser.add_argument("-N", "--namespace", type=base.unicode_decoder, help=(u"namespace of the file"))
|
||||
self.parser.add_argument("-n", "--name", type=base.unicode_decoder, default=u'', help=(u"name to use (DEFAULT: use source file name)"))
|
||||
|
||||
def start(self):
|
||||
"""Send files to jabber contact"""
|
||||
|
|
@ -114,11 +115,13 @@ class Send(base.CommandBase):
|
|||
bz2.close()
|
||||
self.disp(_(u"Done !"), 1)
|
||||
|
||||
self.host.bridge.fileSend(self.full_dest_jid, buf.name, archive_name, '', extra, self.profile, callback=lambda pid, file_=buf.name: self.gotId(pid, file_), errback=self.error)
|
||||
self.host.bridge.fileSend(self.full_dest_jid, buf.name, self.args.name or archive_name, '', extra, self.profile,
|
||||
callback=lambda pid, file_=buf.name: self.gotId(pid, file_), errback=self.error)
|
||||
else:
|
||||
for file_ in self.args.files:
|
||||
path = os.path.abspath(file_)
|
||||
self.host.bridge.fileSend(self.full_dest_jid, path, '', '', extra, self.profile, callback=lambda pid, file_=file_: self.gotId(pid, file_), errback=self.error)
|
||||
self.host.bridge.fileSend(self.full_dest_jid, path, self.args.name, '', extra, self.profile,
|
||||
callback=lambda pid, file_=file_: self.gotId(pid, file_), errback=self.error)
|
||||
|
||||
|
||||
class Request(base.CommandBase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue