Opened at 2013-08-07T00:48:48Z
Last modified at 2015-01-20T21:29:13Z
#2047 assigned defect
refactor *Source classes in tahoe_cp.py to have a basename() method rather than passing around (name, source) pairs
Reported by: | daira | Owned by: | daira |
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | code-frontend-cli | Version: | 1.10.0 |
Keywords: | cleanup tahoe-cp | Cc: | |
Launchpad Bug: |
Description (last modified by daira)
Much of the code in src/allmydata/scripts/tahoe_cp.py passes around (name, source) pairs, where the name is the basename (i.e. last path component) of the source object. The source object should instead have a basename() method. (It is called that in Twisted's FilePath API.)
Change History (4)
comment:1 Changed at 2013-08-07T00:49:17Z by daira
- Owner set to daira
- Status changed from new to assigned
- Summary changed from refactor *Source classes in tahoe-cp.py to have a basename() method rather than passing around (name, source) pairs to refactor *Source classes in tahoe_cp.py to have a basename() method rather than passing around (name, source) pairs
comment:2 Changed at 2013-08-07T00:49:49Z by daira
- Description modified (diff)
comment:3 Changed at 2015-01-20T20:48:29Z by warner
comment:4 Changed at 2015-01-20T21:27:49Z by daira
Well, the bad assumption was made for the existing tuple approach, in any case. I'm not insistent on calling it basename(), it could be called basename_if_present() if that helps.
Note: See
TracTickets for help on using
tickets.
The source object might be a pure filecap or dircap, and thus have no name. I think I wrote it this way (with tuples) as a reminder of that feature/property. I wouldn't object to moving this value into an property or method of the TahoeFileSource and LocalFileSource objects, but I'm not sure that basename() is the best name for it, if that's likely to imply that it always exists.
I think this assumption is the root cause for the #2329 regression.