summaryrefslogtreecommitdiffstats
path: root/grokproject/F-13/grokproject-2.0.1-work-without-buildout.patch
blob: e5b85fd42373b21db9f3b74c36b104938fb0644c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
diff -Naru grokproject-2.0.1/grokproject/template/bin/buildout_tmpl grokproject-2.0.1.new/grokproject/template/bin/buildout_tmpl
--- grokproject-2.0.1/grokproject/template/bin/buildout_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/buildout_tmpl	2010-07-09 18:19:34.535708690 +0800
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+import zc.buildout.buildout
+
+if __name__ == '__main__':
+    zc.buildout.buildout.main()
diff -Naru grokproject-2.0.1/grokproject/template/bin/i18ncompile_tmpl grokproject-2.0.1.new/grokproject/template/bin/i18ncompile_tmpl
--- grokproject-2.0.1/grokproject/template/bin/i18ncompile_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/i18ncompile_tmpl	2010-07-09 19:06:35.343485835 +0800
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+import sys
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+import z3c.recipe.i18n.i18ncompile
+
+if __name__ == '__main__':
+    z3c.recipe.i18n.i18ncompile.main(['i18ncompile', '-l', '${package_directory}/src/${package}/locales'])
diff -Naru grokproject-2.0.1/grokproject/template/bin/i18nextract_tmpl grokproject-2.0.1.new/grokproject/template/bin/i18nextract_tmpl
--- grokproject-2.0.1/grokproject/template/bin/i18nextract_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/i18nextract_tmpl	2010-07-09 19:12:58.280483462 +0800
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+
+import sys
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+import os
+sys.argv[0] = os.path.abspath(sys.argv[0])
+from distutils.sysconfig import get_python_lib
+os.chdir(os.path.join(get_python_lib() + '/z3c/recipe/i18n'))
+
+
+import z3c.recipe.i18n.i18nextract
+
+if __name__ == '__main__':
+    z3c.recipe.i18n.i18nextract.main(['i18nextract', '-d', '${package}', '-s', '${package_directory}/parts/i18n/configure.zcml', '-o', '${package_directory}/src/${package}/locales', '-p', '${package}'])
diff -Naru grokproject-2.0.1/grokproject/template/bin/i18nmergeall_tmpl grokproject-2.0.1.new/grokproject/template/bin/i18nmergeall_tmpl
--- grokproject-2.0.1/grokproject/template/bin/i18nmergeall_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/i18nmergeall_tmpl	2010-07-09 19:13:52.852484485 +0800
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+import sys
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+import z3c.recipe.i18n.i18nmergeall
+
+if __name__ == '__main__':
+    z3c.recipe.i18n.i18nmergeall.main(['i18nmergeall', '-l', '${package_directory}/src/${package}/locales'])
diff -Naru grokproject-2.0.1/grokproject/template/bin/i18nstats_tmpl grokproject-2.0.1.new/grokproject/template/bin/i18nstats_tmpl
--- grokproject-2.0.1/grokproject/template/bin/i18nstats_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/i18nstats_tmpl	2010-07-09 19:14:30.422483255 +0800
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+import sys
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+import z3c.recipe.i18n.i18nstats
+
+if __name__ == '__main__':
+    z3c.recipe.i18n.i18nstats.main(['i18nstats', '-l', '${package_directory}/src/${package}/locales'])
diff -Naru grokproject-2.0.1/grokproject/template/bin/interactive_debugger_tmpl grokproject-2.0.1.new/grokproject/template/bin/interactive_debugger_tmpl
--- grokproject-2.0.1/grokproject/template/bin/interactive_debugger_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/interactive_debugger_tmpl	2010-07-09 19:15:00.335483401 +0800
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+
+import sys
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+import os
+sys.argv[0] = os.path.abspath(sys.argv[0])
+
+
+import grokcore.startup.startup
+
+if __name__ == '__main__':
+    grokcore.startup.startup.interactive_debug_prompt(zope_conf="${package_directory}/parts/etc/zope.conf")
diff -Naru grokproject-2.0.1/grokproject/template/bin/paster_tmpl grokproject-2.0.1.new/grokproject/template/bin/paster_tmpl
--- grokproject-2.0.1/grokproject/template/bin/paster_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/paster_tmpl	2010-07-09 19:15:14.306483840 +0800
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+import sys
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+import paste.script.command
+
+if __name__ == '__main__':
+    paste.script.command.run()
diff -Naru grokproject-2.0.1/grokproject/template/bin/python-console_tmpl grokproject-2.0.1.new/grokproject/template/bin/python-console_tmpl
--- grokproject-2.0.1/grokproject/template/bin/python-console_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/python-console_tmpl	2010-07-09 19:15:36.011485452 +0800
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+import sys
+
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+_interactive = True
+if len(sys.argv) > 1:
+    _options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:')
+    _interactive = False
+    for (_opt, _val) in _options:
+        if _opt == '-i':
+            _interactive = True
+        elif _opt == '-c':
+            exec _val
+        elif _opt == '-m':
+            sys.argv[1:] = _args
+            _args = []
+            __import__("runpy").run_module(
+                 _val, {}, "__main__", alter_sys=True)
+
+    if _args:
+        sys.argv[:] = _args
+        __file__ = _args[0]
+        del _options, _args
+        execfile(__file__)
+
+if _interactive:
+    del _interactive
+    __import__("code").interact(banner="", local=globals())
diff -Naru grokproject-2.0.1/grokproject/template/bin/test_tmpl grokproject-2.0.1.new/grokproject/template/bin/test_tmpl
--- grokproject-2.0.1/grokproject/template/bin/test_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/test_tmpl	2010-07-09 22:24:50.419609459 +0800
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+import sys
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+import os
+sys.argv[0] = os.path.abspath(sys.argv[0])
+os.chdir('${package_directory}/parts/test')
+
+
+import zope.testing.testrunner
+
+if __name__ == '__main__':
+    zope.testing.testrunner.run((['--tests-pattern', '^f?tests$$', '-v']) + [
+        '--test-path', '${package_directory}/src',
+        ])
diff -Naru grokproject-2.0.1/grokproject/template/bin/zpasswd_tmpl grokproject-2.0.1.new/grokproject/template/bin/zpasswd_tmpl
--- grokproject-2.0.1/grokproject/template/bin/zpasswd_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/bin/zpasswd_tmpl	2010-07-09 19:16:47.964483909 +0800
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+
+import sys
+sys.path[0:0] = [
+  '${package_directory}/src',
+  ]
+
+import os
+sys.argv[0] = os.path.abspath(sys.argv[0])
+
+
+import zope.password.zpasswd
+
+if __name__ == '__main__':
+    zope.password.zpasswd.main()
diff -Naru grokproject-2.0.1/grokproject/template/parts/etc/debug.ini_tmpl grokproject-2.0.1.new/grokproject/template/parts/etc/debug.ini_tmpl
--- grokproject-2.0.1/grokproject/template/parts/etc/debug.ini_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/parts/etc/debug.ini_tmpl	2010-07-09 20:48:45.813208002 +0800
@@ -0,0 +1,44 @@
+[DEFAULT]
+zope_conf = %(here)s/zope.conf
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[pipeline:main]
+pipeline = accesslogging evalexception grok
+
+[filter:accesslogging]
+use = egg:Paste#translogger
+
+[filter:evalexception]
+use = egg:z3c.evalexception#ajax
+
+[app:grok]
+use = egg:grokcore.startup#debug
+exempt-exceptions = zope.security.interfaces.IUnauthorized
+
+# Logging configuration
+
+[loggers]
+keys = root
+
+[logger_root]
+level = INFO
+handlers = console
+
+[handlers]
+keys = console
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatters]
+keys = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
diff -Naru grokproject-2.0.1/grokproject/template/parts/etc/deploy.ini_tmpl grokproject-2.0.1.new/grokproject/template/parts/etc/deploy.ini_tmpl
--- grokproject-2.0.1/grokproject/template/parts/etc/deploy.ini_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/parts/etc/deploy.ini_tmpl	2010-07-09 20:51:04.421208097 +0800
@@ -0,0 +1,63 @@
+[DEFAULT]
+zope_conf = %(here)s/zope.conf
+
+[server:main]
+use = egg:Paste#http
+host = 127.0.0.1
+port = 8080
+
+[pipeline:main]
+pipeline = gzip grok
+
+[app:grok]
+use = egg:grokcore.startup
+
+[filter:gzip]
+use = egg:Paste#gzip
+
+# Logging configuration
+
+[loggers]
+keys = root, accesslogging, grok
+
+[logger_root]
+level = INFO
+handlers = eventlog
+
+[logger_grok]
+# Set level to WARNING or below if you want to see
+# grok template registry warnings on commandline.
+level = ERROR
+handlers = eventlog
+qualname = grok
+propagate = 0
+
+[logger_accesslogging]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handlers]
+keys = eventlog, accesslog
+
+[handler_eventlog]
+class = FileHandler
+args = (os.path.join(r'${package_directory}', 'log', 'event.log'), 'a')
+level = NOTSET
+formatter = generic
+
+[handler_accesslog]
+class = FileHandler
+args = (os.path.join(r'${package_directory}', 'log', 'accesslog.log'), 'a')
+level = INFO
+formatter = accesslog
+
+[formatters]
+keys = generic, accesslog
+
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+
+[formatter_accesslog]
+format = %(message)s
diff -Naru grokproject-2.0.1/grokproject/template/parts/etc/site.zcml_tmpl grokproject-2.0.1.new/grokproject/template/parts/etc/site.zcml_tmpl
--- grokproject-2.0.1/grokproject/template/parts/etc/site.zcml_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/parts/etc/site.zcml_tmpl	2010-07-09 22:33:52.329609115 +0800
@@ -0,0 +1,36 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           i18n_domain="${package}">
+
+  <include package="${package}" />
+
+    <configure i18n_domain="${package}">
+
+      <unauthenticatedPrincipal id="zope.anybody"
+                                title="Unauthenticated User" />
+      <unauthenticatedGroup id="zope.Anybody"
+                            title="Unauthenticated Users" />
+      <authenticatedGroup id="zope.Authenticated"
+                        title="Authenticated Users" />
+      <everybodyGroup id="zope.Everybody"
+                      title="All Users" />
+      <principal id="zope.manager"
+                 title="Manager"
+                 login="cheese"
+                 password_manager="SSHA"
+                 password="{SSHA}l9E8o4oTjLPlpuQADQkkwgnKaK_D_726"
+                 />
+
+      <!-- Replace the following directive if you do not want
+           public access -->
+      <grant permission="zope.View"
+             principal="zope.Everybody" />
+      <grant permission="zope.app.dublincore.view"
+             principal="zope.Everybody" />
+
+      <role id="zope.Manager" title="Site Manager" />
+      <role id="zope.Member" title="Site Member" />
+      <grantAll role="zope.Manager" />
+      <grant role="zope.Manager"
+             principal="zope.manager" />
+   </configure>
+</configure>
diff -Naru grokproject-2.0.1/grokproject/template/parts/etc/zope.conf_tmpl grokproject-2.0.1.new/grokproject/template/parts/etc/zope.conf_tmpl
--- grokproject-2.0.1/grokproject/template/parts/etc/zope.conf_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/parts/etc/zope.conf_tmpl	2010-07-09 20:54:36.240207655 +0800
@@ -0,0 +1,40 @@
+# Identify the component configuration used to define the site:
+site-definition ${package_directory}/parts/etc/site.zcml
+
+<zodb>
+  # Standard blob storage
+  <blobstorage>
+    blob-dir ${package_directory}/var/blobstorage
+    <filestorage>
+      path ${package_directory}/var/filestorage/Data.fs
+    </filestorage>
+  </blobstorage>
+
+# Uncomment this if you want a blob-less standard file storage instead:
+#  <filestorage>
+#       path ${package_directory}/var/filestorage
+#  </filestorage>
+
+# Uncomment this if you want to connect to a ZEO server instead:
+#  <zeoclient>
+#    server localhost:8100
+#    storage 1
+#    # ZEO client cache, in bytes
+#    cache-size 20MB
+#    # Uncomment to have a persistent disk cache
+#    #client zeo1
+#  </zeoclient>
+
+</zodb>
+
+<eventlog>
+# logfiles are setup in the debug.ini and deploy.ini files.
+</eventlog>
+
+# Comment this line to disable developer mode.  This should be done in
+# production
+devmode on
+
+# Extra configuration lines can be added to zope_conf's extra option. Put for
+# instance productconf sections in here.
+
diff -Naru grokproject-2.0.1/grokproject/template/parts/i18n/configure.zcml_tmpl grokproject-2.0.1.new/grokproject/template/parts/i18n/configure.zcml_tmpl
--- grokproject-2.0.1/grokproject/template/parts/i18n/configure.zcml_tmpl	1970-01-01 08:00:00.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/template/parts/i18n/configure.zcml_tmpl	2010-07-09 20:48:45.785481360 +0800
@@ -0,0 +1,7 @@
+<configure xmlns='http://namespaces.zope.org/zope'
+           xmlns:meta="http://namespaces.zope.org/meta"
+           >
+
+  
+
+</configure>
diff -Naru grokproject-2.0.1/grokproject/templates.py grokproject-2.0.1.new/grokproject/templates.py
--- grokproject-2.0.1/grokproject/templates.py	2010-05-31 04:11:48.000000000 +0800
+++ grokproject-2.0.1.new/grokproject/templates.py	2010-07-10 12:15:20.531392557 +0800
@@ -11,6 +11,10 @@
 from grokproject.utils import get_ssha_encoded_string
 from grokproject.utils import create_buildout_default_file
 from grokproject.utils import exist_buildout_default_file
