Author: roger
Date: Fri Oct 26 21:46:18 2012
New Revision: 1402680
URL: http://svn.apache.org/viewvc?rev=1402680&view=rev
Log:
THRIFT-1735 integrate tutorial into regular build
python and python twisted
Added:
thrift/trunk/tutorial/py.twisted/Makefile.am (with props)
thrift/trunk/tutorial/py/Makefile.am (with props)
Modified:
thrift/trunk/configure.ac
thrift/trunk/tutorial/Makefile.am
thrift/trunk/tutorial/py/ (props changed)
thrift/trunk/tutorial/py.twisted/ (props changed)
thrift/trunk/tutorial/py.twisted/PythonClient.py
thrift/trunk/tutorial/py.twisted/PythonServer.py
thrift/trunk/tutorial/py.twisted/PythonServer.tac
thrift/trunk/tutorial/py/PythonClient.py
thrift/trunk/tutorial/py/PythonServer.py
Modified: thrift/trunk/configure.ac
URL:
http://svn.apache.org/viewvc/thrift/trunk/configure.ac?rev=1402680&r1=1402679&r2=1402680&view=diff
==============================================================================
--- thrift/trunk/configure.ac (original)
+++ thrift/trunk/configure.ac Fri Oct 26 21:46:18 2012
@@ -615,6 +615,8 @@ AC_CONFIG_FILES([
tutorial/cpp/Makefile
tutorial/java/Makefile
tutorial/js/Makefile
+ tutorial/py/Makefile
+ tutorial/py.twisted/Makefile
])
AC_OUTPUT
Modified: thrift/trunk/tutorial/Makefile.am
URL:
http://svn.apache.org/viewvc/thrift/trunk/tutorial/Makefile.am?rev=1402680&r1=1402679&r2=1402680&view=diff
==============================================================================
--- thrift/trunk/tutorial/Makefile.am (original)
+++ thrift/trunk/tutorial/Makefile.am Fri Oct 26 21:46:18 2012
@@ -41,8 +41,8 @@ if WITH_PHP
endif
if WITH_PYTHON
-#SUBDIRS += py
-#SUBDIRS += py.twisted
+SUBDIRS += py
+SUBDIRS += py.twisted
endif
if WITH_RUBY
Propchange: thrift/trunk/tutorial/py/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 26 21:46:18 2012
@@ -0,0 +1,4 @@
+gen-*
+Makefile.in
+Makefile
+
Propchange: thrift/trunk/tutorial/py.twisted/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 26 21:46:18 2012
@@ -0,0 +1,4 @@
+gen-*
+Makefile.in
+Makefile
+
Added: thrift/trunk/tutorial/py.twisted/Makefile.am
URL:
http://svn.apache.org/viewvc/thrift/trunk/tutorial/py.twisted/Makefile.am?rev=1402680&view=auto
==============================================================================
--- thrift/trunk/tutorial/py.twisted/Makefile.am (added)
+++ thrift/trunk/tutorial/py.twisted/Makefile.am Fri Oct 26 21:46:18 2012
@@ -0,0 +1,35 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+THRIFT = $(top_builddir)/compiler/cpp/thrift
+
+gen-py/tutorial/Calculator.py gen-py/shared/SharedService.py:
$(top_srcdir)/tutorial/tutorial.thrift
+ $(THRIFT) --gen py:twisted -r $<
+
+all-local: gen-py/tutorial/Calculator.py
+
+tutorialserver: all
+ ${PYTHON} PythonServer.py
+
+tutorialclient: all
+ ${PYTHON} PythonClient.py
+
+EXTRA_DIST = \
+ PythonServer.py \
+ PythonClient.py
Propchange: thrift/trunk/tutorial/py.twisted/Makefile.am
------------------------------------------------------------------------------
svn:executable = *
Modified: thrift/trunk/tutorial/py.twisted/PythonClient.py
URL:
http://svn.apache.org/viewvc/thrift/trunk/tutorial/py.twisted/PythonClient.py?rev=1402680&r1=1402679&r2=1402680&view=diff
==============================================================================
--- thrift/trunk/tutorial/py.twisted/PythonClient.py (original)
+++ thrift/trunk/tutorial/py.twisted/PythonClient.py Fri Oct 26 21:46:18 2012
@@ -19,8 +19,9 @@
# under the License.
#
-import sys
-sys.path.append('../gen-py.twisted')
+import sys, glob
+sys.path.append('gen-py.twisted')
+sys.path.insert(0, glob.glob('../../lib/py/build/lib.*')[0])
from tutorial import Calculator
from tutorial.ttypes import *
Modified: thrift/trunk/tutorial/py.twisted/PythonServer.py
URL:
http://svn.apache.org/viewvc/thrift/trunk/tutorial/py.twisted/PythonServer.py?rev=1402680&r1=1402679&r2=1402680&view=diff
==============================================================================
--- thrift/trunk/tutorial/py.twisted/PythonServer.py (original)
+++ thrift/trunk/tutorial/py.twisted/PythonServer.py Fri Oct 26 21:46:18 2012
@@ -19,8 +19,9 @@
# under the License.
#
-import sys
-sys.path.append('../gen-py.twisted')
+import sys, glob
+sys.path.append('gen-py.twisted')
+sys.path.insert(0, glob.glob('../../lib/py/build/lib.*')[0])
from tutorial import Calculator
from tutorial.ttypes import *
Modified: thrift/trunk/tutorial/py.twisted/PythonServer.tac
URL:
http://svn.apache.org/viewvc/thrift/trunk/tutorial/py.twisted/PythonServer.tac?rev=1402680&r1=1402679&r2=1402680&view=diff
==============================================================================
--- thrift/trunk/tutorial/py.twisted/PythonServer.tac (original)
+++ thrift/trunk/tutorial/py.twisted/PythonServer.tac Fri Oct 26 21:46:18 2012
@@ -22,8 +22,9 @@
from twisted.application import internet, service
from thrift.transport import TTwisted
-import sys
-sys.path.append('../gen-py.twisted')
+import sys, glob
+sys.path.append('gen-py.twisted')
+sys.path.insert(0, glob.glob('../../lib/py/build/lib.*')[0])
from tutorial import Calculator
from tutorial.ttypes import *
from PythonServer import CalculatorHandler
Added: thrift/trunk/tutorial/py/Makefile.am
URL:
http://svn.apache.org/viewvc/thrift/trunk/tutorial/py/Makefile.am?rev=1402680&view=auto
==============================================================================
--- thrift/trunk/tutorial/py/Makefile.am (added)
+++ thrift/trunk/tutorial/py/Makefile.am Fri Oct 26 21:46:18 2012
@@ -0,0 +1,35 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+THRIFT = $(top_builddir)/compiler/cpp/thrift
+
+gen-py/tutorial/Calculator.py gen-py/shared/SharedService.py:
$(top_srcdir)/tutorial/tutorial.thrift
+ $(THRIFT) --gen py -r $<
+
+all-local: gen-py/tutorial/Calculator.py
+
+tutorialserver: all
+ ${PYTHON} PythonServer.py
+
+tutorialclient: all
+ ${PYTHON} PythonClient.py
+
+EXTRA_DIST = \
+ PythonServer.py \
+ PythonClient.py
Propchange: thrift/trunk/tutorial/py/Makefile.am
------------------------------------------------------------------------------
svn:executable = *
Modified: thrift/trunk/tutorial/py/PythonClient.py
URL:
http://svn.apache.org/viewvc/thrift/trunk/tutorial/py/PythonClient.py?rev=1402680&r1=1402679&r2=1402680&view=diff
==============================================================================
--- thrift/trunk/tutorial/py/PythonClient.py (original)
+++ thrift/trunk/tutorial/py/PythonClient.py Fri Oct 26 21:46:18 2012
@@ -19,8 +19,9 @@
# under the License.
#
-import sys
-sys.path.append('../gen-py')
+import sys, glob
+sys.path.append('gen-py')
+sys.path.insert(0, glob.glob('../../lib/py/build/lib.*')[0])
from tutorial import Calculator
from tutorial.ttypes import *
Modified: thrift/trunk/tutorial/py/PythonServer.py
URL:
http://svn.apache.org/viewvc/thrift/trunk/tutorial/py/PythonServer.py?rev=1402680&r1=1402679&r2=1402680&view=diff
==============================================================================
--- thrift/trunk/tutorial/py/PythonServer.py (original)
+++ thrift/trunk/tutorial/py/PythonServer.py Fri Oct 26 21:46:18 2012
@@ -19,8 +19,9 @@
# under the License.
#
-import sys
-sys.path.append('../gen-py')
+import sys, glob
+sys.path.append('gen-py')
+sys.path.insert(0, glob.glob('../../lib/py/build/lib.*')[0])
from tutorial import Calculator
from tutorial.ttypes import *