From 1411f543eeafe083bed32f8d278a714f6bbb5391 Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Sat, 15 Dec 2007 20:02:15 -0800 Subject: [PATCH] Fix up the application to work with then new structure. --- .gitignore | 1 + apt-dht.py | 4 ++-- apt_dht/HTTPServer.py | 8 ++++---- apt_dht/__init__.py | 0 apt_dht/apt_dht.py | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 apt_dht/__init__.py diff --git a/.gitignore b/.gitignore index dae79de..2c4f8e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .project .pydevproject *.pyc +_trial_temp diff --git a/apt-dht.py b/apt-dht.py index fe63bd3..73c3dde 100644 --- a/apt-dht.py +++ b/apt-dht.py @@ -16,8 +16,8 @@ from twisted.internet import reactor from twisted.python import usage, log from twisted.web2 import channel -from apt_dht import AptDHT -from apt_dht_conf import config, version +from apt_dht.apt_dht import AptDHT +from apt_dht.apt_dht_conf import config, version config_file = [] diff --git a/apt_dht/HTTPServer.py b/apt_dht/HTTPServer.py index 688b296..3d0b9d3 100644 --- a/apt_dht/HTTPServer.py +++ b/apt_dht/HTTPServer.py @@ -61,10 +61,10 @@ class TopLevel(resource.Resource): else: return None, () -# if len(name) > 1: - return FileDownloader(self.directory, self.manager), segments[0:] -# else: -# return self, () + if len(name) > 1: + return FileDownloader(self.directory, self.manager), segments[0:] + else: + return self, () if __name__ == '__builtin__': # Running from twistd -y diff --git a/apt_dht/__init__.py b/apt_dht/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apt_dht/apt_dht.py b/apt_dht/apt_dht.py index d30f0b8..ecbfab6 100644 --- a/apt_dht/apt_dht.py +++ b/apt_dht/apt_dht.py @@ -20,5 +20,5 @@ class AptDHT: 200, {'content-type': http_headers.MimeType('text', 'html')}, """ -

Statistics

+

P2P Download

TODO: eventually this will cause a P2P lookup.""") -- 2.39.5