OS/filesystem quotas.
root_dir.cap (optional): The command-line tools will read a directory cap out of
-this file and use it, if you don't specify a '--dir-uri' option or if you
-specify '--dir-uri=root'.
+this file and use it, if you don't specify a '--dir-cap' option or if you
+specify '--dir-cap=root'.
== Node State ==
["node-url", "u", None,
"URL of the tahoe node to use, a URL like \"http://127.0.0.1:8123\". "
"This overrides the URL found in the --node-directory ."],
- ["dir-uri", "r", "root",
+ ["dir-cap", "r", "root",
"Which dirnode URI should be used as a root directory. The "
"string 'root' is special, and means we should use the "
"directory found in the 'root_dir.cap' file in the 'private' "
self['node-url'] = open(node_url_file, "r").read().strip()
rootdircap = None
- if self['dir-uri'] == 'root':
+ if self['dir-cap'] == 'root':
uri_file = os.path.join(self['node-directory'], 'private', "root_dir.cap")
try:
rootdircap = open(uri_file, "r").read().strip()
except EnvironmentError, le:
raise usage.UsageError("\n"
- "If --dir-uri is absent or is 'root', then the node directory's 'private'\n"
+ "If --dir-cap is absent or is 'root', then the node directory's 'private'\n"
"subdirectory is required to contain a file named 'root_dir.cap' which must\n"
"contain a dir cap, but when we tried to open that file we got:\n"
"'%s'." % (le,))
else:
- rootdircap = self['dir-uri']
+ rootdircap = self['dir-cap']
from allmydata import uri
try:
parsed = uri.NewDirectoryURI.init_from_human_encoding(rootdircap)
try:
parsed = uri.ReadonlyNewDirectoryURI.init_from_human_encoding(rootdircap)
except:
- if self['dir-uri'] == 'root':
+ if self['dir-cap'] == 'root':
raise usage.UsageError("\n"
- "If --dir-uri is absent or is 'root', then the node directory's 'private'\n"
+ "If --dir-cap is absent or is 'root', then the node directory's 'private'\n"
"subdirectory's 'root_dir.cap' is required to contain a dir cap, but we found\n"
"'%s'." % (rootdircap,))
else:
- raise usage.UsageError("--dir-uri must be a dir cap (or \"root\"), but we got '%s'." % (self['dir-uri'],))
+ raise usage.UsageError("--dir-cap must be a dir cap (or \"root\"), but we got '%s'." % (self['dir-cap'],))
- self['dir-uri'] = parsed.to_string()
+ self['dir-cap'] = parsed.to_string()
class ListOptions(VDriveOptions):
def parseArgs(self, vdrive_pathname=""):
def list(config, stdout, stderr):
from allmydata.scripts import tahoe_ls
rc = tahoe_ls.list(config['node-url'],
- config['dir-uri'],
+ config['dir-cap'],
config['vdrive_pathname'],
stdout, stderr)
return rc
vdrive_filename = config['vdrive_filename']
local_filename = config['local_filename']
rc = tahoe_get.get(config['node-url'],
- config['dir-uri'],
+ config['dir-cap'],
vdrive_filename,
local_filename,
stdout, stderr)
else:
verbosity = 2
rc = tahoe_put.put(config['node-url'],
- config['dir-uri'],
+ config['dir-cap'],
local_filename,
vdrive_filename,
verbosity,
else:
verbosity = 2
rc = tahoe_rm.rm(config['node-url'],
- config['dir-uri'],
+ config['dir-cap'],
vdrive_pathname,
verbosity,
stdout, stderr)
frompath = config['from']
topath = config['to']
rc = tahoe_mv.mv(config['node-url'],
- config['dir-uri'],
+ config['dir-cap'],
frompath,
topath,
stdout, stderr)
nodeurl = config['node-url']
if nodeurl[-1] != "/":
nodeurl += "/"
- url = nodeurl + "uri/%s/" % urllib.quote(config['dir-uri'])
+ url = nodeurl + "uri/%s/" % urllib.quote(config['dir-cap'])
if config['vdrive_pathname']:
url += urllib.quote(config['vdrive_pathname'])
webbrowser.open(url)
import optparse, re
parser = optparse.OptionParser()
parser.add_option("-u", "--nodeurl", dest="nodeurl")
- parser.add_option("-r", "--dir-uri", dest="rooturi")
+ parser.add_option("-r", "--dir-cap", dest="rooturi")
(options, args) = parser.parse_args()
raise ValueError("--node-url is required to be a string and look like \"http://HOSTNAMEORADDR:PORT\", not: %r" % (options.nodeurl,))
if not options.rooturi:
- raise ValueError("must provide --dir-uri")
+ raise ValueError("must provide --dir-cap")
vdrive_fname = args[0]
local_file = None
import optparse, re
parser = optparse.OptionParser()
parser.add_option("-u", "--node-url", dest="nodeurl")
- parser.add_option("-r", "--dir-uri", dest="rooturi")
+ parser.add_option("-r", "--dir-cap", dest="rooturi")
(options, args) = parser.parse_args()
raise ValueError("--node-url is required to be a string and look like \"http://HOSTNAMEORADDR:PORT\", not: %r" % (options.nodeurl,))
if not options.rooturi:
- raise ValueError("must provide --dir-uri")
+ raise ValueError("must provide --dir-cap")
vdrive_pathname = ""
if args:
import optparse, re
parser = optparse.OptionParser()
parser.add_option("-u", "--node-url", dest="nodeurl")
- parser.add_option("-r", "--dir-uri", dest="rooturi")
+ parser.add_option("-r", "--dir-cap", dest="rooturi")
(options, args) = parser.parse_args()
raise ValueError("--node-url is required to be a string and look like \"http://HOSTNAMEORADDR:PORT\", not: %r" % (options.nodeurl,))
if not options.rooturi:
- raise ValueError("must provide --dir-uri")
+ raise ValueError("must provide --dir-cap")
local_file = args[0]
vdrive_fname = None
import optparse, re
parser = optparse.OptionParser()
parser.add_option("-u", "--node-url", dest="nodeurl")
- parser.add_option("-r", "--dir-uri", dest="rooturi")
+ parser.add_option("-r", "--dir-cap", dest="rooturi")
(options, args) = parser.parse_args()
raise ValueError("--node-url is required to be a string and look like \"http://HOSTNAMEORADDR:PORT\", not: %r" % (options.nodeurl,))
if not options.rooturi:
- raise ValueError("must provide --dir-uri")
+ raise ValueError("must provide --dir-cap")
vdrive_pathname = args[0]
o = cli.ListOptions()
o.parseOptions(["--node-directory", "cli/test_options"])
self.failUnlessEqual(o['node-url'], "http://localhost:8080/")
- self.failUnlessEqual(o['dir-uri'], private_uri)
+ self.failUnlessEqual(o['dir-cap'], private_uri)
self.failUnlessEqual(o['vdrive_pathname'], "")
o = cli.ListOptions()
o.parseOptions(["--node-directory", "cli/test_options",
"--node-url", "http://example.org:8111/"])
self.failUnlessEqual(o['node-url'], "http://example.org:8111/")
- self.failUnlessEqual(o['dir-uri'], private_uri)
+ self.failUnlessEqual(o['dir-cap'], private_uri)
self.failUnlessEqual(o['vdrive_pathname'], "")
o = cli.ListOptions()
o.parseOptions(["--node-directory", "cli/test_options",
- "--dir-uri", "root"])
+ "--dir-cap", "root"])
self.failUnlessEqual(o['node-url'], "http://localhost:8080/")
- self.failUnlessEqual(o['dir-uri'], private_uri)
+ self.failUnlessEqual(o['dir-cap'], private_uri)
self.failUnlessEqual(o['vdrive_pathname'], "")
o = cli.ListOptions()
fingerprint="\x11"*32)
other_uri = uri.NewDirectoryURI(other_filenode_uri).to_string()
o.parseOptions(["--node-directory", "cli/test_options",
- "--dir-uri", other_uri])
+ "--dir-cap", other_uri])
self.failUnlessEqual(o['node-url'], "http://localhost:8080/")
- self.failUnlessEqual(o['dir-uri'], other_uri)
+ self.failUnlessEqual(o['dir-cap'], other_uri)
self.failUnlessEqual(o['vdrive_pathname'], "")
o = cli.ListOptions()
o.parseOptions(["--node-directory", "cli/test_options",
- "--dir-uri", other_uri, "subdir"])
+ "--dir-cap", other_uri, "subdir"])
self.failUnlessEqual(o['node-url'], "http://localhost:8080/")
- self.failUnlessEqual(o['dir-uri'], other_uri)
+ self.failUnlessEqual(o['dir-cap'], other_uri)
self.failUnlessEqual(o['vdrive_pathname'], "subdir")
nodeargs = [
"--node-url", self.webish_url,
- "--dir-uri", private_uri,
+ "--dir-cap", private_uri,
]
public_nodeargs = [
"--node-url", self.webish_url,
- "--dir-uri", some_uri,
+ "--dir-cap", some_uri,
]
TESTDATA = "I will not write the same thing over and over.\n" * 100