X Tutup
Skip to content

Commit 2101ef9

Browse files
committed
SESPRINGPYTHONPY-68: Merged branch to trunk, and verified all tests passed for python2.4 and python2.5
git-svn-id: https://src.springframework.org/svn/se-springpython-py/trunk/springpython@357 ce8fead1-4192-4296-8608-a705134b927f
1 parent 1e0be5d commit 2101ef9

File tree

97 files changed

+5493
-2291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+5493
-2291
lines changed

.pydevproject

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<?eclipse-pydev version="1.0"?>
3-
4-
<pydev_project>
5-
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.5</pydev_property>
6-
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
7-
<path>/springpython/src</path>
8-
<path>/springpython/samples/basic</path>
9-
<path>/springpython/samples/petclinic</path>
10-
<path>/springpython/samples/springirc</path>
11-
<path>/springpython/samples/springwiki</path>
12-
<path>/springpython/test</path>
13-
</pydev_pathproperty>
14-
</pydev_project>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?eclipse-pydev version="1.0"?>
3+
4+
<pydev_project>
5+
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.5</pydev_property>
6+
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
7+
<path>/springpython/src</path>
8+
<path>/springpython/samples/petclinic</path>
9+
<path>/springpython/samples/springirc</path>
10+
<path>/springpython/samples/springwiki</path>
11+
<path>/springpython/test</path>
12+
<path>/springpython/samples/basic</path>
13+
</pydev_pathproperty>
14+
</pydev_project>

build.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,19 @@ def usage():
101101
def clean(dir):
102102
print "Removing '%s' directory" % dir
103103
if os.path.exists(dir):
104-
shutil.rmtree(dir)
104+
shutil.rmtree(dir, True)
105105
# TODO: Make this OS-independent
106106
os.system("find . -name '*.pyc' -exec rm -f {} \;")
107107
os.system("find . -name '*.class' -exec rm -f {} \;")
108108

109109
def test(dir):
110-
os.makedirs(dir)
110+
if not os.path.exists(dir):
111+
os.makedirs(dir)
111112
os.system("nosetests --with-nosexunit --source-folder=src --where=test/springpythontest --xml-report-folder=%s" % dir)
112113

113114
def test_coverage(dir):
114-
os.makedirs(dir)
115+
if not os.path.exists(dir):
116+
os.makedirs(dir)
115117
os.system("nosetests --with-nosexunit --source-folder=src --where=test/springpythontest --xml-report-folder=%s --with-coverage --cover-package=springpython" % dir)
116118

117119
def build(dir, version):
@@ -210,7 +212,6 @@ def docs_all(version):
210212
copy("xml/schema/context/", p["targetDir"] + "/docs/schema/context/", ["*.xsd"])
211213

212214
docs_multi(version)
213-
docs_single(version)
214215
docs_pdf(version)
215216

216217
def docs_multi(version):
1.23 MB
Binary file not shown.
250 KB
Binary file not shown.

dependencies/Amara-1.2a2.tar.bz2

93.7 KB
Binary file not shown.

