Ticket #1286: webish-cleanup.darcs.patch

File webish-cleanup.darcs.patch, 17.8 KB (added by davidsarah, at 2011-01-18T00:07:36Z)

rc/allmydata/webish.py: clean-ups and correction to a comment. Also change an open and write to use fileutil.write. See ref #1286 comment 13.

Line 
11 patch for repository davidsarah@dev.allmydata.org:/home/darcs/tahoe/trunk:
2
3Mon Jan 17 23:31:52 GMT Standard Time 2011  david-sarah@jacaranda.org
4  * src/allmydata/webish.py: clean-ups and correction to a comment. Also change an open and write to use fileutil.write. See ref #1286 comment 13.
5
6New patches:
7
8[src/allmydata/webish.py: clean-ups and correction to a comment. Also change an open and write to use fileutil.write. See ref #1286 comment 13.
9david-sarah@jacaranda.org**20110117233152
10 Ignore-this: c4aa2f4286ad8a9fba9827d428f7fbe5
11] {
12hunk ./src/allmydata/webish.py 6
13 from twisted.web import http
14 from twisted.internet import defer
15 from nevow import appserver, inevow, static
16-from allmydata.util import log
17+from allmydata.util import log, fileutil
18 
19 from allmydata.web import introweb, root
20 from allmydata.web.common import IOpHandleTable, MyExceptionHandler
21hunk ./src/allmydata/webish.py 160
22         self._scheme = None
23         self._portnum = None
24         self._url = None
25-        self.listener = s # stash it so the tests can query for the portnum
26+        self._listener = s # stash it so we can query for the portnum
27 
28         self._started = defer.Deferred()
29         if nodeurl_path:
30hunk ./src/allmydata/webish.py 164
31-            self._started.addCallback(self._write_nodeurl_file, nodeurl_path)
32+            def _write_nodeurl_file(ign):
33+                # this file will be created with default permissions
34+                fileutil.write(nodeurl_path, self.getURL() + "\n")
35+            self._started.addCallback(_write_nodeurl_file)
36 
37     def getURL(self):
38         assert self._url
39hunk ./src/allmydata/webish.py 172
40         return self._url
41+
42     def getPortnum(self):
43         assert self._portnum
44         return self._portnum
45hunk ./src/allmydata/webish.py 190
46             return f
47 
48         service.MultiService.startService(self)
49-        s = self.listener
50+        s = self._listener
51         if hasattr(s, 'endpoint') and hasattr(s, '_waitingForPort'):
52             # Twisted 10.2 gives us a StreamServerEndpointService. This is
53             # ugly but should do for now.
54hunk ./src/allmydata/webish.py 213
55             self._started.errback(AssertionError("couldn't find out the scheme or port for the web-API server"))
56 
57 
58-    def _write_nodeurl_file(self, junk, nodeurl_path):
59-        if self._url:
60-            f = open(nodeurl_path, 'wb')
61-            # this file is world-readable
62-            f.write(self._url + "\n")
63-            f.close()
64-
65 class IntroducerWebishServer(WebishServer):
66     def __init__(self, introducer, webport, nodeurl_path=None, staticdir=None):
67         service.MultiService.__init__(self)
68}
69
70Context:
71
72['tahoe debug catalog-shares': sort SIs and shnums
73Brian Warner <warner@lothar.com>**20110117095932
74 Ignore-this: f2c60da422178dfba6d03ff4957cf80c
75 
76 Without this, SIs or shnums could be emitted in random order, depending upon
77 what the filesystem happens to return.
78]
79[CLI: tests for ref #1305 (v2, remove spurious extra arg to create-alias in test)
80david-sarah@jacaranda.org**20110114040327
81 Ignore-this: 770b7117e66b04ced293b7b740b4a27f
82]
83[CLI: make 'tahoe create-alias' and 'tahoe add-alias' accept a trailing colon on the new alias name (v2, minor change not to rely on implicit Unicode conversion). Includes doc changes and news; tests in a separate patch. fixes #1305
84david-sarah@jacaranda.org**20110114034414
85 Ignore-this: 97e8e88d8b0f7c628b77db3adb67fa1b
86]
87[Improve 'tahoe ln' help text. Patch by David-Sarah. Closes #1230.
88Brian Warner <warner@lothar.com>**20110117081421
89 Ignore-this: ae0ab1525fd39c95500535d6d015e706
90]
91[Tolerate Twisted-10.2's endpoints, patch by David-Sarah. Closes #1286.
92Brian Warner <warner@lothar.com>**20110117074751
93 Ignore-this: 8875749e4cab0e444a8452e290647bb6
94 
95 The service generated by strports.service() changed in 10.2, and the ugly
96 private-attribute-reading hack we used to glean a kernel-allocated port
97 number (e.g. when using "tcp:0", especially during unit tests) broke, causing
98 Tahoe to be completely unusable with Twisted-10.2 . The new ugly
99 private-attribute-reading hack starts by figuring out what sort of service
100 was generated, then reads different attributes accordingly.
101 
102 This also hushes a warning when using schemeless strports strings like "0" or
103 "3456", by quietly prepending a "tcp:" scheme, since 10.2 complains about
104 those. It also adds getURL() and getPortnum() accessors to the "webish"
105 service, rather than having unit tests dig through _url and _portnum and such
106 to find out what they are.
107]
108[debian/control: add python-twisted-conch to dependencies. Closes #1095.
109Brian Warner <warner@lothar.com>**20110117071206
110 Ignore-this: 74714eeb8bd324d6124824f119468ab5
111]
112[Test changes to take account of ref #1311.
113david-sarah@jacaranda.org**20110117060540
114 Ignore-this: d787405b00a05d98abb34e5133a88b36
115]
116[create_node.py: add comments to default tahoe.cfg to clarify the meaning of each section. fixes #1311
117david-sarah@jacaranda.org**20110117052419
118 Ignore-this: a2b0bba6b347bb0b0247782ee9ea9419
119]
120[Undo the temporary hack to check the foolscap version. refs #1246
121david-sarah@jacaranda.org**20110117052042
122 Ignore-this: c58a8a5b91355a15d02b60c20a44bbd9
123]
124[Set "reserved_space=1G" in newly-created storage nodes. Closes #1208.
125Brian Warner <warner@lothar.com>**20110116205822
126 Ignore-this: 2aac3dbb46e181ce7ae5e0af07bbb3bb
127]
128[Makefile: allow tarball upload when either BB_BRANCH=='trunk' or BB_BRANCH==''.
129david-sarah@jacaranda.org**20110115212211
130 Ignore-this: 358822b25e69bfe9651a561ec387ca7a
131]
132[Temporary hack to investigate whether we are getting the right version of foolscap on trunk. refs #1258
133david-sarah@jacaranda.org**20110116044959
134 Ignore-this: 4760970f9235dde07472ca980c24f75b
135]
136[misc/build_helpers/run_trial.py: fix pyflakes warning.
137david-sarah@jacaranda.org**20110115080456
138 Ignore-this: 95760a442fc397526a5d921510ec3843
139]
140[misc/build_helpers/test-with-fake-dists.py: clean up directories and files only if they exist.
141david-sarah@jacaranda.org**20110115053011
142 Ignore-this: 7aa8fec370e12c62d9b56afcd55d17f
143]
144[misc/build_helpers/test-with-fake-dists.py: wrong arguments in comment.
145david-sarah@jacaranda.org**20110115045325
146 Ignore-this: 89322306ed4fb478af4988675fd4c968
147]
148[Attempt to fix test-with-fake-dist build step.
149david-sarah@jacaranda.org**20110115022651
150 Ignore-this: 9d7195dca59b79f93a5f527b1ae9e79e
151]
152[bin/tahoe-script.template: improve the error message if we end up running under Python 3. refs #1302
153david-sarah@jacaranda.org**20110112211628
154 Ignore-this: ee78f8e4bbd197e620cb0cc6b995ac46
155]
156[Makefile: Fix uploading of tarballs on trunk builds.
157david-sarah@jacaranda.org**20110109065851
158 Ignore-this: 864b06e39103f46dbb6ccb74e1e333d3
159]
160[docs/frontends/CLI.rst: fix the rst syntax to be as actually intended :-)
161david-sarah@jacaranda.org**20110109014057
162 Ignore-this: c11331670ba89d8601ba3782ffc4f32c
163]
164[docs/frontends/CLI.rst: really fix rst syntax error this time.
165david-sarah@jacaranda.org**20110109013914
166 Ignore-this: 59550154c9ab41488ddfdee8938d7bda
167]
168[docs/frontends/CLI.rst: fix rst syntax error.
169david-sarah@jacaranda.org**20110109010943
170 Ignore-this: 427444f5572115059c75fa1bd8371d51
171]
172[docs/frontends/CLI.rst: discuss commandline/output quoting issues and wildcards. refs #1135
173david-sarah@jacaranda.org**20110109010119
174 Ignore-this: 533938d89be878b404a8540aebdf68ad
175]
176[setup.py: add Python 2.7 trove classifier.
177david-sarah@jacaranda.org**20110108211212
178 Ignore-this: b479c0a1adf9b7a2d1fdc54abc6582e6
179]
180[docs/FTP-and-SFTP.rst: document issue in ref #1297. Remove known issue #1045 which is fixed. Also some cosmetic changes.
181david-sarah@jacaranda.org**20110108061038
182 Ignore-this: 8d9aa2e33f1054545f7bed47bf0e647d
183]
184[misc/build_helpers/show-tool-versions.py: remove attempts to show stdout.encoding and stderr.encoding that always printed None due to redirection. Also remove code to show os.path.supports_unicode_filenames which is not useful. refs #1251
185david-sarah@jacaranda.org**20110103015144
186 Ignore-this: 45e11431f7e2e0cebcb58e1841485cf8
187]
188[NEWS: 'top' for node processes, WUI formatting, removal of GUI apps, documentation updates, foolscap dependency. refs #174, #1219, #1225
189david-sarah@jacaranda.org**20110106005727
190 Ignore-this: f61ac58b4d10e635feb6f7391b1b48fe
191]
192[Makefile: update 'clean' target for files in bin/
193david-sarah@jacaranda.org**20110103052738
194 Ignore-this: 2bdbc4a50e13e508b66d0f65718c79b2
195]
196[docs: update performance.rst to describe the difference between already-uploaded and not-already-uploaded, to parameterize segment size, and to use "~A" to mean "approximately A"
197zooko@zooko.com**20110104065455
198 Ignore-this: 8df0d79a062ee19854c0211bd202f606
199]
200[bin/tahoe-script.template: On non-Windows, invoke support/bin/tahoe directly as a script (rather than via python), so that 'top' for example will show it as 'tahoe'. On Windows, simplify some code that set argv[0], which is never used. fixes #174
201david-sarah@jacaranda.org**20101127232650
202 Ignore-this: 42a86f3eecfdc1ea7b76a7cc68626898
203]
204[test_runner: avoid unnecessary use of non-ASCII.
205david-sarah@jacaranda.org**20110101100101
206 Ignore-this: e2ff40dce6bb3b021306f2913d4e75df
207]
208[docs/quickstart.html: fix redundant, badly nested tag. refs #1284
209david-sarah@jacaranda.org**20110102175159
210 Ignore-this: 2ae9cc0b47d2e87b9eb64a0f517c4eef
211]
212[docs/quickstart.html: information about 'troublesome dependencies' and 'verified systems' de-emphasized by smaller italic font. Re-wrap so that the HTML source is readable (just about) as text. Minor wording tweaks. Improve organization by adding 'Windows Caveats' subsection. fixes #1284
213david-sarah@jacaranda.org**20110102174212
214 Ignore-this: e9dc57983974478200856651c5318fee
215]
216[NEWS: update entry for removal of Mac and Windows apps. refs #1282
217david-sarah@jacaranda.org**20101226042245
218 Ignore-this: c8099bc6e8235718d042c9a13c1e2425
219]
220[Move dependency imports from windows/depends.py (which has gone away) into src/allmydata/windows/tahoesvc.py. Also fix a pyflakes warning, and change the service display name from 'Allmydata Tahoe Node' to 'Tahoe-LAFS node'. refs #1282
221david-sarah@jacaranda.org**20101226042100
222 Ignore-this: ee45f324934e1251380206dbee6346d0
223]
224[Remove unmaintained Windows GUI app, except for windows/tahoesvc.py which is moved to src/allmydata/windows. refs #1282
225david-sarah@jacaranda.org**20101226040237
226 Ignore-this: cae37b6622a7dd5940acc7d3e6a98b90
227]
228[Remove the Makefile targets relating to the Mac GUI app. refs #1282
229david-sarah@jacaranda.org**20101226025859
230 Ignore-this: 75303be783974b41138744ec62b07965
231]
232[NEWS: remove unmaintained Mac GUI app. refs #1282
233david-sarah@jacaranda.org**20101226020858
234 Ignore-this: 40474a07f4a550b48563d35350be7ab5
235]
236[Remove unmaintained Mac GUI app. fixes #1282
237david-sarah@jacaranda.org**20101226020508
238 Ignore-this: b3613bf1abfd284d542bf7c753ec557a
239]
240[Remove src/allmydata/util/find_exe.py which is no longer used. fixes #1150
241david-sarah@jacaranda.org**20101226023206
242 Ignore-this: 7436c9b53bf210aed34a1a973cd9cace
243]
244[status_web_pages_review.darcs.patch
245freestorm77@gmail.com**20110102034214
246 Ignore-this: 29f1ecb36177f10f3f846b3d56b313b2
247 
248 I make some changes on status web pages
249 
250 status.xhtml:
251 - Delete unused webform_css link
252 - Align tables on the left
253 
254 tahoe-css:
255 - Do some minor changes on code synthax
256 - changes table.status-download-events style to look like other tables
257 
258 status.py:
259 - Align table on the left
260 - Changes table header
261 - Add heading tags
262 - Modify google api graph: add image border, calculate height to feet data
263 
264 signed-off-by: zooko@zooko.com
265 fixes #1219
266]
267[test_storage.py: fix a pyflakes unused import warning.
268david-sarah@jacaranda.org**20101231220756
269 Ignore-this: df08231540cb7dff9d2b038e47ab30ee
270]
271[test_storage.py: leave at least 512 MiB free when running test_large_share. refs #1195
272david-sarah@jacaranda.org**20101231203215
273 Ignore-this: b2144c0341c3452b5d4ba219e284ea0e
274]
275[storage: use fileutil's version of get_disk_stats() and get_available_space(), use mockery/fakery in tests, enable large share test on platforms with sparse files and if > 4 GiB of disk space is currently available
276zooko@zooko.com**20100910173629
277 Ignore-this: 1304f1164c661de6d5304f993eb9b27b
278]
279[fileutil: copy in the get_disk_stats() and get_available_space() functions from storage/server.py
280zooko@zooko.com**20100910173520
281 Ignore-this: 8b15569715f710f4fc5092f7ca109253
282]
283[Update foolscap version requirement to 0.6.0, to address http://foolscap.lothar.com/trac/ticket/167
284david-sarah@jacaranda.org**20101231060039
285 Ignore-this: 98d2b8086a1a500b9f4565bca5a3810
286]
287[docs/webapi.rst: typos.
288david-sarah@jacaranda.org**20101230034422
289 Ignore-this: d1f5166d72cc711f7e0d9981eac9105e
290]
291[docs/webapi.rst: capitalization, formatting of section on URL character encoding, and a correction about Internet Explorer.
292david-sarah@jacaranda.org**20101230034049
293 Ignore-this: b3b9819d2fb264b4cdc5c8afd4e8c48d
294]
295[docs: corrections and clarifications.
296david-sarah@jacaranda.org**20101227051056
297 Ignore-this: e33202858c7644c58f3f924b164294b6
298]
299[docs: more formatting cleanups and corrections. Spell webapi and wapi as web-API.
300david-sarah@jacaranda.org**20101227050533
301 Ignore-this: 18b23cbfb780df585d8a722a1ec63e94
302]
303[docs/debian.rst: bring description of building dependencies from source up-to-date, and change hostname from allmydata.com to tahoe-lafs.org.
304david-sarah@jacaranda.org**20101212222912
305 Ignore-this: f38462afc88b4475195610385a28391c
306]
307[docs/architecture.rst: correct rst syntax.
308david-sarah@jacaranda.org**20101212202003
309 Ignore-this: 3fbe12feb28bec6f1c63aedbc79aad21
310]
311[docs/architecture.rst: formatting.
312david-sarah@jacaranda.org**20101212201719
313 Ignore-this: 305fa5dfc2939355eaf6d0d2161eb1ff
314]
315[docs: linkification, wording improvements.
316david-sarah@jacaranda.org**20101212201234
317 Ignore-this: 4e67287f527a8bc728cfbd93255d2aae
318]
319[docs: formatting.
320david-sarah@jacaranda.org**20101212201115
321 Ignore-this: 2e0ed394ac7726651d3a4f2c4b0d3798
322]
323[docs/configuration.rst: more formatting tweaks; which -> that.
324david-sarah@jacaranda.org**20101212195522
325 Ignore-this: a7becb7021854ca5a90edd892b36fdd7
326]
327[docs/configuration.rst: more changes to formatting.
328david-sarah@jacaranda.org**20101212194511
329 Ignore-this: 491aac33e5f5268d224359f1447d10be
330]
331[docs/configuration.rst: changes to formatting (mainly putting commands and filenames in monospace).
332david-sarah@jacaranda.org**20101212181828
333 Ignore-this: 8a1480e2d5f43bee678476424615b50f
334]
335[scripts/backupdb.py: more accurate comment about path field.
336david-sarah@jacaranda.org**20101212170320
337 Ignore-this: 50e47a2228a85207bbcd188a78a0d4e6
338]
339[scripts/cli.py: fix missing 'put' in usage example for 'tahoe put'.
340david-sarah@jacaranda.org**20101212170207
341 Ignore-this: 2cbadf066fff611fc03d3c0ff97ce6ec
342]
343[docs/frontends/CLI.rst: changes to formatting (mainly putting commands and filenames in monospace), and to command syntax to reflect that DIRCAP/... is accepted. Clarify the syntax of 'tahoe put' and other minor corrections. Tahoe -> Tahoe-LAFS.
344david-sarah@jacaranda.org**20101212165800
345 Ignore-this: a123ef6b564aa8624d1e79c97068ea12
346]
347[docs/frontends/CLI.rst: Unicode arguments to 'tahoe' work on Windows as of v1.7.1.
348david-sarah@jacaranda.org**20101212063740
349 Ignore-this: 3977a99dfa86ac33a44171deaf43aaab
350]
351[docs/known_issues.rst: fix title and linkify another URL. refs #1225
352david-sarah@jacaranda.org**20101212062817
353 Ignore-this: cc91287f7fb51c23440b3d2fe79c449c
354]
355[docs/known_issues.rst: fix an external link. refs #1225
356david-sarah@jacaranda.org**20101212062435
357 Ignore-this: b8cbf12f353131756c358965c48060ec
358]
359[Fix a link from uri.rst to dirnodes.rst. refs #1225
360david-sarah@jacaranda.org**20101212054502
361 Ignore-this: af6205299f5c9a33229cab259c00f9d5
362]
363[Fix a link from webapi.rst to FTP-and-SFTP.rst. refs #1225
364david-sarah@jacaranda.org**20101212053435
365 Ignore-this: 2b9f88678c3447ea860d6b61e8799858
366]
367[More specific hyperlink to architecture.rst from helper.rst. refs #1225
368david-sarah@jacaranda.org**20101212052607
369 Ignore-this: 50424c768fca481252fabf58424852dc
370]
371[Update hyperlinks between docs, and linkify some external references. refs #1225
372david-sarah@jacaranda.org**20101212051459
373 Ignore-this: cd43a4c3d3de1f832abfa88d5fc4ace1
374]
375[docs/specifications/dirnodes.rst: fix references to mutable.rst. refs #1225
376david-sarah@jacaranda.org**20101212012720
377 Ignore-this: 6819b4b4e06e947ee48b365e840db37d
378]
379[docs/specifications/mutable.rst: correct the magic string for v1 mutable containers. refs #1225
380david-sarah@jacaranda.org**20101212011400
381 Ignore-this: 99a5fcdd40cef83dbb08f323f6cdaaca
382]
383[Move .txt files in docs/frontends and docs/specifications to .rst. refs #1225
384david-sarah@jacaranda.org**20101212010251
385 Ignore-this: 8796d35d928370f7dc6ad2dafdc1c0fe
386]
387[Convert docs/frontends and docs/specifications to reStructuredText format (not including file moves).
388david-sarah@jacaranda.org**20101212004632
389 Ignore-this: e3ceb2d832d73875abe48624ddbb5622
390]
391[scripts/cli.py: remove the disclaimer in the help for 'tahoe cp' that it does not handle non-ASCII filenames well. (At least, we intend to handle them.)
392david-sarah@jacaranda.org**20101130002145
393 Ignore-this: 94c003efaa20b9eb4a83503d79844ca
394]
395[relnotes.txt: fifth -> sixth labor-of-love release
396zooko@zooko.com**20101129045647
397 Ignore-this: 21c245015268b38916e3a138d256c09d
398]
399[Makefile: BB_BRANCH is set to the empty string for trunk, not the string 'trunk'.
400david-sarah@jacaranda.org**20101128233512
401 Ignore-this: 5a7ef8eb10475636d21b91e25b56c369
402]
403[relnotes.txt: eleventh -> twelfth release.
404david-sarah@jacaranda.org**20101128223321
405 Ignore-this: 1e26410156a665271c1170803dea2c0d
406]
407[relnotes.tst: point to known_issues.rst, not known_issues.txt.
408david-sarah@jacaranda.org**20101128222918
409 Ignore-this: 60194eb4544cac446fe4f60b3e34b887
410]
411[quickstart.html: fix link to point to allmydata-tahoe-1.8.1.zip.
412david-sarah@jacaranda.org**20101128221728
413 Ignore-this: 7b3ee86f8256aa12f5d862f689f3ee29
414]
415[TAG allmydata-tahoe-1.8.1
416david-sarah@jacaranda.org**20101128212336
417 Ignore-this: 9c18bdeaef4822f590d2a0d879e00621
418]
419Patch bundle hash:
420df7c2e2a08c965ba5e6fdc552e2473b7edd10df0