Ticket #1548: renameClient.dpatch

File renameClient.dpatch, 6.5 KB (added by zooko, at 2011-09-27T20:01:41Z)
Line 
11 patch for repository http://tahoe-lafs.org/source/tahoe-lafs/trunk:
2
3Tue Sep 27 13:30:28 MDT 2011  zooko@zooko.com
4  * Rename allmydata.client.Client to allmydata.clientandserver.ClientAndServer.
5  Create a tiny shim allmydata.client.Client whose only purpose in life is to be available for the .tac files to invoke. (See the docstring of the new allmydata.client.Client for details.)
6  Regularize some of the names of directories created by unit tests.
7
8New patches:
9
10[Rename allmydata.client.Client to allmydata.clientandserver.ClientAndServer.
11zooko@zooko.com**20110927193028
12 Ignore-this: b5bd4ae4522751d567858a19bf9a4e17
13 Create a tiny shim allmydata.client.Client whose only purpose in life is to be available for the .tac files to invoke. (See the docstring of the new allmydata.client.Client for details.)
14 Regularize some of the names of directories created by unit tests.
15] {
16move ./src/allmydata/client.py ./src/allmydata/clientandserver.py
17move ./src/allmydata/test/test_client.py ./src/allmydata/test/test_clientandserver.py
18addfile ./src/allmydata/client.py
19hunk ./src/allmydata/client.py 1
20+from allmydata import clientandserver
21+
22+def Client(basedir="."):
23+    """
24+    This is the entry point to Tahoe-LAFS code. It gets executed by the .tac
25+    files which are produced by "tahoe create-client", "tahoe
26+    create-introducer", and "tahoe create-node", and it gets executed by
27+    windows/tahoesvc.py.
28+
29+    The name 'Client' is not a good name for this, but we can't change it
30+    unless we change the .tac files that have previously been produced and
31+    written to users' filesystems, or stop using .tac files (see ticket
32+    #1159).
33+
34+    The reason it isn't a good name is that this same entry point also
35+    launches servers.
36+    """
37+    return clientandserver.ClientAndServer(basedir)
38replace ./src/allmydata/clientandserver.py [A-Za-z_0-9] Client ClientAndServer
39replace ./src/allmydata/immutable/upload.py [A-Za-z_0-9] Client ClientAndServer
40replace ./src/allmydata/node.py [A-Za-z_0-9] Client ClientAndServer
41replace ./src/allmydata/storage_client.py [A-Za-z_0-9] Client ClientAndServer
42hunk ./src/allmydata/test/check_memory.py 8
43 from twisted.internet import defer, reactor, protocol, error
44 from twisted.application import service, internet
45 from twisted.web import client as tw_client
46-from allmydata import client, introducer
47+from allmydata import clientandserver, introducer
48 from allmydata.immutable import upload
49 from allmydata.scripts import create_node
50 from allmydata.util import fileutil, pollmixin
51replace ./src/allmydata/test/check_memory.py [A-Za-z_0-9\-\.] client.Client clientandserver.ClientAndServer
52hunk ./src/allmydata/test/common.py 9
53 from twisted.application import service
54 from twisted.web.error import Error as WebError
55 from foolscap.api import flushEventualQueue, fireEventually
56-from allmydata import uri, dirnode, client
57+from allmydata import uri, dirnode, clientandserver
58 from allmydata.introducer.server import IntroducerNode
59 from allmydata.interfaces import IMutableFileNode, IImmutableFileNode,\
60                                  NotEnoughSharesError, ICheckable, \
61replace ./src/allmydata/test/common.py [A-Za-z_0-9\-\.] client.Client clientandserver.ClientAndServer
62replace ./src/allmydata/test/no_network.py [A-Za-z_0-9\-\.] allmydata.client allmydata.clientandserver
63replace ./src/allmydata/test/no_network.py [A-Za-z_0-9] Client ClientAndServer
64hunk ./src/allmydata/test/test_clientandserver.py 7
65 
66 import allmydata
67 from allmydata.node import OldConfigError
68-from allmydata import client
69+from allmydata import clientandserver
70 from allmydata.storage_client import StorageFarmBroker
71 from allmydata.util import base32, fileutil
72 from allmydata.interfaces import IFilesystemNode, IFileNode, \
73hunk ./src/allmydata/test/test_clientandserver.py 295
74 
75 class NodeMaker(testutil.ReallyEqualMixin, unittest.TestCase):
76     def test_maker(self):
77-        basedir = "client/NodeMaker/maker"
78+        basedir = "test_client/NodeMaker/test_maker"
79         fileutil.make_dirs(basedir)
80         fileutil.write(os.path.join(basedir, "tahoe.cfg"), BASECONFIG)
81         c = client.Client(basedir)
82replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Client clientandserver.ClientAndServer
83replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9] test_client test_clientandserver
84replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_1 test_clientandserver.Basic.test_reserved_1
85replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_2 test_clientandserver.Basic.test_reserved_2
86replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_3 test_clientandserver.Basic.test_reserved_3
87replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_4 test_clientandserver.Basic.test_reserved_4
88replace ./src/allmydata/test/test_clientandserver.py [A-Za-z_0-9\-\.] client.Basic.test_reserved_bad test_clientandserver.Basic.test_reserved_bad
89replace ./src/allmydata/test/test_dirnode.py [A-Za-z_0-9\-\.] allmydata.client allmydata.clientandserver
90replace ./src/allmydata/test/test_dirnode.py [A-Za-z_0-9] Client ClientAndServer
91hunk ./src/allmydata/test/test_filenode.py 3
92 
93 from twisted.trial import unittest
94-from allmydata import uri, client
95+from allmydata import uri, clientandserver
96 from allmydata.monitor import Monitor
97 from allmydata.immutable.literal import LiteralFileNode
98 from allmydata.immutable.filenode import ImmutableFileNode
99hunk ./src/allmydata/test/test_filenode.py 25
100         return None
101     def get_history(self):
102         return None
103-    _secret_holder = client.SecretHolder("lease secret", "convergence secret")
104+    _secret_holder = clientandserver.SecretHolder("lease secret", "convergence secret")
105 
106 class Node(unittest.TestCase):
107     def test_chk_filenode(self):
108replace ./src/allmydata/test/test_helper.py [A-Za-z_0-9] client clientandserver
109replace ./src/allmydata/test/test_mutable.py [A-Za-z_0-9] client clientandserver
110replace ./src/allmydata/test/test_web.py [A-Za-z_0-9] Client ClientAndServer
111replace ./src/allmydata/test/test_web.py [A-Za-z_0-9\-\.] allmydata.client allmydata.clientandserver
112}
113
114Context:
115
116[docs/configuration.rst: add section about the types of node, and clarify when setting web.port enables web-API service. fixes #1444
117zooko@zooko.com**20110926203801
118 Ignore-this: ab94d470c68e720101a7ff3c207a719e
119] 
120[TAG allmydata-tahoe-1.9.0a2
121warner@lothar.com**20110925234811
122 Ignore-this: e9649c58f9c9017a7d55008938dba64f
123] 
124Patch bundle hash:
125615a58d4b05bc694d4862ed61cb831d3857da8e5