giscanner: implement DocOption() in terms of odict instead of dict
authorDieter Verfaillie <dieterv@optionexplicit.be>
Wed, 21 Nov 2012 16:42:41 +0000 (17:42 +0100)
committerDieter Verfaillie <dieterv@optionexplicit.be>
Wed, 28 Nov 2012 20:31:22 +0000 (21:31 +0100)
The order of the "options" key/value pairs returned by
DocOption().all() should be identical to the order in
which they where stored. Hence replace the dict usage
with odict.

https://bugzilla.gnome.org/show_bug.cgi?id=688897

gir/glib-2.0.c
giscanner/annotationparser.py

index 1499a6d..51805c4 100644 (file)
  * returned array is %NULL-terminated, so @length may optionally
  * be %NULL.
  *
- * Returns: (array length=length zero-terminated=1) (element-type utf8) (transfer full): a newly allocated %NULL-terminated string array or %NULL if the key isn't found. The string array should be freed with g_strfreev().
+ * Returns: (array zero-terminated=1 length=length) (element-type utf8) (transfer full): a newly allocated %NULL-terminated string array or %NULL if the key isn't found. The string array should be freed with g_strfreev().
  * Since: 2.6
  */
 
  * event that the @group_name cannot be found, %NULL is returned
  * and @error is set to #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.
  *
- * Returns: (array length=length zero-terminated=1) (element-type utf8) (transfer full): a %NULL-terminated string array or %NULL if the specified key cannot be found. The array should be freed with g_strfreev().
+ * Returns: (array zero-terminated=1 length=length) (element-type utf8) (transfer full): a %NULL-terminated string array or %NULL if the specified key cannot be found. The array should be freed with g_strfreev().
  * Since: 2.6
  */
 
  * @group_name: a group name
  * @key: a key
  * @locale: a locale identifier
- * @list: (array length=length zero-terminated=1): a %NULL-terminated array of locale string values
+ * @list: (array zero-terminated=1 length=length): a %NULL-terminated array of locale string values
  * @length: the length of @list
  *
  * Associates a list of string values for @key and @locale under
  * @key_file: a #GKeyFile
  * @group_name: a group name
  * @key: a key
- * @list: (array length=length zero-terminated=1) (element-type utf8): an array of string values
+ * @list: (array zero-terminated=1 length=length) (element-type utf8): an array of string values
  * @length: number of string values in @list
  *
  * Associates a list of string values for @key under @group_name.
  *
  * The return value must be freed using g_free().
  *
- * Returns: (transfer full) (array length=length zero-terminated=1) (element-type guint8): a newly allocated string
+ * Returns: (transfer full) (array zero-terminated=1 length=length) (element-type guint8): a newly allocated string
  * Since: 2.26
  */
 
index 364fdbf..c405ef4 100644 (file)
@@ -437,7 +437,7 @@ class DocOption(object):
     def __init__(self, tag, option):
         self.tag = tag
         self._array = []
-        self._dict = {}
+        self._dict = odict()
         # (annotation option1=value1 option2=value2) etc
         for p in option.split(' '):
             if '=' in p: