mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-21 13:57:51 +00:00
add some vdrive logging
This commit is contained in:
parent
cd3ad76cfb
commit
e880660960
@ -3,6 +3,7 @@
|
||||
|
||||
from twisted.application import service
|
||||
from twisted.internet import defer
|
||||
from twisted.python import log
|
||||
from allmydata import upload, download
|
||||
|
||||
class VDrive(service.MultiService):
|
||||
@ -78,6 +79,7 @@ class VDrive(service.MultiService):
|
||||
I return a deferred that will fire when the operation is complete.
|
||||
"""
|
||||
|
||||
log.msg("putting file to '%s'" % name)
|
||||
ul = self.parent.getServiceNamed("uploader")
|
||||
d = self.dirpath(dir_or_path)
|
||||
def _got_dir(dirnode):
|
||||
@ -86,6 +88,10 @@ class VDrive(service.MultiService):
|
||||
dirnode.callRemote("add_file", name, vid))
|
||||
return d1
|
||||
d.addCallback(_got_dir)
|
||||
def _done(res):
|
||||
log.msg("finished putting file to '%s'" % name)
|
||||
return res
|
||||
d.addCallback(_done)
|
||||
return d
|
||||
|
||||
def put_file_by_filename(self, dir_or_path, name, filename):
|
||||
@ -112,6 +118,7 @@ class VDrive(service.MultiService):
|
||||
allmydata.download.Data, .FileName, or .FileHandle .
|
||||
"""
|
||||
|
||||
log.msg("getting file from %s" % (dir_and_name_or_path,))
|
||||
dl = self.parent.getServiceNamed("downloader")
|
||||
|
||||
if isinstance(dir_and_name_or_path, tuple):
|
||||
@ -137,6 +144,10 @@ class VDrive(service.MultiService):
|
||||
def _got_verifierid(verifierid):
|
||||
return dl.download(verifierid, download_target)
|
||||
d.addCallback(_got_verifierid)
|
||||
def _done(res):
|
||||
log.msg("finished getting file")
|
||||
return res
|
||||
d.addCallback(_done)
|
||||
return d
|
||||
|
||||
def get_file_to_filename(self, from_where, filename):
|
||||
|
Loading…
Reference in New Issue
Block a user