From 748e419a9b4c94ebd934022ff6e473425fe90504 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Sat, 3 Sep 2011 19:59:06 -0700
Subject: [PATCH] move DownloadStopped from download.common to interfaces

---
 src/allmydata/immutable/downloader/common.py       | 3 ---
 src/allmydata/immutable/downloader/segmentation.py | 3 ++-
 src/allmydata/interfaces.py                        | 3 +++
 src/allmydata/test/test_download.py                | 5 +++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/allmydata/immutable/downloader/common.py b/src/allmydata/immutable/downloader/common.py
index e9dd2719..7e5f4ded 100644
--- a/src/allmydata/immutable/downloader/common.py
+++ b/src/allmydata/immutable/downloader/common.py
@@ -8,6 +8,3 @@ class WrongSegmentError(Exception):
     pass
 class BadCiphertextHashError(Exception):
     pass
-
-class DownloadStopped(Exception):
-    pass
diff --git a/src/allmydata/immutable/downloader/segmentation.py b/src/allmydata/immutable/downloader/segmentation.py
index 84dddbe9..07307c36 100644
--- a/src/allmydata/immutable/downloader/segmentation.py
+++ b/src/allmydata/immutable/downloader/segmentation.py
@@ -7,8 +7,9 @@ from twisted.internet.interfaces import IPushProducer
 from foolscap.api import eventually
 from allmydata.util import log
 from allmydata.util.spans import overlap
+from allmydata.interfaces import DownloadStopped
 
-from common import BadSegmentNumberError, WrongSegmentError, DownloadStopped
+from common import BadSegmentNumberError, WrongSegmentError
 
 class Segmentation:
     """I am responsible for a single offset+size read of the file. I handle
diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py
index 3081e94e..9536320d 100644
--- a/src/allmydata/interfaces.py
+++ b/src/allmydata/interfaces.py
@@ -1055,6 +1055,9 @@ class NotEnoughSharesError(Exception):
 class NoSharesError(Exception):
     """Download was unable to get any shares at all."""
 
+class DownloadStopped(Exception):
+    pass
+
 class UploadUnhappinessError(Exception):
     """Upload was unable to satisfy 'servers_of_happiness'"""
 
diff --git a/src/allmydata/test/test_download.py b/src/allmydata/test/test_download.py
index e5357085..30485b4a 100644
--- a/src/allmydata/test/test_download.py
+++ b/src/allmydata/test/test_download.py
@@ -13,9 +13,10 @@ from allmydata.util.consumer import download_to_data, MemoryConsumer
 from allmydata.immutable import upload, layout
 from allmydata.test.no_network import GridTestMixin, NoNetworkServer
 from allmydata.test.common import ShouldFailMixin
-from allmydata.interfaces import NotEnoughSharesError, NoSharesError
+from allmydata.interfaces import NotEnoughSharesError, NoSharesError, \
+     DownloadStopped
 from allmydata.immutable.downloader.common import BadSegmentNumberError, \
-     BadCiphertextHashError, DownloadStopped, COMPLETE, OVERDUE, DEAD
+     BadCiphertextHashError, COMPLETE, OVERDUE, DEAD
 from allmydata.immutable.downloader.status import DownloadStatus
 from allmydata.immutable.downloader.fetcher import SegmentFetcher
 from allmydata.codec import CRSDecoder
-- 
2.45.2