self.basedirs.extend(args)
else:
if len(args) == 0 and not self.basedirs:
- self.basedirs.append(".")
+ self.basedirs.append(os.path.expanduser("~/.tahoe"))
if len(args) > 0:
self.basedirs.append(args[0])
if len(args) > 1:
class NoDefaultBasedirMixin(BasedirMixin):
def parseArgs(self, *args):
- # create-client won't default to --basedir=.
+ # create-client won't default to --basedir=~/.tahoe
self.basedirs = []
if self['basedir']:
self.basedirs.append(self['basedir'])
import os, sys
from twisted.python import usage
-from allmydata.scripts.common import NoDefaultBasedirMixin
+from allmydata.scripts.common import BasedirMixin, NoDefaultBasedirMixin
-class CreateClientOptions(NoDefaultBasedirMixin, usage.Options):
+class CreateClientOptions(BasedirMixin, usage.Options):
optParameters = [
["basedir", "C", None, "which directory to create the client in"],
]
["create-client", "basedir", "extraarg"],
run_by_human=False)
- self.failUnlessRaises(usage.UsageError,
- runner.runner,
- ["create-client"],
- run_by_human=False)
-
def test_introducer(self):
basedir = self.workdir("test_introducer")
c1 = os.path.join(basedir, "c1")