]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
rename "dir-uri" to "dir-cap"
authorZooko O'Whielacronx <zooko@zooko.com>
Tue, 8 Jan 2008 17:41:27 +0000 (10:41 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Tue, 8 Jan 2008 17:41:27 +0000 (10:41 -0700)
docs/configuration.txt
src/allmydata/scripts/cli.py
src/allmydata/scripts/tahoe_get.py
src/allmydata/scripts/tahoe_ls.py
src/allmydata/scripts/tahoe_put.py
src/allmydata/scripts/tahoe_rm.py
src/allmydata/test/test_cli.py
src/allmydata/test/test_system.py

index 09ff5d3393d982099963df38e246227b4959438d..001bfe707d0ecc213086bdb9423b34114018de0d 100644 (file)
@@ -79,8 +79,8 @@ directory on a separate size-limited filesystem, and/or use per-user
 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 ==
index c5c4ef79ffb763bb4a5413186f2d2e4228fb4e82..0e063377e1cf301d5aea92fb79a5ccf804b579e8 100644 (file)
@@ -17,7 +17,7 @@ class VDriveOptions(BaseOptions, usage.Options):
         ["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' "
@@ -40,18 +40,18 @@ class VDriveOptions(BaseOptions, usage.Options):
             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)
@@ -59,15 +59,15 @@ class VDriveOptions(BaseOptions, usage.Options):
             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=""):
@@ -132,7 +132,7 @@ subCommands = [
 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
@@ -142,7 +142,7 @@ def get(config, stdout, stderr):
     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)
@@ -166,7 +166,7 @@ def put(config, stdout, stderr):
     else:
         verbosity = 2
     rc = tahoe_put.put(config['node-url'],
-                       config['dir-uri'],
+                       config['dir-cap'],
                        local_filename,
                        vdrive_filename,
                        verbosity,
@@ -181,7 +181,7 @@ def rm(config, stdout, stderr):
     else:
         verbosity = 2
     rc = tahoe_rm.rm(config['node-url'],
-                     config['dir-uri'],
+                     config['dir-cap'],
                      vdrive_pathname,
                      verbosity,
                      stdout, stderr)
@@ -192,7 +192,7 @@ def mv(config, 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)
@@ -203,7 +203,7 @@ def webopen(config, 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)
index 9b475695960aaf554d1ca810c40c05ae5e95e7cb..8c4b60bf0a3bb3c057a4b9096b171ca854ae6137 100644 (file)
@@ -31,7 +31,7 @@ def main():
     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()
 
@@ -40,7 +40,7 @@ def main():
         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
index ad9fbcc6a1985577b1fb8501dbd5d4203e3866a6..025e14f40fc1e5c5b4307351dfb04ca76f96e565 100644 (file)
@@ -34,7 +34,7 @@ def main():
     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()
 
@@ -43,7 +43,7 @@ def main():
         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:
index f27e0fcfbb136cdff314be6bc421c5a96fb68697..c81ec9c2138e251b603c2931fa15d1be44fd70df 100644 (file)
@@ -31,7 +31,7 @@ def main():
     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()
 
@@ -40,7 +40,7 @@ def main():
         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
index 32e95316dcb3d2ecd978e2d6ac82fede08ec87df..d9106f3ab866ba5371864f61cbceb093ecd04774 100644 (file)
@@ -29,7 +29,7 @@ def main():
     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()
 
@@ -38,7 +38,7 @@ def main():
         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]
 
index ed355b4d01c5297a1c50c7764e0e3478143696cc..a1e19b72f1046b04a5e91c7bbb564564810bf57a 100644 (file)
@@ -24,21 +24,21 @@ class CLI(unittest.TestCase):
         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()
@@ -51,14 +51,14 @@ class CLI(unittest.TestCase):
                                                      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")
index e5faf4eedee6d87a6f8c31b3e7ae9731d2518ded..96df405c2c64d1d7d23c42ca99e9dae12ec9e1ca 100644 (file)
@@ -993,11 +993,11 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase):
 
         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