+# three more needed by the Fedora patch
+from pkg_resources import get_distribution
+from shutil import rmtree
+import stat
 
 GROK_RELEASE_URL_DEFAULT = 'http://grok.zope.org/releaseinfo/'
 
@@ -29,8 +33,9 @@
                 default='false', should_ask=False,
                 getter=get_boolean_value_for_option),
         ask_var('run_buildout',
-                "After creating the project area, run the buildout.",
-                default=True, should_ask=False,
+                "After creating the project area, run the buildout."
+                " (The default value is True upstream but False in Fedora)",
+                default=False, should_ask=False,
                 getter=get_boolean_value_for_option),
         ask_var('eggs_dir',
                 'Location where zc.buildout will look for and place packages',
@@ -73,10 +78,15 @@
         version = vars.get('grokversion')
         if version is None:
             print "Determining current grok version..."
-            # if no version was specified, we look up the current version first
-            current_info_url = urlparse.urljoin(grok_release_url, 'current')
-            version = self.download(current_info_url).strip().replace(
-                    'grok-', '').replace('.cfg', '')
+            if vars['run_buildout']:
+                # if no version was specified, we look up the current version
+                # first
+                current_info_url = urlparse.urljoin(grok_release_url,
+                                                    'current')
+                version = self.download(current_info_url).strip().replace(
+                        'grok-', '').replace('.cfg', '')
+            else:
+                version = get_distribution('grok').version
 
         if not grok_release_url.endswith('/'):
             grok_release_url += '/'
@@ -124,9 +134,22 @@
         return contents
 
     def post(self, command, output_dir, vars):
-        if not vars['run_buildout']:
-            return
         original_dir = os.getcwd()
         os.chdir(vars['project'])
-        run_buildout(command.verbose)
+        if not vars['run_buildout']:
+            print "Making make scripts executable properly..."
+            os.chdir('bin')
+            for f in os.listdir('.'):
+                mode = stat.S_IMODE(os.stat(f).st_mode)
+                if mode & stat.S_IRUSR:
+                    mode = mode | stat.S_IXUSR
+                if mode & stat.S_IRGRP:
+                    mode = mode | stat.S_IXGRP
+                if mode & stat.S_IROTH:
+                    mode = mode | stat.S_IXOTH
+                os.chmod(f, mode)
+        else:
+            rmtree('bin')
+            rmtree('parts')
+            run_buildout(command.verbose)
         os.chdir(original_dir)
diff -Naru grokproject-2.0.1/grokproject.egg-info/SOURCES.txt grokproject-2.0.1.new/grokproject.egg-info/SOURCES.txt
--- grokproject-2.0.1/grokproject.egg-info/SOURCES.txt	2010-07-09 22:13:44.930613198 +0800
+++ grokproject-2.0.1.new/grokproject.egg-info/SOURCES.txt	2010-07-09 22:12:47.046608239 +0800
@@ -22,6 +22,16 @@
 grokproject.egg-info/not-zip-safe
 grokproject.egg-info/requires.txt
 grokproject.egg-info/top_level.txt
+grokproject/template/bin/buildout_tmpl
+grokproject/template/bin/i18nextract_tmpl
+grokproject/template/bin/interactive_debugger_tmpl
+grokproject/template/bin/zpasswd_tmpl
+grokproject/template/bin/i18ncompile_tmpl
+grokproject/template/bin/python-console_tmpl
+grokproject/template/bin/paster_tmpl
+grokproject/template/bin/i18nmergeall_tmpl
+grokproject/template/bin/i18nstats_tmpl
+grokproject/template/bin/test_tmpl
 grokproject/template/bootstrap.py
 grokproject/template/buildout.cfg_tmpl
 grokproject/template/setup.py_tmpl
@@ -32,6 +42,11 @@
 grokproject/template/etc/zope.conf.in_tmpl
 grokproject/template/extends-cache/.directory
 grokproject/template/log/.directory
+grokproject/template/parts/i18n/configure.zcml_tmpl
+grokproject/template/parts/etc/site.zcml_tmpl
+grokproject/template/parts/etc/debug.ini_tmpl
+grokproject/template/parts/etc/deploy.ini_tmpl
+grokproject/template/parts/etc/zope.conf_tmpl
 grokproject/template/src/+package+/__init__.py
 grokproject/template/src/+package+/app.py_tmpl
 grokproject/template/src/+package+/app.txt_tmpl