self.is_ready = True
d = self.uploader.start_scanning()
d2 = self.downloader.start_scanning()
- d.addCallback(lambda x: d2)
+ d.addCallback(lambda ign: d2)
return d
def finish(self):
- print "finish"
+ #print "finish"
d = self.uploader.stop()
- def _print(f):
- print f
- return f
- d.addErrback(_print)
- d.addBoth(lambda ign: self.downloader.stop())
- d.addErrback(_print)
+ d2 = self.downloader.stop()
+ d.addCallback(lambda ign: d2)
return d
def remove_service(self):
def _log(self, msg):
s = "Magic Folder %s: %s" % (self._name, msg)
self._client.log(s)
- print s
+ #print s
#open("events", "ab+").write(msg)
def _append_to_deque(self, path):
file_node, metadata = listing_map[name]
local_version = self._get_local_latest(name)
remote_version = metadata.get('version', None)
- print "%r has local version %r, remote version %r" % (name, local_version, remote_version)
+ #print "%r has local version %r, remote version %r" % (name, local_version, remote_version)
if local_version is None or remote_version is None or local_version < remote_version:
self._append_to_batch(name, file_node, metadata)
return d
collective_dirmap_d.addCallback(scan_collective)
collective_dirmap_d.addCallback(self._filter_scan_batch)
- def _print(f):
- print f
- return f
- collective_dirmap_d.addErrback(_print)
collective_dirmap_d.addCallback(self._add_batch_to_download_queue)
return collective_dirmap_d
d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.objects_queued'), 0))
def restart(ignore):
- print "restart"
+ #print "restart"
tahoe_config_file = os.path.join(self.get_clientdir(), "tahoe.cfg")
tahoe_config = fileutil.read(tahoe_config_file)
d3 = defer.succeed(None)
def write_config(client_node_dir):
- print "write_config"
+ #print "write_config"
fileutil.write(os.path.join(client_node_dir, "tahoe.cfg"), tahoe_config)
def setup_stats(result):
- print "setup_stats"
+ #print "setup_stats"
self.client = None
self.set_up_grid(client_config_hooks={0: write_config})
self.client = self.g.clients[0]
def _check_version_in_local_db(self, magicfolder, relpath_u, expected_version):
version = magicfolder._db.get_local_file_version(relpath_u)
- print "_check_version_in_local_db %r %s---------------------------------" % (relpath_u, version)
+ #print "_check_version_in_local_db: %r has version %s" % (relpath_u, version)
self.failUnlessEqual(version, expected_version)
def test_alice_bob(self):
# XXX are these used?
(self.alice_collective_dircap, self.alice_upload_dircap, self.alice_magicfolder,
self.bob_collective_dircap, self.bob_upload_dircap, self.bob_magicfolder) = result
- print "Alice magicfolderdb is at %r" % (self.alice_magicfolder._client.basedir)
- print "Bob magicfolderdb is at %r" % (self.bob_magicfolder._client.basedir)
+ #print "Alice magicfolderdb is at %r" % (self.alice_magicfolder._client.basedir)
+ #print "Bob magicfolderdb is at %r" % (self.bob_magicfolder._client.basedir)
d.addCallback(get_results)
def Alice_write_a_file(result):
- print "Alice writes a file\n"
- # XXX simplify by just using FilePath and setContent
+ #print "Alice writes a file\n"
self.file_path = abspath_expanduser_unicode(u"file1", base=self.alice_magicfolder.uploader._local_path_u)
fileutil.write(self.file_path, "meow, meow meow. meow? meow meow! meow.")
self.magicfolder = self.alice_magicfolder
d.addCallback(Alice_write_a_file)
def Alice_wait_for_upload(result):
- print "Alice waits for an upload\n"
+ #print "Alice waits for an upload\n"
d2 = self.alice_magicfolder.uploader.set_hook('processed')
return d2
d.addCallback(Alice_wait_for_upload)
d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.directories_created', client=self.alice_magicfolder._client), 0))
def Bob_wait_for_download(result):
- print "Bob waits for a download\n"
+ #print "Bob waits for a download\n"
d2 = self.bob_magicfolder.downloader.set_hook('processed')
return d2
d.addCallback(Bob_wait_for_download)
# test deletion of file behavior
def Alice_delete_file(result):
- print "Alice deletes the file!\n"
+ #print "Alice deletes the file!\n"
os.unlink(self.file_path)
self.notify(to_filepath(self.file_path), self.inotify.IN_DELETE)
def Alice_rewrite_file(result):
- print "Alice rewrites file\n"
+ #print "Alice rewrites file\n"
self.file_path = abspath_expanduser_unicode(u"file1", base=self.alice_magicfolder.uploader._local_path_u)
fileutil.write(self.file_path, "Alice suddenly sees the white rabbit running into the forest.")
self.magicfolder = self.alice_magicfolder