Commit Graph

6330 Commits

Author SHA1 Message Date
Ramakrishnan Muthukrishnan
9bf5f5c312 _process(): pass absolute path to the _write_download_file() 2015-08-31 13:53:48 +05:30
Ramakrishnan Muthukrishnan
eac7aefe26 WIP: test for _write_downloaded_file 2015-08-31 13:02:34 +05:30
Ramakrishnan Muthukrishnan
ef3cdd7db1 magic_folder: typo utimes -> utime 2015-08-31 12:51:05 +05:30
Daira Hopwood
f113db62ac Add Downloader._write_downloaded_file. refs ticket:2489
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-25 16:02:36 +01:00
Daira Hopwood
552342f8b6 Remove debug prints in backupdb.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-24 17:53:13 +01:00
Daira Hopwood
6b8b952211 Remove or comment out print statements.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-24 17:49:34 +01:00
Daira Hopwood
1ba8b96726 Rename Client.upload_ready_d to connected_enough_d.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-24 17:41:57 +01:00
Daira Hopwood
0fde8b493a In Downloader._get_collective_latest_file, consume errors when getting metadata.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-24 17:17:24 +01:00
David Stainton
d0cadd17fd Teach uploader to process lazy tail upon stop method 2015-08-24 13:19:45 +02:00
David Stainton
0dc96dd951 Teach magic-folder ready method to return a deferred 2015-08-24 13:11:37 +02:00
Daira Hopwood
1957a30c52 Fix a bug in Downloader._scan_remote that incorrectly skips subsequent files
(and drops a Deferred) when local version >= remote version.
Also simplify that code and robustify it for the case where the version metadata is missing.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-20 19:45:49 +01:00
Daira Hopwood
76b3e4038a Use deferredutil.HookMixin to simplify callback for tests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-20 16:58:55 +01:00
David Stainton
7297bb5fc1 Minor fix to alice bob test 2015-08-19 21:56:29 +02:00
David Stainton
14ea4497ae Fix _scan_remote and remove print statements 2015-08-19 21:45:20 +02:00
Daira Hopwood
decc5ff412 Fix incorrect order of fields in SQL statement.
My kingdom for a better SQL DSL.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-19 15:33:52 +01:00
Daira Hopwood
db242c7652 Cleanup.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-19 15:33:08 +01:00
Daira Hopwood
fc14b47175 More debug prints.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-19 15:32:52 +01:00
Daira Hopwood
9eadfc5154 Debug prints to diagnose version mismatch after deletion (backupdb). 2015-08-19 13:48:11 +00:00
Daira Hopwood
5b23b354c6 Debug prints to diagnose version mismatch after deletion. 2015-08-19 13:31:38 +00:00
David Stainton
8a98a99979 Add some print statements. 2015-08-18 14:33:29 +00:00
Daira Hopwood
36680042d3 Merge pull request #184 from vu3rdd/2477.refactor-all-the-things.0
test for get_pathinfo()
2015-08-12 14:11:58 +01:00
Ramakrishnan Muthukrishnan
8adc28bb9d test_get_pathinfo: testdir is unnecessary
Use basedir itself, instead of creating another directory inside basedir.
2015-08-12 15:17:27 +05:30
Ramakrishnan Muthukrishnan
e49d76f68d test_get_pathinfo: rename the identifier d to testdir
d, by convention, is used for the Twisted Deferred objects.
2015-08-12 14:32:40 +05:30
Ramakrishnan Muthukrishnan
d36521997e add more tests for get_pathinfo()
When operating on a file, test if the "file" is not a directory
or a symlink. Likewise for directory and symlink.
2015-08-12 14:26:52 +05:30
Ramakrishnan Muthukrishnan
4bab676316 Add test for get_pathinfo() 2015-08-12 14:14:07 +05:30
Daira Hopwood
6eb272856e Use get_pathinfo instead of separate os.path.{is*,exists} calls.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 17:02:53 +01:00
Daira Hopwood
4f7c02c651 Extend get_pathinfo to add size, ctime and mtime.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 16:02:25 +01:00
Daira Hopwood
f2d40cea9b Remove an unnecessary precondition and an incorrect comment.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 15:46:31 +01:00
Daira Hopwood
5377f3bbd5 Add fileutil.get_pathinfo function.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 15:43:01 +01:00
Daira Hopwood
144f4ff5ff Extract get_metadata and get_filenode to methods of Uploader.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 15:21:10 +01:00
Daira Hopwood
8eb81b84f2 Processing symlinks and special files should not be an error.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 15:19:05 +01:00
Daira Hopwood
b4c0a140e3 Refactor uploader by inlining _add_file into _process._maybe_upload.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 15:17:16 +01:00
Daira Hopwood
846d61b894 Refactor uploader by inlining _add_file into _process._maybe_upload.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 15:09:56 +01:00
Daira Hopwood
4850c06c4a Refactor uploader by extracting _process_child to a top-level method.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 15:06:27 +01:00
Daira Hopwood
0f33e04258 Swap two checks to clarify which is failing.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-08-11 15:04:36 +01:00
David Stainton
b01bc80117 fix code that adds version number of deleted file to magic-folder db 2015-07-31 15:55:15 -07:00
David Stainton
45b8e578eb enable version checking tests - currently a righteous fail 2015-07-31 15:08:35 -07:00
David Stainton
084b92535c make various changes - work in progress 2015-07-31 15:06:12 -07:00
David Stainton
ea39f11c57 add version checking to alice bob test 2015-07-31 11:09:30 -07:00
David Stainton
12ab89c6b5 Update magic-folder db after download 2015-07-31 10:51:19 -07:00
David Stainton
561ff74fa4 Add final download to alice bob test
- that is to say after alice deletes the file she rewrites it
and this causes bob to download this latest version
2015-07-30 14:13:39 -07:00
David Stainton
2b7e5c1481 Remove old unused append to deque function from downloader 2015-07-30 13:57:29 -07:00
Daira Hopwood
27fe50ff24 WIP to unify queue processing between uploader and downloader.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-30 18:52:05 +01:00
Daira Hopwood
c7091ef6e6 Repair tests.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-30 18:12:50 +01:00
Daira Hopwood
50c2cc575f Move uploader's _append_to_deque and _turn_deque to QueueMixin.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-30 18:04:44 +01:00
Daira Hopwood
b51563fe1e Make sure that counter names and log messages include "uploader" or "downloader".
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-30 18:04:13 +01:00
Daira Hopwood
cde94e4eb6 Trivial fix.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-07-30 16:24:57 +01:00
David Stainton
067edc7793 remove debugging print statements 2015-07-28 17:52:27 -07:00
David Stainton
ecfc33bb05 Fix alice bob test 2015-07-28 17:46:46 -07:00
David Stainton
825e8d9e9a Teach downloader to stop when told to stop 2015-07-28 17:02:51 -07:00