qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1625329 - in /qpid/dispatch/trunk: python/CMakeLists.txt python/install_python.cmake python/qpid_dispatch_internal/management/agent.py python/setup.py.in tools/qdmanage
Date Tue, 16 Sep 2014 15:18:25 GMT
Author: aconway
Date: Tue Sep 16 15:18:24 2014
New Revision: 1625329

URL: http://svn.apache.org/r1625329
Log:
DISPATCH-56:: Fixes to qdmanage and python module installer

- Fix typo in qdmanage, get-* commands were calling 'create' instead of the get-* operation.
- Fix python installer to include output files in cmake install_manifest.txt for uninstall
scripts.

Added:
    qpid/dispatch/trunk/python/install_python.cmake
      - copied, changed from r1625117, qpid/dispatch/trunk/python/CMakeLists.txt
Modified:
    qpid/dispatch/trunk/python/CMakeLists.txt
    qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py
    qpid/dispatch/trunk/python/setup.py.in
    qpid/dispatch/trunk/tools/qdmanage

Modified: qpid/dispatch/trunk/python/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/CMakeLists.txt?rev=1625329&r1=1625328&r2=1625329&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/CMakeLists.txt (original)
+++ qpid/dispatch/trunk/python/CMakeLists.txt Tue Sep 16 15:18:24 2014
@@ -20,10 +20,8 @@
 # Private python modules, not in standard python site dir.
 install(DIRECTORY qpid_dispatch_internal DESTINATION ${QPID_DISPATCH_HOME}/python)
 
-# Python files with CMake config variables. 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in
                ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
 
-# Use python setup.py install for public python modules.	     
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py -v install --prefix=${CMAKE_INSTALL_PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-
+# Install script for public python modules
+install(SCRIPT install_python.cmake)

Copied: qpid/dispatch/trunk/python/install_python.cmake (from r1625117, qpid/dispatch/trunk/python/CMakeLists.txt)
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/install_python.cmake?p2=qpid/dispatch/trunk/python/install_python.cmake&p1=qpid/dispatch/trunk/python/CMakeLists.txt&r1=1625117&r2=1625329&rev=1625329&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/CMakeLists.txt (original)
+++ qpid/dispatch/trunk/python/install_python.cmake Tue Sep 16 15:18:24 2014
@@ -17,13 +17,16 @@
 # under the License.
 #
 
-# Private python modules, not in standard python site dir.
-install(DIRECTORY qpid_dispatch_internal DESTINATION ${QPID_DISPATCH_HOME}/python)
+# Install script to install public python modules.
+# Install with setup.py, add installed files to install manifest.
 
-# Python files with CMake config variables. 
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in
-               ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
+include(FindPythonInterp)
 
-# Use python setup.py install for public python modules.	     
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py -v install --prefix=${CMAKE_INSTALL_PREFIX}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+set(PYTHON_MANIFEST ${CMAKE_CURRENT_BINARY_DIR}/python/python_manifest.txt)
 
+execute_process(COMMAND ${PYTHON_EXECUTABLE}
+  setup.py -v install --prefix=${CMAKE_INSTALL_PREFIX} --record=${PYTHON_MANIFEST}
+  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python)
+
+file(READ ${PYTHON_MANIFEST} PYTHON_MANIFEST_FILES)
+list(APPEND CMAKE_INSTALL_MANIFEST_FILES ${PYTHON_MANIFEST_FILES})

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py?rev=1625329&r1=1625328&r2=1625329&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py Tue Sep 16 15:18:24
2014
@@ -18,7 +18,7 @@
 #
 
 """
-Pyton agent for dispatch router.
+Python agent for dispatch router.
 
 Implements the server side of the AMQP management protocol for the dispatch router.
 Manages a set of manageable Entities that can be Created, Read, Updated and Deleted.

Modified: qpid/dispatch/trunk/python/setup.py.in
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/setup.py.in?rev=1625329&r1=1625328&r2=1625329&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/setup.py.in (original)
+++ qpid/dispatch/trunk/python/setup.py.in Tue Sep 16 15:18:24 2014
@@ -19,33 +19,36 @@
 #
 
 from distutils.core import setup
-from distutils.sysconfig import get_python_lib
+from distutils.command.build_py import build_py
+from distutils.file_util import write_file
 import os
 
 """Install public packages and scripts for Qpid Dispatch."""
 
+class BuildPy(build_py):
+    """Extend standard build command, add generated site_data.py file."""
+
+    def site_data_py(self): return os.path.join(self.build_lib, 'qpid_dispatch', 'site_data.py')
+
+    def run(self):
+        build_py.run(self)      # Run the standard build
+        write_file(self.site_data_py(), ['HOME = "${QPID_DISPATCH_HOME_INSTALLED}"'])
+
+    def get_outputs(self, **kwargs):
+        return build_py.get_outputs(self, **kwargs) +[self.site_data_py()]
+
+# Install public python modules in standard python locations.
 setup(
     name='qpid_dispatch',
     description='Apache Qpid Dispatch tools and libraries.',
-
+    package_dir={'' : '${CMAKE_SOURCE_DIR}/python'},
     packages=['qpid_dispatch', 'qpid_dispatch.management'],
-    package_dir={'qpid_dispatch' : '${CMAKE_SOURCE_DIR}/python/qpid_dispatch'},
     scripts=['${CMAKE_SOURCE_DIR}/tools/qdstat', '${CMAKE_SOURCE_DIR}/tools/qdmanage'],
+    cmdclass={'build_py': BuildPy},
 
     version='${QPID_DISPATCH_VERSION}',
     author='Apache Qpid',
     author_email='dev@qpid.apache.org',
     url='http://qpid.apache.org/',
-    license='Apache Software License',
+    license='Apache Software License'
 )
-
-# Create site_data.py pointing to the install location for the private files.
-site_data = os.path.join(
-    get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}'), 'qpid_dispatch', 'site_data.py')
-try:
-    print "creating %s" % (site_data)
-    f = open(site_data, 'w')
-    f.write('HOME = "${QPID_DISPATCH_HOME_INSTALLED}"\n')
-finally:
-    f.close()
-

Modified: qpid/dispatch/trunk/tools/qdmanage
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/tools/qdmanage?rev=1625329&r1=1625328&r2=1625329&view=diff
==============================================================================
--- qpid/dispatch/trunk/tools/qdmanage (original)
+++ qpid/dispatch/trunk/tools/qdmanage Tue Sep 16 15:18:24 2014
@@ -186,21 +186,21 @@ For help with a command: %s <command> --
         self.setup(
             "Get the list of entity types. Prints a JSON list of type names.",
             [('type', 'string', 'Restrict types implementing <type>.')])
-        self.print_json(self.call_node('create'))
+        self.print_json(self.call_node('get-types'))
 
     @commands
     def get_attributes(self):
         self.setup(
             "Get the list of entity attribute names. Prints a JSON list of attribute names.",
             [('type', 'string', 'If set return only attributes for <type>.')])
-        self.print_json(self.call_node('create'))
+        self.print_json(self.call_node('get-attributes'))
 
     @commands
     def get_operations(self):
         self.setup(
             "Get the list of entity operation names. Prints a JSON list of operation names.",
             [('type', 'string', 'If set return only operations for <type>.')])
-        self.print_json(self.call_node('create'))
+        self.print_json(self.call_node('get-operations'))
 
 
 def main(argv):



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message