docs/app-context-sample.xml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<components xmlns="http://www.springframework.org/springpython/schema/components"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://www.springframework.org/springpython/schema/components
5+
http://springpython.webfactional.com/schema/context/spring-python-context-1.0.xsd">
6+
7+
<description>
8+
This application context is used to show various components, defined using the
9+
code completion tools found in Eclipse, while pointed at an XSD spec.
10+
11+
Please note that this sample is used to show pycontainer's format, which is supported
12+
by the XSD spec.
13+
</description>
14+
15+
<description>You can have multiple descriptions at the root level.</description>
16+
17+
<component id="user_details_service" class="springpython.security.userdetails.InMemoryUserDetailsService">
18+
<description>
19+
This is an in-memory list of users, with their password and roles. It is valuable
20+
for unit testing without interacting with the real user authentication subsystem.
21+
22+
The value between the property tags is run through a python evaluator, so it will
23+
translate the {...} text into a python dictionary with two entries.
24+
</description>
25+
<property name="user_dict">
26+
{
27+
"basicuser": ("password1", ["ROLE_BASIC"], True),
28+
"otheruser": ("password2", ["ROLE_OTHER"], True)
29+
}
30+
</property>
31+
</component>
32+
33+
<component id="auth_provider" class="springpython.security.providers.dao.DaoAuthenticationProvider">
34+
<description>This component has a property which references another component by name.</description>
35+
<property name="user_details_service" local="user_details_service"/>
36+
</component>
37+
38+
<component id="auth_manager" class="springpython.security.providers.AuthenticationManager">
39+
<description>
40+
This component has a property that holds a list of values, and in this case, is
41+
loading the list with references to other components.
42+
</description>
43+
<property name="auth_providers">
44+
<list local="auth_provider"/>
45+
</property>
46+
</component>
47+
48+
<description>
49+
The following is a component with no properties.
50+
51+
NOTE: This description is not tied to the RoleVoter component.
52+
</description>
53+
54+
<component id="roleVoter" class="springpython.security.vote.RoleVoter"/>
55+
56+
<component id="access_decision_mgr" class="springpython.security.vote.UnanimousBased">
57+
<description>
58+
This component has a mix of properties.
59+
60+
The first property is evaluated as a python boolean False, NOT as a string of "False".
61+
62+
The second property is a list, and will contain one entry, a reference to the roleVoter
63+
component.
64+
</description>
65+
<property name="allow_if_all_abstain">False</property>
66+
<property name="access_decision_voters">
67+
<list local="roleVoter"/>
68+
</property>
69+
</component>
70+
71+
<component id="securityInteceptor" class="springpython.security.intercept.MethodSecurityInterceptor">
72+
<property name="validate_config_attributes">False</property>
73+
<property name="auth_manager" local="auth_manager"/>
74+
<property name="access_decision_mgr" local="access_decision_mgr"/>
75+
<property name="obj_def_source">
76+
[
77+
("springpythontest.support.testSecurityClasses.SampleService.get.*", ["ROLE_BASIC"]),
78+
("springpythontest.support.testSecurityClasses.SampleService.do.*", ["ROLE_BASIC"]),
79+
("springpythontest.support.testSecurityClasses.SampleService.update.*", ["ROLE_MGR"])
80+
]
81+
</property>
82+
</component>
83+
84+
<description>This is another stand alone component</description>
85+
<component id="targetService" class="springpythontest.support.testSecurityClasses.SampleService"/>
86+
87+
<component id="sampleService" class="springpython.aop.ProxyFactoryObject">
88+
<description>
89+
Hopefully by now you can deduce what this component's properties are made up of.
90+
</description>
91+
<property name="target" local="targetService"/>
92+
<property name="interceptors">
93+
<list local="securityInteceptor"/>
94+
</property>
95+
</component>
96+
</components>

docs/apt/index.apt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ Introduction
1616

1717
Key Features
1818

19-
* {{{reference/html/components.html}Inversion Of Control}} - The idea is to decouple two classes at the
19+
* {{{reference/html/objects.html}Inversion Of Control}} - The idea is to decouple two classes at the
2020
interface level. This lets you build many reusable parts in your software, and your whole application becomes
21-
more pluggable. You can use either the XmlApplicationContext or the DecoratorBasedApplicationContext.
21+
more pluggable. You can XMLConfig, PythonConfig/@Object, PyContainerConfig, or SpringJavaConfig, allowing you
22+
to read multiple formats.
2223

2324
* {{{reference/html/aop.html}Aspect-oriented Programming}} - Spring Python provides great ways to wrap advice
2425
around objects. It is utilized for remoting. Another use is for debug tracers and performance tracing.
@@ -57,12 +58,15 @@ Downloads
5758

5859
What's Coming?
5960

60-
We are working on improving the {{{reference/html/components.html}core IoC container}}. Right now, what we have
61-
works for simple situations, but in order to make it as powerful and extensible as the original Spring Framework's container,
62-
we are overhauling things. The goal is to have this completed by release 1.0.
61+
We are working on creating a fluent DSL for configuring the IoC container. With a refactored core container
62+
that already supports four formats, it shouldn't be hard to extend things and offer a useful, succinct
63+
alternative. The import thing is that with Spring Python, you don't HAVE to get bogged down with XML.
6364

6465
Spring Python News
6566

67+
<<NEWS>> - Spring Python's core IoC container has been refactored, and now support four formats! This includes
68+
XMLConfig, PythonConfig/@Object, PyContainerConfig, and SpringJavaConfig. - 11/06/2008 G.Turnquist
69+
6670
<<NEWS>> - Spring Python 0.7.1 has been released. This release contains improvements to reference documentation as well
6771
as integration with {{{http://s3browse.com/explore/dist.springframework.org/release/EXT/se-springpython-py}Spring's new
6872
download site}}. - 10/17/2008 G.Turnquist

docs/reference/src/aop.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,34 +87,34 @@ print service.method("something")
8787

8888
</section>
8989

90-
<section id="aop-proxy-factory-components">
91-
<title>Proxy Factory Components</title>
90+
<section id="aop-proxy-factory-objects">
91+
<title>Proxy Factory Objects</title>
9292

9393
<para>The earlier usage of a <classname>ProxyFactory</classname> is useful, but often
9494
times we only need the factory to create one proxy. There is a shortcut called
95-
<classname>ProxyFactoryComponent</classname>.</para>
95+
<classname>ProxyFactoryObject</classname>.</para>
9696

9797
<programlisting><![CDATA[
9898
from springpython.aop import *
99-
service = ProxyFactoryComponent()
99+
service = ProxyFactoryObject()
100100
service.target = SampleService()
101101
service.interceptors = [WrappingInterceptor()]
102-
print service.method(" proxy factory component")
102+
print service.method(" proxy factory object")
103103
104-
"You sent me a 'proxy factory component'"
104+
"You sent me a 'proxy factory object'"
105105
]]></programlisting>
106106

107-
<para>In this case, the <classname>ProxyFactoryComponent</classname> acts as both a proxy
107+
<para>In this case, the <classname>ProxyFactoryObject</classname> acts as both a proxy
108108
and a factory. As a proxy, it behaves just like the target service would, and it also provides
109109
the ability to wrap the service with aspects. It saved us a step of coding, but more importantly,
110-
the <classname>ProxyFactoryComponent</classname> took on the persona of being our service
110+
the <classname>ProxyFactoryObject</classname> took on the persona of being our service
111111
right from the beginning.</para>
112112

113113
<para>To be more pythonic, Spring Python also allows you to initialize everything at once.</para>
114114

115115
<programlisting><![CDATA[
116116
from springpython.aop import *
117-
service = ProxyFactoryComponent(target = SampleService(), interceptors = [WrappingInterceptor()])
117+
service = ProxyFactoryObject(target = SampleService(), interceptors = [WrappingInterceptor()])
118118
]]></programlisting>
119119

120120
</section>
@@ -132,7 +132,7 @@ service = ProxyFactoryComponent(target = SampleService(), interceptors = [Wrappi
132132
<programlisting><![CDATA[
133133
from springpython.aop import *
134134
pointcutAdvisor = RegexpMethodPointcutAdvisor(advice = [WrappingInterceptor()], patterns = [".*do.*"])
135-
service = ProxyFactoryComponent(target = SampleService(), interceptors = pointcutAdvisor)
135+
service = ProxyFactoryObject(target = SampleService(), interceptors = pointcutAdvisor)
136136
print service.method("nothing changed here")
137137
138138
"You sent me 'nothing changed here'"
@@ -145,14 +145,14 @@ print service.doSomething()
145145
<note>
146146
<title>The power of <classname>RegexpMethodPointAdvisor</classname></title>
147147

148-
<para><classname>RegexpMethodPointAdvisor</classname> is a powerful component in
148+
<para><classname>RegexpMethodPointAdvisor</classname> is a powerful object in
149149
Spring Python that acts as <emphasis>pointcut</emphasis>, a <emphasis>join point</emphasis>,
150150
and a <emphasis>method interceptor</emphasis>. It fetches the fullpath of the target's
151151
module, class, and method name, and then checks to see if it matches any of the patterns
152152
in the <emphasis>patterns</emphasis> list using Python's regular expression module.</para>
153153
</note>
154154

155-
<para>By plugging this into a <classname>ProxyFactoryComponent</classname> as an interceptor, it evaluates
155+
<para>By plugging this into a <classname>ProxyFactoryObject</classname> as an interceptor, it evaluates
156156
whether to route method calls through the advice, or directly to the target service.</para>
157157

158158
</section>
@@ -172,14 +172,14 @@ print service.doSomething()
172172
interceptor gets converted into a list of one. So, you can do either of the following:</para>
173173

174174
<programlisting><![CDATA[
175-
service = ProxyFactoryComponent()
175+
service = ProxyFactoryObject()
176176
service.interceptors = WrappingInterceptor()
177177
]]></programlisting>
178178

179179
or
180180

181181
<programlisting><![CDATA[
182-
service = ProxyFactoryComponent()
182+
service = ProxyFactoryObject()
183183
factory.interceptors = [WrappingInterceptor()]
184184
]]></programlisting>
185185

docs/reference/src/components.xml

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)
X Tutup