Browse files

Add support for "Python 2.6".

  • Loading branch information...
1 parent 6c27bb5 commit 47014acffc19973843099b81623432591174ded7 @KelSolaar committed Sep 16, 2012
Showing with 140 additions and 32 deletions.
  1. +17 −5 foundations/dataStructures.py
  2. +5 −1 foundations/parsers.py
  3. +4 −1 foundations/tests/tests.py
  4. +5 −1 foundations/tests/testsFoundations/testsCache.py
  5. +5 −1 foundations/tests/testsFoundations/testsCommon.py
  6. +5 −1 foundations/tests/testsFoundations/testsCore.py
  7. +5 −1 foundations/tests/testsFoundations/testsDataStructures.py
  8. +5 −1 foundations/tests/testsFoundations/testsEnvironment.py
  9. +5 −1 foundations/tests/testsFoundations/testsExceptions.py
  10. +5 −1 foundations/tests/testsFoundations/testsGlobals/testsConstants.py
  11. +5 −1 foundations/tests/testsFoundations/testsIo.py
  12. +5 −1 foundations/tests/testsFoundations/testsLibrary.py
  13. +5 −1 foundations/tests/testsFoundations/testsNamespace.py
  14. +5 −1 foundations/tests/testsFoundations/testsNodes.py
  15. +7 −2 foundations/tests/testsFoundations/testsParsers.py
  16. +5 −1 foundations/tests/testsFoundations/testsPkzip.py
  17. +5 −1 foundations/tests/testsFoundations/testsRotatingBackup.py
  18. +5 −1 foundations/tests/testsFoundations/testsStreamObject.py
  19. +5 −1 foundations/tests/testsFoundations/testsStrings.py
  20. +5 −1 foundations/tests/testsFoundations/testsTcpServer.py
  21. +5 −1 foundations/tests/testsFoundations/testsUi/testsCommon.py
  22. +5 −1 foundations/tests/testsFoundations/testsWalkers.py
  23. +1 −1 setup.py
  24. +4 −1 utilities/getSphinxDocumentationApi.py
  25. +4 −1 utilities/getSphinxDocumentationTocTree.py
  26. +4 −1 utilities/libraries/python/pyclbr.py
  27. +4 −1 utilities/sliceDocumentation.py
