[tahoe-lafs-trac-stream] [tahoe-lafs] #1429: automatically upload a file when it is put in a given local directory
tahoe-lafs
trac at tahoe-lafs.org
Tue Aug 9 15:32:01 PDT 2011
#1429: automatically upload a file when it is put in a given local directory
-------------------------+-------------------------------------------------
Reporter: | Owner: warner
davidsarah | Status: reopened
Type: | Milestone: 1.9.0
enhancement | Version: 1.8.2
Priority: major | Keywords: drop-upload inotify usability
Component: code- | review-needed news
frontend |
Resolution: |
Launchpad Bug: |
-------------------------+-------------------------------------------------
Changes (by zooko):
* keywords: drop-upload inotify usability reviewed news => drop-upload
inotify usability review-needed news
* status: closed => reopened
* resolution: fixed =>
Comment:
Reviewed attachment:rename-upload-uri-to-dircap.darcs.patch. There are
some issues. I'm attaching patches that fix a couple of them but not all.
Out of curiosity I rerecorded the patch with {{{darcs record}}}; this
helped me find issues in the patch; see below. The resulting patches are
in [attachment:1429-rerecord-and-add-test-of-absent-localdir.darcs.patch
the latest attachment] -- they redo the renaming with {{{darcs replace}}}
and would be an acceptable variant to commit to trunk (also a suitably
fixed version with hunks instead of {{{darcs replace}}} would be
acceptable to me).
issues fixed by [attachment:1429-rerecord-and-add-test-of-absent-
localdir.darcs.patch the latest attachment]:
* There was a missed rename in
[source:trunk/src/allmydata/client.py?annotate=blame&rev=5124#L425
Client.init_drop_uploader] which would cause an exception if the code were
executed.
* In [source:trunk/src/allmydata/client.py?annotate=blame&rev=5124#L425
init_drop_uploader] the local variable could be changed from
{{{upload_uri}}} to {{{upload_cap}}}, the way this patch changed such
names elsewhere. This is changed by the {{{darcs record}}} rename in the
attached patches.
* In
[source:trunk/src/allmydata/frontends/drop_upload.py?annotate=blame&rev=5124#L19
DropUploader.__init__] it uses {{{FilePath.is_dir}}} as if it will return
{{{False}}} when then thing doesn't exist ''or'' the thing is a non-
directory, but {{{FilePath.is_dir}}} actually raises exception when the
thing doesn't exist. The attached patches fix it to use
{{{FilePath.exists}}} and change it to report those two cases separately.
issues not fixed:
* The presence of the missed rename also means that the code in
{{{Client.init_drop_uploader}}} isn't exercised by unit tests.
* The "was not valid utf-8" and the "could not be represented in your
local filesystem" exceptions could be caught and reported separately in
[source:trunk/src/allmydata/frontends/drop_upload.py?annotate=blame&rev=5124#L19
DropUploader.__init__] so that the user would know which one happened. Not
necessary for this ticket, but could be nice.
--
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1429#comment:32>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list