• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

allura


Commit MetaInfo

修訂65998180594055f7d353f1c0629e2c81db3dd86f (tree)
時間2011-10-07 05:41:45
作者Rick Copeland <rcopeland@geek...>
CommiterRick Copeland

Log Message

[#2020] working on getting environment more sane

Signed-off-by: Rick Copeland <rcopeland@geek.net>

Change Summary

差異

--- a/Allura/allura/config/environment.py
+++ b/Allura/allura/config/environment.py
@@ -1,6 +1,13 @@
11 # -*- coding: utf-8 -*-
22 """WSGI environment setup for allura."""
33
4+import pylons
5+import pylons.middleware
6+import tg
7+import tg.error
8+pylons.c = pylons.tmpl_context
9+pylons.g = pylons.app_globals
10+
411 from allura.config.app_cfg import base_config
512
613 __all__ = ['load_environment']
--- a/Allura/allura/config/middleware.py
+++ b/Allura/allura/config/middleware.py
@@ -2,7 +2,12 @@
22 """WSGI middleware initialization for the allura application."""
33 import mimetypes
44
5+import pylons
6+import pylons.middleware
57 import tg
8+import tg.error
9+pylons.c = pylons.tmpl_context
10+pylons.g = pylons.app_globals
611 import pkg_resources
712 from tg import config
813 from paste.deploy.converters import asbool
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -13,7 +13,8 @@ import pylons
1313 import webob.multidict
1414 from formencode import Invalid
1515 from tg.decorators import before_validate
16-from pylons import response, c
16+from pylons import response
17+from pylons import tmpl_context as c
1718 from paste.httpheaders import CACHE_CONTROL, EXPIRES
1819 from webhelpers.html import literal
1920 from webob import exc
--- a/Allura/allura/templates/widgets/neighborhood_add_project.html
+++ b/Allura/allura/templates/widgets/neighborhood_add_project.html
@@ -15,7 +15,7 @@
1515 </label>
1616 </div>
1717 <div class="grid-10">{{widget.display_field(widget.fields.project_unixname)}}
18- <br/><div id="project_url">http://{{c.environ['HTTP_HOST']}}{{neighborhood.url()}}<span id="url_fragment"></span></div>
18+ <br/><div id="project_url">http://{{request.environ['HTTP_HOST']}}{{neighborhood.url()}}<span id="url_fragment"></span></div>
1919 </div>
2020 <div class="grid-9" style="position:relative; overflow:visible">
2121 <b id="error_icon" data-icon="!" class="allura" title="Caution">!</b>
--- a/Allura/allura/tests/functional/test_root.py
+++ b/Allura/allura/tests/functional/test_root.py
@@ -47,7 +47,7 @@ class TestRootController(TestController):
4747 'text/html,application/xhtml+xml,application/xml;q=0.9;text/plain;q=0.8,image/png,*/*;q=0.5' ]
4848 for hdr in hdrs:
4949 # malformed headers used to return 500, just make sure they don't now
50- self.app.get('/', headers=dict(Accept=hdr))
50+ self.app.get('/', headers=dict(Accept=hdr), validate_skip=True)
5151
5252 def test_project_browse(self):
5353 com_cat = M.ProjectCategory.query.find(dict(label='Communications')).first()
--- a/Allura/allura/tests/model/test_discussion.py
+++ b/Allura/allura/tests/model/test_discussion.py
@@ -62,7 +62,7 @@ def test_thread_methods():
6262 assert t.attachment_class() == M.DiscussionAttachment
6363 p0 = t.post('This is a post')
6464 p1 = t.post('This is another post')
65- time.sleep(1)
65+ time.sleep(0.25)
6666 p2 = t.post('This is a reply', parent_id=p0._id)
6767 ThreadLocalORMSession.flush_all()
6868 ThreadLocalORMSession.close_all()
@@ -74,7 +74,9 @@ def test_thread_methods():
7474 posts0 = t.find_posts(page=0, limit=10, style='threaded')
7575 posts1 = t.find_posts(page=0, limit=10, style='timestamp')
7676 assert posts0 != posts1
77- posts2 = t.find_posts(page=0, limit=10, style='threaded', timestamp=p0.timestamp)
77+ ts = p0.timestamp.replace(
78+ microsecond=int(p0.timestamp.microsecond // 1000) * 1000)
79+ posts2 = t.find_posts(page=0, limit=10, style='threaded', timestamp=ts)
7880 assert len(posts2) > 0
7981
8082 assert 'wiki/_discuss/' in t.url()
--- a/Allura/setup.py
+++ b/Allura/setup.py
@@ -6,7 +6,7 @@ except ImportError:
66 use_setuptools()
77 from setuptools import setup, find_packages
88
9-from allura.version import __version__
9+exec open('allura/version.py').read()
1010
1111 PROJECT_DESCRIPTION='''
1212 Allura is an open source implementation of a software "forge", a web site
@@ -38,10 +38,15 @@ setup(
3838 'License :: OSI Approved :: Apache Software License',
3939 ],
4040 install_requires=[
41- "TurboGears2 >= 2.1a1",
41+ "TurboGears2",
42+ "tg.devtools",
43+ "pypeline",
44+ "datadiff",
45+ "BeautifulSoup",
4246 "PasteScript",
4347 "Babel >= 0.9.4",
44- "pymongo >= 1.7",
48+ "pymongo >= 1.9,<2.0",
49+ "jinja2",
4550 "pysolr",
4651 "repoze.what-quickstart",
4752 "sqlalchemy-migrate",
@@ -51,20 +56,21 @@ setup(
5156 "python-openid >= 2.2.4",
5257 "python-dateutil >= 1.4.1",
5358 "WebOb >= 0.9.8",
54- "WebTest == 1.2",
59+ "WebTest >= 1.2",
5560 "EasyWidgets >= 0.1.1",
5661 "PIL >= 1.1.7",
5762 "iso8601",
58- "chardet == 1.0.1",
63+ "chardet >= 1.0.1",
5964 "feedparser >= 5.0.1",
60- "oauth2 == 1.2.0",
65+ "oauth2 >= 1.2.0",
66+ "Ming >= 0.2.2dev-20110930",
6167 ],
6268 setup_requires=["PasteScript >= 1.7"],
6369 paster_plugins=['PasteScript', 'Pylons', 'TurboGears2', 'tg.devtools', 'Ming'],
6470 packages=find_packages(exclude=['ez_setup']),
6571 include_package_data=True,
6672 test_suite='nose.collector',
67- tests_require=['WebTest >= 1.2', 'BeautifulSoup', 'pytidylib', 'poster'],
73+ tests_require=['WebTest >= 1.2', 'BeautifulSoup', 'pytidylib', 'poster', 'nose'],
6874 package_data={'allura': ['i18n/*/LC_MESSAGES/*.mo',
6975 'templates/*/*',
7076 'public/*/*']},
--- a/AlluraTesting/alluratest/validation.py
+++ b/AlluraTesting/alluratest/validation.py
@@ -17,7 +17,7 @@ import mock
1717 import beaker.session
1818 from paste.deploy import loadapp
1919 from paste.script.appinstall import SetupCommand
20-from pylons import c, g, h, url, request, response, session
20+from pylons import c, g, url, request, response, session
2121 from webtest import TestApp
2222 from webob import Request, Response
2323 from tidylib import tidy_document
--- a/AlluraTesting/setup.py
+++ b/AlluraTesting/setup.py
@@ -16,6 +16,8 @@ setup(name='AlluraTesting',
1616 include_package_data=True,
1717 zip_safe=False,
1818 install_requires=[
19+ 'pytidylib',
20+ "poster",
1921 # -*- Extra requirements: -*-
2022 ]
2123 )