View
22 foundations/dataStructures.py
@@ -18,7 +18,11 @@
#*** External imports.
#**********************************************************************************************************************
import logging
-from collections import OrderedDict
+import sys
+if sys.version_info[:2] == (2, 6):
+ from ordereddict import OrderedDict
+else:
+ from collections import OrderedDict
#**********************************************************************************************************************
#*** Internal imports.
@@ -263,9 +267,13 @@ def __setattr__(self, attribute, value):
:param value.: Value. ( Object )
"""
- if hasattr(self, "_OrderedDict__root") and hasattr(self, "_OrderedDict__map"):
- if self._OrderedDict__root:
+ if sys.version_info[:2] == (2, 6):
+ if not attribute in ("_OrderedDict__map", "_OrderedDict__end"):
OrderedDict.__setitem__(self, attribute, value)
+ else:
+ if hasattr(self, "_OrderedDict__root") and hasattr(self, "_OrderedDict__map"):
+ if self._OrderedDict__root:
+ OrderedDict.__setitem__(self, attribute, value)
OrderedDict.__setattr__(self, attribute, value)
# @core.executionTrace
@@ -276,9 +284,13 @@ def __delattr__(self, attribute):
:param attribute.: Attribute. ( Object )
"""
- if hasattr(self, "_OrderedDict__root") and hasattr(self, "_OrderedDict__map"):
- if self._OrderedDict__root:
+ if sys.version_info[:2] == (2, 6):
+ if not attribute in ("_OrderedDict__map", "_OrderedDict__end"):
OrderedDict.__delitem__(self, attribute)
+ else:
+ if hasattr(self, "_OrderedDict__root") and hasattr(self, "_OrderedDict__map"):
+ if self._OrderedDict__root:
+ OrderedDict.__delitem__(self, attribute)
OrderedDict.__delattr__(self, attribute)
class Lookup(dict):
View
6 foundations/parsers.py
@@ -22,8 +22,12 @@
import datetime
import logging
import re
-from collections import OrderedDict
+import sys
from xml.etree import ElementTree
+if sys.version_info[:2] == (2, 6):
+ from ordereddict import OrderedDict
+else:
+ from collections import OrderedDict
#**********************************************************************************************************************
#*** Internal imports.
View
5 foundations/tests/tests.py
@@ -18,7 +18,10 @@
#**********************************************************************************************************************
import os
import sys
-import unittest
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsCache.py
@@ -16,7 +16,11 @@
#**********************************************************************************************************************
#*** External imports.
#**********************************************************************************************************************
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsCommon.py
@@ -19,7 +19,11 @@
#**********************************************************************************************************************
import os
import platform
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsCore.py
@@ -20,7 +20,11 @@
import inspect
import logging
import types
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsDataStructures.py
@@ -18,7 +18,11 @@
#*** External imports.
#**********************************************************************************************************************
import pickle
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsEnvironment.py
@@ -19,7 +19,11 @@
#**********************************************************************************************************************
import os
import platform
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsExceptions.py
@@ -18,7 +18,11 @@
#*** External imports.
#**********************************************************************************************************************
import inspect
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsGlobals/testsConstants.py
@@ -17,7 +17,11 @@
#**********************************************************************************************************************
#*** External imports.
#**********************************************************************************************************************
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsIo.py
@@ -19,7 +19,11 @@
import os
import shutil
import tempfile
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsLibrary.py
@@ -19,7 +19,11 @@
import ctypes
import os
import platform
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsNamespace.py
@@ -17,7 +17,11 @@
#**********************************************************************************************************************
#*** External imports.
#**********************************************************************************************************************
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsNodes.py
@@ -19,7 +19,11 @@
#**********************************************************************************************************************
import pickle
import re
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
9 foundations/tests/testsFoundations/testsParsers.py
@@ -20,8 +20,13 @@
import datetime
import os
import tempfile
-import unittest
-from collections import OrderedDict
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+ from ordereddict import OrderedDict
+else:
+ import unittest
+ from collections import OrderedDict
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsPkzip.py
@@ -19,7 +19,11 @@
import os
import shutil
import tempfile
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsRotatingBackup.py
@@ -20,7 +20,11 @@
import os
import shutil
import tempfile
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsStreamObject.py
@@ -17,7 +17,11 @@
#**********************************************************************************************************************
#*** External imports.
#**********************************************************************************************************************
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsStrings.py
@@ -20,7 +20,11 @@
import os
import platform
import re
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsTcpServer.py
@@ -17,7 +17,11 @@
#*** External imports.
#**********************************************************************************************************************
import socket
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
6 foundations/tests/testsFoundations/testsUi/testsCommon.py
@@ -18,7 +18,11 @@
#*** External imports.
#**********************************************************************************************************************
import os
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
from PyQt4.QtGui import QWidget
#**********************************************************************************************************************
View
6 foundations/tests/testsFoundations/testsWalkers.py
@@ -18,7 +18,11 @@
#**********************************************************************************************************************
import os
import re
-import unittest
+import sys
+if sys.version_info[:2] == (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
#**********************************************************************************************************************
#*** Internal imports.
View
2 setup.py
@@ -34,7 +34,7 @@ def getLongDescription():
license="GPLv3",
description="Foundations is the core package of Umbra, sIBL_GUI, sIBL_Reporter.",
long_description=getLongDescription(),
- install_requires=["sphinx>=1.1.3"],
+ install_requires=["ordereddict>=1.1", "sphinx>=1.1.3", "unittest2>=0.5.1"],
classifiers=["Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
View
5 utilities/getSphinxDocumentationApi.py
@@ -24,7 +24,10 @@
import re
import shutil
import sys
-from collections import OrderedDict
+if sys.version_info[:2] == (2, 6):
+ from ordereddict import OrderedDict
+else:
+ from collections import OrderedDict
#**********************************************************************************************************************
#*** Internal imports.
View
5 utilities/getSphinxDocumentationTocTree.py
@@ -21,7 +21,10 @@
import os
import re
import sys
-from collections import OrderedDict
+if sys.version_info[:2] == (2, 6):
+ from ordereddict import OrderedDict
+else:
+ from collections import OrderedDict
#**********************************************************************************************************************
#*** Internal imports.
View
5 utilities/libraries/python/pyclbr.py
@@ -42,9 +42,12 @@
import sys
import imp
import tokenize
-from collections import OrderedDict
from token import NAME, DEDENT, OP
from operator import itemgetter
+if sys.version_info[:2] == (2, 6):
+ from ordereddict import OrderedDict
+else:
+ from collections import OrderedDict
__all__ = ["readmodule", "readmodule_ex", "Class", "Function"]
View
5 utilities/sliceDocumentation.py
@@ -20,7 +20,10 @@
import os
import re
import sys
-from collections import OrderedDict
+if sys.version_info[:2] == (2, 6):
+ from ordereddict import OrderedDict
+else:
+ from collections import OrderedDict
#**********************************************************************************************************************
#*** Internal imports.

0 comments on commit 47014ac

Please sign in to comment.