Permalink
Browse files

Compatibility changes to work on Python 2.5

  • Loading branch information...
1 parent c3d5fca commit 5ae5bbd4b7e80e04129b7bfa0d16c324ab12aff7 @shoe shoe committed Sep 23, 2011
Showing with 10 additions and 3 deletions.
  1. +9 −2 EPFImporter.py
  2. +1 −1 EPFLogger.conf
View
@@ -37,14 +37,20 @@
# (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from __future__ import with_statement
+import logging
+import logging.handlers
import EPFIngester
import MySQLdb
import psycopg2
import os
import sys
import datetime
import re
-import json
+try:
+ import json
+except ImportError:
+ import simplejson as json
import copy
import optparse
import ConfigParser
@@ -80,6 +86,7 @@
if e.errno == errno.EEXIST:
pass
+logging.logging = logging
LOGGER_CONFIG_PATH = "./EPFLogger.conf"
if not os.path.exists(LOGGER_CONFIG_PATH):
#If the logging config file is missing, create one
@@ -106,7 +113,7 @@
conf.set("logger_root", "handlers", "consoleHandler, fileHandler")
conf.set("logger_root", "level", "INFO")
conf.add_section("handlers")
- conf.set("handlers", "keys", "consoleHandler, fileHandler")
+ conf.set("handlers", "keys", "consoleHandler,fileHandler")
conf.add_section("loggers")
conf.set("loggers", "keys", "root")
View
@@ -12,7 +12,7 @@ datefmt =
format = %(asctime)s [%(levelname)s]: %(message)s
[handlers]
-keys = consoleHandler, fileHandler
+keys = consoleHandler,fileHandler
[handler_consoleHandler]
class = StreamHandler

0 comments on commit 5ae5bbd

Please sign in to comment.