self._download_scan_batch = {}
self._download_lazy_tail = defer.succeed(None)
self._download_pending = set()
+ self._collective_dirnode = None
self._client = client
self._stats_provider = client.stats_provider
self._convergence = client.convergence
recursive=True)
- self._scan_remote_collective()
-
def _should_download(self, path, remote_version):
"""
_should_download returns a bool indicating whether or not a remote object should be downloaded.
return listing_d
def _scan_remote_collective(self):
+ if self._collective_dirnode is None:
+ return
upload_readonly_dircap = self._upload_dirnode.get_readonly_uri()
collective_dirmap_d = self._collective_dirnode.list()
def do_filter(result):
self._log("magic folder upload deque is now empty")
self._download_lazy_tail = defer.succeed(None)
self._download_lazy_tail.addCallback(lambda ign: task.deferLater(reactor, self._remote_scan_delay, self._scan_remote_collective))
- self._download_lazy_tail.addCallback(lambda ign: task.deferLater(reactor, 0, self._turn_download_deque))
+ #self._download_lazy_tail.addCallback(lambda ign: task.deferLater(reactor, 0, self._turn_download_deque))
return
self._download_lazy_tail.addCallback(lambda ign: task.deferLater(reactor, 0, self._download_file, file_path, file_node))
self._download_lazy_tail.addCallback(lambda ign: task.deferLater(reactor, self._remote_scan_delay, self._turn_download_deque))
db = self._createdb()
path = abspath_expanduser_unicode(u"myFile1", base=self.basedir)
- db.did_upload_file('URI:LIT:1', path, 0, 0, 33)
+ db.did_upload_file('URI:LIT:1', path, 1, 0, 0, 33)
c = db.cursor
c.execute("SELECT size,mtime,ctime,fileid"
size = s[stat.ST_SIZE]
ctime = s[stat.ST_CTIME]
mtime = s[stat.ST_MTIME]
- db.did_upload_file('URI:LIT:2', path, mtime, ctime, size)
+ db.did_upload_file('URI:LIT:2', path, 1, mtime, ctime, size)
r = db.check_file(path)
self.failUnless(r.was_uploaded())
self.client = self.g.clients[0]
self.stats_provider = self.client.stats_provider
+ self.collective_dircap = ""
+
d = self.create_invite_join_magic_folder(u"Alice", self.local_dir)
d.addCallback(self._create_magicfolder)
-
def create_test_file(result):
d2 = defer.Deferred()
self.magicfolder.set_processed_callback(d2.callback, ignore_count=0)
d.addCallback(create_test_file)
d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_succeeded'), 1))
d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_queued'), 0))
-
- def _restart(ign):
+
+ def restart(ignore):
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):
fileutil.write(os.path.join(client_node_dir, "tahoe.cfg"), tahoe_config)
- self.set_up_grid(client_config_hooks={0: write_config})
- self.client = self.g.clients[0]
- self.stats_provider = self.client.stats_provider
- d.addCallback(self._create_magicfolder)
- d.addCallback(lambda x: time.sleep(1))
-
- d.addCallback(self.cleanup)
- d.addCallback(_restart)
+ def setup_stats(result):
+ self.set_up_grid(client_config_hooks={0: write_config})
+ self.client = self.g.clients[0]
+ self.stats_provider = self.client.stats_provider
+ d3.addBoth(self.cleanup)
+ d3.addCallback(setup_stats)
+ d3.addCallback(self._create_magicfolder)
+ return d3
+ d.addCallback(restart)
d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_succeeded'), 0))
d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_queued'), 0))
d.addBoth(self.cleanup)
d = self.client.create_dirnode()
d.addCallback(self._made_upload_dir)
+ self.collective_dircap = ""
d.addCallback(self._create_magicfolder)
# Write something short enough for a LIT file.