summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-04-26 12:40:32 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-04-26 12:40:32 -0500
commit944df5470f9d30717baccf7b716fd4847b31da27 (patch)
tree1211b8f65d13ff0934b1f3f5a5ada3112ea5a8dd /tools
parent25576cd076d66dfed4bbd98ce1bbb3bc86a6230e (diff)
downloadbcfg2-944df5470f9d30717baccf7b716fd4847b31da27.tar.gz
bcfg2-944df5470f9d30717baccf7b716fd4847b31da27.tar.bz2
bcfg2-944df5470f9d30717baccf7b716fd4847b31da27.zip
Consolidate PY3K compatibility libraries
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/create-debian-pkglist-gp.py6
-rwxr-xr-xtools/create-debian-pkglist.py6
-rwxr-xr-xtools/export.py2
-rwxr-xr-xtools/pkgmgr_gen.py2
-rwxr-xr-xtools/pkgmgr_update.py2
-rw-r--r--tools/py3kcompat.py24
6 files changed, 9 insertions, 33 deletions
diff --git a/tools/create-debian-pkglist-gp.py b/tools/create-debian-pkglist-gp.py
index 23c4127bd..cefb8f3fb 100644
--- a/tools/create-debian-pkglist-gp.py
+++ b/tools/create-debian-pkglist-gp.py
@@ -10,9 +10,9 @@ import sys
import subprocess
# Compatibility imports
-from py3kcompat import StringIO
-from py3kcompat import ConfigParser
-from py3kcompat import urlopen
+from Bcfg2.Bcfg2Py3k import StringIO
+from Bcfg2.Bcfg2Py3k import ConfigParser
+from Bcfg2.Bcfg2Py3k import urlopen
def debug(msg):
'''print debug messages'''
diff --git a/tools/create-debian-pkglist.py b/tools/create-debian-pkglist.py
index 91732aae3..8e1210582 100755
--- a/tools/create-debian-pkglist.py
+++ b/tools/create-debian-pkglist.py
@@ -12,9 +12,9 @@ import re
import sys
# Compatibility imports
-from py3kcompat import StringIO
-from py3kcompat import ConfigParser
-from py3kcompat import urlopen
+from Bcfg2.Bcfg2Py3k import StringIO
+from Bcfg2.Bcfg2Py3k import ConfigParser
+from Bcfg2.Bcfg2Py3k import urlopen
apt_pkg.init()
diff --git a/tools/export.py b/tools/export.py
index e28b8a6e0..d637c166c 100755
--- a/tools/export.py
+++ b/tools/export.py
@@ -9,7 +9,7 @@ from subprocess import Popen, PIPE
import sys
# Compatibility import
-from py3kcompat import formatdate
+from Bcfg2.Bcfg2Py3k import formatdate
pkgname = 'bcfg2'
ftphost = 'terra.mcs.anl.gov'
diff --git a/tools/pkgmgr_gen.py b/tools/pkgmgr_gen.py
index 3ae6ae948..03d36dfc0 100755
--- a/tools/pkgmgr_gen.py
+++ b/tools/pkgmgr_gen.py
@@ -24,7 +24,7 @@ import xml.sax
from xml.sax.handler import ContentHandler
# Compatibility imports
-from py3kcompat import urljoin
+from Bcfg2.Bcfg2Py3k import urljoin
def info(object, spacing=10, collapse=1):
diff --git a/tools/pkgmgr_update.py b/tools/pkgmgr_update.py
index 49514bd11..05d645786 100755
--- a/tools/pkgmgr_update.py
+++ b/tools/pkgmgr_update.py
@@ -22,7 +22,7 @@ import rpm
import sys
# Compatibility imports
-from py3kcompat import urljoin
+from Bcfg2.Bcfg2Py3k import urljoin
try:
from lxml.etree import parse, tostring
diff --git a/tools/py3kcompat.py b/tools/py3kcompat.py
deleted file mode 100644
index b334c4466..000000000
--- a/tools/py3kcompat.py
+++ /dev/null
@@ -1,24 +0,0 @@
-try:
- from email.Utils import formatdate
-except ImportError:
- from email.utils import formatdate
-
-# urllib imports
-try:
- from urllib import urlopen
-except ImportError:
- from urllib.request import urlopen
-try:
- from urlparse import urljoin
-except ImportError:
- from urllib.parse import urljoin
-
-try:
- from cStringIO import StringIO
-except ImportError:
- from io import StringIO
-
-try:
- import ConfigParser
-except ImportError:
- import configparser as ConfigParser