From 417c17755bdea0452088ff2cf4e2847e3e0ee6c2 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 11 Jan 2007 20:51:27 -0700 Subject: [PATCH] use the word 'codec' for erasure coding, for now. 'encode' is used for file-level segmentation/hashing --- src/allmydata/{encode.py => codec.py} | 0 src/allmydata/download.py | 6 +++--- src/allmydata/encode_new.py | 2 +- src/allmydata/test/{test_encode_share.py => test_codec.py} | 2 +- src/allmydata/upload.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) rename src/allmydata/{encode.py => codec.py} (100%) rename src/allmydata/test/{test_encode_share.py => test_codec.py} (98%) diff --git a/src/allmydata/encode.py b/src/allmydata/codec.py similarity index 100% rename from src/allmydata/encode.py rename to src/allmydata/codec.py diff --git a/src/allmydata/download.py b/src/allmydata/download.py index a344d039..8646f788 100644 --- a/src/allmydata/download.py +++ b/src/allmydata/download.py @@ -6,7 +6,7 @@ from twisted.internet import defer from twisted.application import service from allmydata.util import idlib -from allmydata import encode +from allmydata import codec class NotEnoughPeersError(Exception): pass @@ -34,8 +34,8 @@ class FileDownloader: n = self._shares = 4 k = self._desired_shares = 2 self._target.open() - self._decoder = encode.Decoder(self._target, k, n, - self._verifierid) + self._decoder = codec.Decoder(self._target, k, n, + self._verifierid) def start(self): log.msg("starting download") diff --git a/src/allmydata/encode_new.py b/src/allmydata/encode_new.py index ec6fd66c..0da54501 100644 --- a/src/allmydata/encode_new.py +++ b/src/allmydata/encode_new.py @@ -5,7 +5,7 @@ from allmydata.chunk import HashTree, roundup_pow2 from allmydata.Crypto.Cipher import AES import sha from allmydata.util import mathutil -from allmydata.encode import PyRSEncoder +from allmydata.codec import PyRSEncoder def hash(data): return sha.new(data).digest() diff --git a/src/allmydata/test/test_encode_share.py b/src/allmydata/test/test_codec.py similarity index 98% rename from src/allmydata/test/test_encode_share.py rename to src/allmydata/test/test_codec.py index bf59d72b..cec61bb3 100644 --- a/src/allmydata/test/test_encode_share.py +++ b/src/allmydata/test/test_codec.py @@ -3,7 +3,7 @@ import os, time from twisted.trial import unittest from twisted.internet import defer from twisted.python import log -from allmydata.encode import PyRSEncoder, PyRSDecoder, ReplicatingEncoder, ReplicatingDecoder +from allmydata.codec import PyRSEncoder, PyRSDecoder, ReplicatingEncoder, ReplicatingDecoder import random class Tester: diff --git a/src/allmydata/upload.py b/src/allmydata/upload.py index 5b8588ab..28908318 100644 --- a/src/allmydata/upload.py +++ b/src/allmydata/upload.py @@ -6,7 +6,7 @@ from twisted.application import service from foolscap import Referenceable from allmydata.util import idlib -from allmydata import encode +from allmydata import codec from cStringIO import StringIO import sha @@ -37,7 +37,7 @@ class FileUploader: def make_encoder(self): self._needed_shares = 4 self._shares = 4 - self._encoder = encode.Encoder(self._filehandle, self._shares) + self._encoder = codec.Encoder(self._filehandle, self._shares) self._share_size = self._size def set_verifierid(self, vid): -- 2.45.2