+import os.path
+from allmydata.util import base32
+
class DataTooLargeError(Exception):
pass
+
+def si_b2a(storageindex):
+ return base32.b2a(storageindex)
+
+def si_a2b(ascii_storageindex):
+ return base32.a2b(ascii_storageindex)
+
+def storage_index_to_dir(storageindex):
+ sia = si_b2a(storageindex)
+ return os.path.join(sia[:2], sia)
import cPickle as pickle
from twisted.internet import reactor
from twisted.application import service
-from allmydata.storage.server import si_b2a
+from allmydata.storage.common import si_b2a
from allmydata.util import fileutil
class TimeSliceExceeded(Exception):
from allmydata.util import base32, fileutil, log, time_format
import allmydata # for __full_version__
+from allmydata.storage.common import si_b2a, si_a2b, storage_index_to_dir
+_pyflakes_hush = [si_b2a, si_a2b, storage_index_to_dir] # re-exported
from allmydata.storage.lease import LeaseInfo
from allmydata.storage.mutable import MutableShareFile, EmptyShare, \
create_mutable_sharefile
# $SHARENUM matches this regex:
NUM_RE=re.compile("^[0-9]+$")
-def si_b2a(storageindex):
- return base32.b2a(storageindex)
-
-def si_a2b(ascii_storageindex):
- return base32.a2b(ascii_storageindex)
-
-def storage_index_to_dir(storageindex):
- sia = si_b2a(storageindex)
- return os.path.join(sia[:2], sia)
-
class StorageServer(service.MultiService, Referenceable):