From 0ed6260a3c1bf67b25557a0dd759777196b962cb Mon Sep 17 00:00:00 2001 From: Marcus Wanner Date: Thu, 17 Nov 2011 21:49:23 +0000 Subject: [PATCH] 1585-webui.darcs.patch --- src/allmydata/test/test_web.py | 2 +- src/allmydata/web/check-and-repair-results.xhtml | 3 +-- src/allmydata/web/check-results.xhtml | 3 +-- .../web/deep-check-and-repair-results.xhtml | 3 +-- src/allmydata/web/deep-check-results.xhtml | 3 +-- src/allmydata/web/directory.xhtml | 3 +-- src/allmydata/web/download-status-timeline.xhtml | 3 +-- src/allmydata/web/download-status.xhtml | 3 +-- src/allmydata/web/helper.xhtml | 3 +-- src/allmydata/web/info.xhtml | 3 +-- src/allmydata/web/literal-check-results.xhtml | 3 +-- src/allmydata/web/manifest.xhtml | 2 +- src/allmydata/web/map-update-status.xhtml | 3 +-- src/allmydata/web/provisioning.xhtml | 3 +-- src/allmydata/web/publish-status.xhtml | 3 +-- src/allmydata/web/reliability.xhtml | 3 +-- src/allmydata/web/rename-form.xhtml | 3 +-- src/allmydata/web/retrieve-status.xhtml | 3 +-- src/allmydata/web/root.py | 14 ++++---------- src/allmydata/web/{ => static}/d3-2.4.6.min.js | 0 .../web/{ => static}/d3-2.4.6.time.min.js | 0 .../web/{ => static}/download_status_timeline.js | 0 src/allmydata/web/{ => static}/jquery-1.6.1.min.js | 0 src/allmydata/web/{ => static}/tahoe.css | 0 src/allmydata/web/statistics.xhtml | 3 +-- src/allmydata/web/status.xhtml | 2 +- src/allmydata/web/storage_status.xhtml | 1 - src/allmydata/web/upload-results.xhtml | 3 +-- src/allmydata/web/upload-status.xhtml | 3 +-- src/allmydata/web/welcome.xhtml | 3 +-- 30 files changed, 27 insertions(+), 54 deletions(-) rename src/allmydata/web/{ => static}/d3-2.4.6.min.js (100%) rename src/allmydata/web/{ => static}/d3-2.4.6.time.min.js (100%) rename src/allmydata/web/{ => static}/download_status_timeline.js (100%) rename src/allmydata/web/{ => static}/jquery-1.6.1.min.js (100%) rename src/allmydata/web/{ => static}/tahoe.css (100%) diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index dc7ab9ea3..efa89c0fb 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -1276,7 +1276,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi return d def test_CSS_FILE(self): - d = self.GET("/tahoe_css", followRedirect=True) + d = self.GET("/tahoe.css", followRedirect=True) def _check(res): CSS_STYLE=re.compile('toolbar\s{.+text-align:\scenter.+toolbar-item.+display:\sinline',re.DOTALL) self.failUnless(CSS_STYLE.search(res), res) diff --git a/src/allmydata/web/check-and-repair-results.xhtml b/src/allmydata/web/check-and-repair-results.xhtml index 6d27af6f0..c8476199e 100644 --- a/src/allmydata/web/check-and-repair-results.xhtml +++ b/src/allmydata/web/check-and-repair-results.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Check Results - - + diff --git a/src/allmydata/web/check-results.xhtml b/src/allmydata/web/check-results.xhtml index 06e527d32..9d9c53b07 100644 --- a/src/allmydata/web/check-results.xhtml +++ b/src/allmydata/web/check-results.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Check Results - - + diff --git a/src/allmydata/web/deep-check-and-repair-results.xhtml b/src/allmydata/web/deep-check-and-repair-results.xhtml index 7dd1793a9..e52a06e4a 100644 --- a/src/allmydata/web/deep-check-and-repair-results.xhtml +++ b/src/allmydata/web/deep-check-and-repair-results.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Deep Check Results - - + diff --git a/src/allmydata/web/deep-check-results.xhtml b/src/allmydata/web/deep-check-results.xhtml index 6b0f81b88..91f862238 100644 --- a/src/allmydata/web/deep-check-results.xhtml +++ b/src/allmydata/web/deep-check-results.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Deep Check Results - - + diff --git a/src/allmydata/web/directory.xhtml b/src/allmydata/web/directory.xhtml index 4875738d5..4bcee9aa3 100644 --- a/src/allmydata/web/directory.xhtml +++ b/src/allmydata/web/directory.xhtml @@ -1,7 +1,6 @@ - - + diff --git a/src/allmydata/web/download-status-timeline.xhtml b/src/allmydata/web/download-status-timeline.xhtml index 0a7002c10..1f36d2196 100644 --- a/src/allmydata/web/download-status-timeline.xhtml +++ b/src/allmydata/web/download-status-timeline.xhtml @@ -1,8 +1,7 @@ AllMyData - Tahoe - File Download Status Timeline - - + diff --git a/src/allmydata/web/download-status.xhtml b/src/allmydata/web/download-status.xhtml index b3560ed76..5ee3c8bf7 100644 --- a/src/allmydata/web/download-status.xhtml +++ b/src/allmydata/web/download-status.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - File Download Status - - + diff --git a/src/allmydata/web/helper.xhtml b/src/allmydata/web/helper.xhtml index 05f185e23..b3c6c26f5 100644 --- a/src/allmydata/web/helper.xhtml +++ b/src/allmydata/web/helper.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Helper Status - - + diff --git a/src/allmydata/web/info.xhtml b/src/allmydata/web/info.xhtml index 0c82064e3..dcc8b39db 100644 --- a/src/allmydata/web/info.xhtml +++ b/src/allmydata/web/info.xhtml @@ -1,7 +1,6 @@ - - + diff --git a/src/allmydata/web/literal-check-results.xhtml b/src/allmydata/web/literal-check-results.xhtml index aa1179827..ee990dfb4 100644 --- a/src/allmydata/web/literal-check-results.xhtml +++ b/src/allmydata/web/literal-check-results.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Check Results - - + diff --git a/src/allmydata/web/manifest.xhtml b/src/allmydata/web/manifest.xhtml index ecc6e0cc6..5c53360ac 100644 --- a/src/allmydata/web/manifest.xhtml +++ b/src/allmydata/web/manifest.xhtml @@ -1,7 +1,7 @@ - + diff --git a/src/allmydata/web/map-update-status.xhtml b/src/allmydata/web/map-update-status.xhtml index a4c1a7df9..29661f620 100644 --- a/src/allmydata/web/map-update-status.xhtml +++ b/src/allmydata/web/map-update-status.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Mutable File Servermap Update Status - - + diff --git a/src/allmydata/web/provisioning.xhtml b/src/allmydata/web/provisioning.xhtml index 1217bf9c6..d28c4e292 100644 --- a/src/allmydata/web/provisioning.xhtml +++ b/src/allmydata/web/provisioning.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Provisioning Tool - - + diff --git a/src/allmydata/web/publish-status.xhtml b/src/allmydata/web/publish-status.xhtml index 38e6dacbc..f8b2b1c11 100644 --- a/src/allmydata/web/publish-status.xhtml +++ b/src/allmydata/web/publish-status.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Mutable File Publish Status - - + diff --git a/src/allmydata/web/reliability.xhtml b/src/allmydata/web/reliability.xhtml index 795bf6231..bc06805fb 100644 --- a/src/allmydata/web/reliability.xhtml +++ b/src/allmydata/web/reliability.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Reliability Tool - - + diff --git a/src/allmydata/web/rename-form.xhtml b/src/allmydata/web/rename-form.xhtml index 55399a345..b29b06c91 100644 --- a/src/allmydata/web/rename-form.xhtml +++ b/src/allmydata/web/rename-form.xhtml @@ -1,8 +1,7 @@ - - + diff --git a/src/allmydata/web/retrieve-status.xhtml b/src/allmydata/web/retrieve-status.xhtml index 4e457f47f..48e9d751b 100644 --- a/src/allmydata/web/retrieve-status.xhtml +++ b/src/allmydata/web/retrieve-status.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Mutable File Retrieve Status - - + diff --git a/src/allmydata/web/root.py b/src/allmydata/web/root.py index 3fbe5b886..6481289db 100644 --- a/src/allmydata/web/root.py +++ b/src/allmydata/web/root.py @@ -1,4 +1,4 @@ -import time +import time, os from twisted.internet import address from twisted.web import http @@ -168,21 +168,15 @@ class Root(rend.Page): self.child_named = FileHandler(client) self.child_status = status.Status(client.get_history()) self.child_statistics = status.Statistics(client.stats_provider) - def f(name): - return nevow_File(resource_filename('allmydata.web', name)) - self.putChild("download_status_timeline.js", f("download_status_timeline.js")) - self.putChild("jquery-1.6.1.min.js", f("jquery-1.6.1.min.js")) - self.putChild("d3-2.4.6.min.js", f("d3-2.4.6.min.js")) - self.putChild("d3-2.4.6.time.min.js", f("d3-2.4.6.time.min.js")) + static_dir = resource_filename("allmydata.web", "static") + for filen in os.listdir(static_dir): + self.putChild(filen, nevow_File(os.path.join(static_dir, filen))) def child_helper_status(self, ctx): # the Helper isn't attached until after the Tub starts, so this child # needs to created on each request return status.HelperStatus(self.client.helper) - child_webform_css = webform.defaultCSS - child_tahoe_css = nevow_File(resource_filename('allmydata.web', 'tahoe.css')) - child_provisioning = provisioning.ProvisioningTool() if reliability.is_available(): child_reliability = reliability.ReliabilityTool() diff --git a/src/allmydata/web/d3-2.4.6.min.js b/src/allmydata/web/static/d3-2.4.6.min.js similarity index 100% rename from src/allmydata/web/d3-2.4.6.min.js rename to src/allmydata/web/static/d3-2.4.6.min.js diff --git a/src/allmydata/web/d3-2.4.6.time.min.js b/src/allmydata/web/static/d3-2.4.6.time.min.js similarity index 100% rename from src/allmydata/web/d3-2.4.6.time.min.js rename to src/allmydata/web/static/d3-2.4.6.time.min.js diff --git a/src/allmydata/web/download_status_timeline.js b/src/allmydata/web/static/download_status_timeline.js similarity index 100% rename from src/allmydata/web/download_status_timeline.js rename to src/allmydata/web/static/download_status_timeline.js diff --git a/src/allmydata/web/jquery-1.6.1.min.js b/src/allmydata/web/static/jquery-1.6.1.min.js similarity index 100% rename from src/allmydata/web/jquery-1.6.1.min.js rename to src/allmydata/web/static/jquery-1.6.1.min.js diff --git a/src/allmydata/web/tahoe.css b/src/allmydata/web/static/tahoe.css similarity index 100% rename from src/allmydata/web/tahoe.css rename to src/allmydata/web/static/tahoe.css diff --git a/src/allmydata/web/statistics.xhtml b/src/allmydata/web/statistics.xhtml index b10d67930..f038ee172 100644 --- a/src/allmydata/web/statistics.xhtml +++ b/src/allmydata/web/statistics.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - Stats - - + diff --git a/src/allmydata/web/status.xhtml b/src/allmydata/web/status.xhtml index d891e0d81..fef0e804f 100644 --- a/src/allmydata/web/status.xhtml +++ b/src/allmydata/web/status.xhtml @@ -1,7 +1,7 @@ Tahoe-LAFS - Current Uploads/Downloads - + diff --git a/src/allmydata/web/storage_status.xhtml b/src/allmydata/web/storage_status.xhtml index 3133a7090..3ab0ee667 100644 --- a/src/allmydata/web/storage_status.xhtml +++ b/src/allmydata/web/storage_status.xhtml @@ -1,7 +1,6 @@ Tahoe-LAFS - Storage Server Status - diff --git a/src/allmydata/web/upload-results.xhtml b/src/allmydata/web/upload-results.xhtml index 2886fc347..f9ff3f77d 100644 --- a/src/allmydata/web/upload-results.xhtml +++ b/src/allmydata/web/upload-results.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - File Uploaded - - + diff --git a/src/allmydata/web/upload-status.xhtml b/src/allmydata/web/upload-status.xhtml index 7c5633fc5..0ea9d0876 100644 --- a/src/allmydata/web/upload-status.xhtml +++ b/src/allmydata/web/upload-status.xhtml @@ -1,8 +1,7 @@ Tahoe-LAFS - File Upload Status - - + diff --git a/src/allmydata/web/welcome.xhtml b/src/allmydata/web/welcome.xhtml index c2b1d174c..8abb31234 100644 --- a/src/allmydata/web/welcome.xhtml +++ b/src/allmydata/web/welcome.xhtml @@ -1,7 +1,6 @@ Tahoe-LAFS - Welcome - - +