You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2014/07/08 22:31:22 UTC

svn commit: r1608950 - in /qpid/dispatch/trunk: python/qpid_dispatch_internal/management/qdrouter.py src/entity_private.h

Author: aconway
Date: Tue Jul  8 20:31:22 2014
New Revision: 1608950

URL: http://svn.apache.org/r1608950
Log:
NO-JIRA: Minor fixes to work on python 2.5, gcc 4.4.7

Modified:
    qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py
    qpid/dispatch/trunk/src/entity_private.h

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py?rev=1608950&r1=1608949&r2=1608950&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.py Tue Jul  8 20:31:22 2014
@@ -27,6 +27,11 @@ from entity import EntityList, Entity, O
 from copy import copy
 import libqpid_dispatch
 
+if sys.version_info >= (2,7):
+    json_load_kwargs = {'object_pairs_hook':OrderedDict}
+else:
+    json_load_kwargs = {}
+
 class QdSchema(schema.Schema):
     """
     Qpid Dispatch Router management schema.
@@ -36,7 +41,7 @@ class QdSchema(schema.Schema):
     def __init__(self):
         """Load schema."""
         with open(self.SCHEMA_FILE) as f:
-            super(QdSchema, self).__init__(**json.load(f, object_pairs_hook=OrderedDict))
+            super(QdSchema, self).__init__(**json.load(f, **json_load_kwargs))
 
     def validate(self, entities, **kwargs):
         """
@@ -81,7 +86,7 @@ class QdConfig(EntityList):
         js_text = "[%s]"%("".join([sub(l) for l in lines]))
         spare_comma = re.compile(r',\s*([]}])') # Strip spare commas
         js_text = re.sub(spare_comma, r'\1', js_text)
-        return json.loads(js_text, object_pairs_hook=OrderedDict)
+        return json.loads(js_text, **json_load_kwargs)
 
     def _expand(self, content):
         """

Modified: qpid/dispatch/trunk/src/entity_private.h
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/entity_private.h?rev=1608950&r1=1608949&r2=1608950&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/entity_private.h (original)
+++ qpid/dispatch/trunk/src/entity_private.h Tue Jul  8 20:31:22 2014
@@ -1,5 +1,5 @@
 #ifndef ENTITY_PRIVATE_H
-#define ENTITY_PRIVATE_H
+#define ENTITY_PRIVATE_H 1
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -20,10 +20,7 @@
  */
 
 #include <stdbool.h>
-
-typedef struct qd_entity_t qd_entity_t;
-
-typedef struct qd_dispatch_t qd_dispatch_t;
+#include <qpid/dispatch/dispatch.h>
 
 void qd_entity_free(qd_entity_t* entity);
 



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