self['basedirs'] = [os.path.abspath(os.path.expanduser(b)) for b in self.basedirs]
def parseArgs(self, *args):
- from allmydata.util.assertutil import precondition
self.basedirs = []
if self['basedir']:
precondition(isinstance(self['basedir'], (str, unicode)), self['basedir'])
class NoDefaultBasedirMixin(BasedirMixin):
def parseArgs(self, *args):
- from allmydata.util.assertutil import precondition
# create-client won't default to --basedir=~/.tahoe
self.basedirs = []
if self['basedir']:
import os.path
import codecs
-import sys
from allmydata import uri
from allmydata.scripts.common_http import do_http, check_http_error
from allmydata.scripts.common import get_aliases
from allmydata.scripts.common_http import do_http
from allmydata.util import time_format
from allmydata.scripts import backupdb
-import sys
from allmydata.util.stringutils import unicode_to_stdout, listdir_unicode, open_unicode
from allmydata.util.assertutil import precondition
-from twisted.python import usage
class HTTPError(Exception):
import os.path
import urllib
import simplejson
-import sys
from cStringIO import StringIO
from twisted.python.failure import Failure
from allmydata.scripts.common import get_alias, escape_path, \
DefaultAliasMarker, UnknownAliasError
from allmydata.scripts.common_http import do_http
from allmydata import uri
-from twisted.python import usage
from allmydata.util.stringutils import unicode_to_url, listdir_unicode, open_unicode
from allmydata.util.assertutil import precondition
from twisted.internet import threads # CLI tests use deferToThread
from twisted.python import usage
-from allmydata.util.stringutils import listdir_unicode, open_unicode, \
- unicode_platform, FilenameEncodingError
+from allmydata.util.stringutils import listdir_unicode, unicode_platform, FilenameEncodingError
timeout = 480 # deep_check takes 360s on Zandr's linksys box, others take > 240s
self.basedir = "cli/CreateAlias/create_unicode"
self.set_up_grid()
- aliasfile = os.path.join(self.get_clientdir(), "private", "aliases")
d = self.do_cli("create-alias", "études")
def _check_create_unicode((rc,stdout,stderr)):
d.addCallback(lambda res: self.do_cli("get",
get_aliases(self.get_clientdir())[u"études"] + "/lumière.txt"))
- def _check_get((rc, stdout, stderr)):
+ def _check_get2((rc, stdout, stderr)):
self.failUnlessEqual(rc, 0)
self.failIf(stderr)
self.failUnlessEqual(stdout, "Let the sunshine In!")
- d.addCallback(_check_get)
+ d.addCallback(_check_get2)
return d
self.set_up_grid()
rel_fn = os.path.join(self.basedir, "DATAFILE")
- abs_fn = os.path.abspath(rel_fn)
# we make the file small enough to fit in a LIT file, for speed
DATA = "short file"
f = open(rel_fn, "w")
-import re, struct, traceback, gc, time, calendar
+import re, struct, traceback, time, calendar
from stat import S_IFREG, S_IFDIR
from twisted.trial import unittest
# deliberate race between openFile and renameFile
d3 = self.handler.renameFile("new", "new2")
+ del d3
return d2
d.addCallback(_open_and_rename_race)
def _write_rename_race(wf):