WIP and debugging things

Conflicts:
	src/allmydata/test/test_magic_folder.py
This commit is contained in:
meejah 2015-12-15 08:02:58 -08:00 committed by Brian Warner
parent 58f9641179
commit a50d0e5c8b
4 changed files with 13 additions and 6 deletions

View File

@ -50,8 +50,13 @@ def is_new_file(pathinfo, db_entry):
return True
if not pathinfo.exists and db_entry.size is None:
print("NOT because", pathinfo.exists, db_entry.size)
return False
print("NOT because", pathinfo.size, pathinfo.ctime, pathinfo.mtime,
db_entry.size, db_entry.ctime, db_entry.mtime,
((pathinfo.size, pathinfo.ctime, pathinfo.mtime) !=
(db_entry.size, db_entry.ctime, db_entry.mtime)))
return ((pathinfo.size, pathinfo.ctime, pathinfo.mtime) !=
(db_entry.size, db_entry.ctime, db_entry.mtime))
@ -348,7 +353,8 @@ class Uploader(QueueMixin):
| IN_EXCL_UNLINK
)
self._notifier.watch(self._local_filepath, mask=self.mask, callbacks=[self._notify],
recursive=True)
recursive=False)#True)
print "WATCHING", self._local_filepath
def start_monitoring(self):
self._log("start_monitoring")

View File

@ -169,6 +169,7 @@ def join(options):
"\nUse the 'tahoe magic-folder leave' command first.\n")
return 1
print("ZINGA", dmd_cap_file)
fileutil.write(dmd_cap_file, dmd_write_cap)
fileutil.write(collective_readcap_file, magic_readonly_cap)

View File

@ -28,6 +28,8 @@ from allmydata.util.fileutil import get_pathinfo
from allmydata.util.fileutil import abspath_expanduser_unicode
from allmydata.immutable.upload import Data
from twisted.internet.base import DelayedCall
#DelayedCall.debug = True
class MagicFolderDbTests(unittest.TestCase):
@ -1423,12 +1425,9 @@ class RealTestAliceBob(MagicFolderAliceBobTestMixin, unittest.TestCase):
def notify(self, path, mask, magic=None, flush=True):
# Writing to the filesystem causes the notification.
# However, flushing filesystem buffers may be necessary on Windows.
if flush:
fileutil.flush_volume(path.path)
# actually, there's no way to know when the actual
# Actually, there's no way to know when the actual
# notification will occur, and anyway we're not waiting for
# them in any case...so we'll just fudge it and home 100ms is enough.
# them in any case...so we'll just fudge it and hope 100ms is enough.
return task.deferLater(reactor, 0.1, lambda: None)
try:

View File

@ -611,6 +611,7 @@ if sys.platform == "win32":
None
)
if hVolume == INVALID_HANDLE_VALUE:
print("ZINGA", abspath)
raise WinError(get_last_error())
if FlushFileBuffers(hVolume) == 0: