X Tutup
Skip to content

Commit be474dc

Browse files
committed
SESPRINGPYTHONPY-83: Merged branch to trunk, and all tests passed.
git-svn-id: https://src.springframework.org/svn/se-springpython-py/trunk/springpython@450 ce8fead1-4192-4296-8608-a705134b927f
1 parent 1ca5817 commit be474dc

File tree

18 files changed

+1280
-39
lines changed

18 files changed

+1280
-39
lines changed

build.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import pydoc
2222
import re
2323
import sys
24+
import tarfile
2425
import getopt
2526
import shutil
2627
import S3
@@ -120,25 +121,33 @@ def test_coverage(dir):
120121
os.system("nosetests --with-nosexunit --source-folder=src --where=test/springpythontest --xml-report-folder=%s --with-coverage --cover-package=springpython" % dir)
121122

122123
def build(dir, version):
123-
input = open(dir + "/build.py")
124+
input = open(dir + "/build.py").read()
124125
output = open(dir + "/setup.py", "w")
125-
for line in input.readlines():
126-
skip = ["sys.argv =", "parser = OptionParser", "parser.add_option", "(options, args)", "# NOTE:", "# Remove version argument", "from optparse"]
127-
if len([True for criteria in skip if criteria in line]) > 0:
128-
continue
129-
if "options.version" in line:
130-
output.write(re.sub("options.version", "'" + version + "'", line))
131-
continue
132-
output.write(line)
126+
patterns_to_replace = [("version", version)]
127+
for pattern, replacement in patterns_to_replace:
128+
input = re.compile(r"\$\{%s}" % pattern).sub(replacement, input)
129+
output.write(input)
133130
output.close()
134-
os.system("cd %s ; python build.py --version %s sdist ; mv dist/* .. ; \\rm -rf dist ; \\rm -f MANIFEST" % (dir, version))
131+
os.system("cd %s ; python setup.py sdist ; mv dist/* .. ; \\rm -rf dist ; \\rm -f MANIFEST" % dir)
135132

136133
def package(dir, version):
137134
os.makedirs(dir)
138135
build("src", version)
139136
build("samples", version)
140137
os.system("mv *.tar.gz %s" % dir)
141138

139+
curdir = os.getcwd()
140+
os.chdir("src/plugins")
141+
for item in os.listdir("."):
142+
if item in ["coily", ".svn"]: continue
143+
t = tarfile.open("../../%s/springpython-plugin-%s-%s.tar.gz" % (dir, item, version), "w:gz")
144+
for path, dirs, files in os.walk(item):
145+
if ".svn" not in path: # Don't want to include version information
146+
t.add(path, recursive=False)
147+
[t.add(path + "/" + file, recursive=False) for file in files]
148+
t.close()
149+
os.chdir(curdir)
150+
142151
def publish(filepath, s3bucket, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
143152
filename = filepath.split("/")[-1]
144153
s3key = "/".join([ p['release.type'],

docs/apt/index.apt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
Introduction
88

9-
Spring Python is an offshoot of the Java-based Spring Framework and Spring Security, targeted for Python. Spring
10-
provides many useful features, and I wanted those same features available when working with Python.
9+
"Spring Python is an offshoot of the Java-based Spring Framework and Spring Security, targeted for Python. Spring
10+
provides many useful features, and I wanted those same features available when working with Python." -- Greg Turnquist,
11+
project lead
12+
13+
This project takes the concepts of Spring and applies it to the language and environment of Python. This includes
14+
pragmatic libraries and useful abstractions that quickly gets you back to working on the code that makes you money.
1115

12-
This used to be a trac site, but since Spring Python became an official Spring Extension, it has been replaced
13-
with a maven-generated one. Documentation stored in various trac articles has been migrated to the documentation
14-
set found in left-hand side of this page. You can view either HTML or a PDF document.
15-
1616
Key Features
1717

1818
* {{{reference/html/objects.html}Inversion Of Control}} - The idea is to decouple two classes at the
@@ -61,6 +61,8 @@ What's Coming?
6161
that already supports four formats, it shouldn't be hard to extend things and offer a useful, succinct
6262
alternative. The import thing is that with Spring Python, you don't HAVE to get bogged down with XML.
6363

64+
We are also developing a {{{reference/html/plugins.html}plugin-based, command-line tool}} to help you utilize Spring Python in writing applications.
65+
6466
Spring Python News
6567

6668
Visit {{{http://blog.springpython.webfactional.com}Spring Python's blog site}} for news, postings, and
4.84 KB
Loading
95 KB
Loading

docs/reference/src/index.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
<!ENTITY overview SYSTEM "overview.xml">
55
<!ENTITY objects SYSTEM "objects.xml">
66
<!ENTITY aop SYSTEM "aop.xml">
7-
<!ENTITY transaction SYSTEM "transaction.xml">
7+
<!ENTITY transaction SYSTEM "transaction.xml">
88
<!ENTITY dao SYSTEM "dao.xml">
99
<!ENTITY remoting SYSTEM "remoting.xml">
1010
<!ENTITY security SYSTEM "security.xml">
11+
<!ENTITY plugins SYSTEM "plugins.xml">
1112
<!ENTITY samples SYSTEM "samples.xml">
1213
]>
1314
<book>
@@ -39,6 +40,7 @@
3940
&transaction;
4041
&security;
4142
&remoting;
43+
&plugins;
4244
&samples;
4345

44-
</book>
46+
</book>

docs/reference/src/objects.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,27 @@
3131
<para>In Spring, there are certain classes whose instances form the backbone of your application and that
3232
are managed by the Spring IoC container. While Spring Java calls them
3333
<ulink url="http://en.wikipedia.org/wiki/Javabean">
34-
beans</ulink>, Spring Python and Spring.NET call them <emphasis>objects</emphasis>.
34+
beans</ulink>, Spring Python and Spring for .NET call them <emphasis>objects</emphasis>.
3535
An object is simply a class instance that was instantiated, assembled and otherwise managed by a Spring
3636
IoC container instead of directly by your code; other than that, there is nothing special about a
3737
object. It is in all other respects one of probably many objects in your application. These
3838
objects, and the dependencies between them, are reflected in the configuration meta-data used
3939
by a container.</para>
40+
41+
<para>The following diagram demonstrates a key Spring concept: building useful services on top of simple
42+
objects, configured through a container's set of blueprints, provides powerful services that are
43+
easier to maintain.</para>
44+
45+
<para><mediaobject>
46+
<imageobject role="fo">
47+
<imagedata align="center" fileref="images/spring_triangle.png"
48+
format="PNG" scale="100%" width="100%"/>
49+
</imageobject>
50+
<imageobject role="html">
51+
<imagedata align="center" fileref="images/spring_triangle.png"
52+
format="PNG"/>
53+
</imageobject>
54+
</mediaobject></para>
4055

4156
<para>This chapter provides the basics of Spring Python's IoC container by using examples
4257
with explanations. If you are familiar with Spring Java, then you may notice many similarities. Also,

0 commit comments

Comments
 (0)
X Tutup