summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2013-04-25 17:28:55 +0200
committerDieter Verfaillie <dieterv@optionexplicit.be>2013-05-07 15:36:09 +0200
commite7e1ba84f31759cec59460be93bcbd01f1add62a (patch)
treea6b564a5c1d2e4635d507d69b2c31db243f072fa /giscanner
parentbb482abafe4bc6d88cbbc4abc36967a3012e9f50 (diff)
downloadgobject-introspection-e7e1ba84f31759cec59460be93bcbd01f1add62a.tar.gz
giscanner: move odict.OrderedDict into a collections package
because we'll add more related code to collections later on https://bugzilla.gnome.org/show_bug.cgi?id=699536
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/annotationparser.py2
-rw-r--r--giscanner/ast.py2
-rw-r--r--giscanner/collections/__init__.py22
-rw-r--r--giscanner/collections/ordereddict.py (renamed from giscanner/odict.py)3
4 files changed, 27 insertions, 2 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index f722346c..ef9cd31d 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -26,7 +26,7 @@
import re
from . import message
-from .odict import OrderedDict
+from .collections import OrderedDict
# GTK-Doc comment block parts
diff --git a/giscanner/ast.py b/giscanner/ast.py
index d307b553..25184886 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -24,8 +24,8 @@ from itertools import chain
from . import message
+from .collections import OrderedDict
from .message import Position
-from .odict import OrderedDict
from .utils import to_underscores
class Type(object):
diff --git a/giscanner/collections/__init__.py b/giscanner/collections/__init__.py
new file mode 100644
index 00000000..29987a10
--- /dev/null
+++ b/giscanner/collections/__init__.py
@@ -0,0 +1,22 @@
+# -*- Mode: Python -*-
+# GObject-Introspection - a framework for introspecting GObject libraries
+# Copyright (C) 2013 Dieter Verfaillie <dieterv@optionexplicit.be>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+
+
+from .ordereddict import OrderedDict
diff --git a/giscanner/odict.py b/giscanner/collections/ordereddict.py
index f9558954..0cb4b956 100644
--- a/giscanner/odict.py
+++ b/giscanner/collections/ordereddict.py
@@ -1,6 +1,7 @@
# -*- Mode: Python -*-
# GObject-Introspection - a framework for introspecting GObject libraries
# Copyright (C) 2008 Johan Dahlin
+# Copyright (C) 2013 Dieter Verfaillie <dieterv@optionexplicit.be>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -27,6 +28,8 @@
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
+
+
class OrderedDict(dict):
"""A dict that returns keys/values/items in the order they were added."""