[tahoe-dev] [tahoe-lafs] #640: Cli fs operations refactoring
tahoe-lafs
trac at tahoe-lafs.org
Sun Nov 21 18:48:59 UTC 2010
#640: Cli fs operations refactoring
-----------------------------------+----------------------------------------
Reporter: azazel | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: undecided
Component: code-frontend-cli | Version: 1.3.0
Resolution: | Keywords: cleanup
Launchpad Bug: |
-----------------------------------+----------------------------------------
Comment (by nejucomo):
I read over the code to understand how to get from my shell into
./src/allmydata/scripts/* and it seems overly complex:
./bin/tahoe is a python script generated from ./bin/tahoe-script.template.
Q1: Why is this generated from a template? That seems unpythonic and
unnecessary. When I diff the template and the generated script on my Mac,
the only change is to replace "#!/bin/false" with "#!/usr/bin/python".
./bin/tahoe does a bunch of platform difference wrangling and eventually
calls ./support/bin/tahoe.
Q2: Can any of the complexity in ./bin/tahoe be removed?
./support/bin/tahoe is very short and simply calls: load_entry_point
('allmydata-tahoe==1.8.0', 'console_scripts', 'tahoe')()
Q3: Why does ./support/bin/tahoe exist? Why doesn't ./bin/tahoe call
load_entry_point directly?
Q4: Why is the load_entry_point mechanism used? Is it necessary?
load_entry_point() resolves a mapping for "console_scripts" for tahoe to
./src/allmydata/scripts/runner.py's run() function. This mapping is
configured in ./setup.py.
Q5: Why doesn't ./bin/tahoe call runner.py's run() directly?
Q6: Why are there two separate packaging processes necessary to make the
commandline work? One being script template generation, the other being
entry_point registration.
My perspective probably doesn't account for use cases, but I hope by
asking these questions we might notice potential simplifications.
--
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/640#comment:3>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-dev
mailing list