From c6f52e379a3a5c907d60f5c6a49a7393e56d29b7 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 13 Jul 2007 17:25:45 -0700 Subject: [PATCH] rename storageserver.py to just storage.py, since it has both server and client sides now --- src/allmydata/client.py | 2 +- src/allmydata/download.py | 4 ++-- src/allmydata/scripts/debug.py | 4 ++-- .../{storageserver.py => storage.py} | 0 src/allmydata/test/test_storage.py | 2 +- src/allmydata/upload.py | 20 +++++++++---------- 6 files changed, 16 insertions(+), 16 deletions(-) rename src/allmydata/{storageserver.py => storage.py} (100%) diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 21c66f3a..d0099e3e 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -11,7 +11,7 @@ from twisted.python import log import allmydata from allmydata.Crypto.Util.number import bytes_to_long -from allmydata.storageserver import StorageServer +from allmydata.storage import StorageServer from allmydata.upload import Uploader from allmydata.download import Downloader from allmydata.webish import WebishServer diff --git a/src/allmydata/download.py b/src/allmydata/download.py index 59649c9c..f76b13c3 100644 --- a/src/allmydata/download.py +++ b/src/allmydata/download.py @@ -7,7 +7,7 @@ from twisted.application import service from allmydata.util import idlib, mathutil, hashutil from allmydata.util.assertutil import _assert -from allmydata import codec, hashtree, storageserver, uri +from allmydata import codec, hashtree, storage, uri from allmydata.Crypto.Cipher import AES from allmydata.interfaces import IDownloadTarget, IDownloader from allmydata.encode import NotEnoughPeersError @@ -345,7 +345,7 @@ class FileDownloader: def _got_response(self, buckets, connection): _assert(isinstance(buckets, dict), buckets) # soon foolscap will check this for us with its DictOf schema constraint for sharenum, bucket in buckets.iteritems(): - b = storageserver.ReadBucketProxy(bucket) + b = storage.ReadBucketProxy(bucket) self.add_share_bucket(sharenum, b) self._uri_extension_sources.append(b) diff --git a/src/allmydata/scripts/debug.py b/src/allmydata/scripts/debug.py index d6a53885..773c6748 100644 --- a/src/allmydata/scripts/debug.py +++ b/src/allmydata/scripts/debug.py @@ -43,12 +43,12 @@ class DumpDirnodeOptions(BasedirMixin, usage.Options): raise usage.UsageError(" parameter is required") def dump_uri_extension(config, out=sys.stdout, err=sys.stderr): - from allmydata import uri, storageserver + from allmydata import uri, storage filename = config['filename'] f = open(filename,"rb") # use a ReadBucketProxy to parse the bucket and find the uri extension - bp = storageserver.ReadBucketProxy(None) + bp = storage.ReadBucketProxy(None) offsets = bp._parse_offsets(f.read(8*4)) f.seek(offsets['uri_extension']) length = struct.unpack(">L", f.read(4))[0] diff --git a/src/allmydata/storageserver.py b/src/allmydata/storage.py similarity index 100% rename from src/allmydata/storageserver.py rename to src/allmydata/storage.py diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index 01e282a8..d58b064b 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -7,7 +7,7 @@ from foolscap import Referenceable import os.path from allmydata import interfaces from allmydata.util import fileutil, hashutil -from allmydata.storageserver import BucketWriter, BucketReader, \ +from allmydata.storage import BucketWriter, BucketReader, \ WriteBucketProxy, ReadBucketProxy, StorageServer diff --git a/src/allmydata/upload.py b/src/allmydata/upload.py index 404b86de..bebb4649 100644 --- a/src/allmydata/upload.py +++ b/src/allmydata/upload.py @@ -5,7 +5,7 @@ from twisted.application import service from foolscap import Referenceable from allmydata.util import idlib, hashutil -from allmydata import encode, storageserver, hashtree +from allmydata import encode, storage, hashtree from allmydata.uri import pack_uri, pack_lit from allmydata.interfaces import IUploadable, IUploader from allmydata.Crypto.Cipher import AES @@ -39,10 +39,10 @@ class PeerTracker: self.buckets = {} # k: shareid, v: IRemoteBucketWriter self.sharesize = sharesize #print "PeerTracker", peerid, permutedid, sharesize - as = storageserver.allocated_size(sharesize, - num_segments, - num_share_hashes, - EXTENSION_SIZE) + as = storage.allocated_size(sharesize, + num_segments, + num_share_hashes, + EXTENSION_SIZE) self.allocated_size = as self.blocksize = blocksize @@ -74,11 +74,11 @@ class PeerTracker: #log.msg("%s._got_reply(%s)" % (self, (alreadygot, buckets))) b = {} for sharenum, rref in buckets.iteritems(): - bp = storageserver.WriteBucketProxy(rref, self.sharesize, - self.blocksize, - self.num_segments, - self.num_share_hashes, - EXTENSION_SIZE) + bp = storage.WriteBucketProxy(rref, self.sharesize, + self.blocksize, + self.num_segments, + self.num_share_hashes, + EXTENSION_SIZE) b[sharenum] = bp self.buckets.update(b) return (alreadygot, set(b.keys())) -- 2.45.2