diff -r d8fccb2cd802 -r 468f4c8d3d5b Orb/python/orb/filerenamer.py --- a/Orb/python/orb/filerenamer.py Fri Apr 23 20:47:58 2010 +0100 +++ b/Orb/python/orb/filerenamer.py Wed Aug 11 14:49:30 2010 +0100 @@ -13,11 +13,8 @@ import os.path import sys import unittest -import xml import stat import logging -from cStringIO import StringIO -from xml.etree import ElementTree as etree from lib import scan, main, XmlParser, StubXmlParser from optparse import OptionParser @@ -27,6 +24,9 @@ UNSAFE_CHARS = ("\n", "\t", ":", "?", ",", "=", ".", "\\", "/", "[", "]", "|", "<", ">", "+", ";", '"', "-") +logger = logging.getLogger('orb.filerenamer') + + class FileRenamer(object): """ Given an xml file this class returns a MODE compatable filename @@ -74,14 +74,14 @@ try: os.chmod(filepath, stat.S_IWRITE) except Exception, e: - logging.error('Unable to make file \"%s\" writable, error was: %s' % (filepath, e)) + logger.error('Unable to make file \"%s\" writable, error was: %s' % (filepath, e)) continue else: - logging.debug("Renaming %s to %s" % (filepath, newfilename)) + logger.debug("Renaming %s to %s" % (filepath, newfilename)) try: os.rename(filepath, newfilename) except Exception, e: - logging.error('Unable to rename file \"%s\" to \"%s\", error was: %s' % (filepath, newfilename, e)) + logger.error('Unable to rename file \"%s\" to \"%s\", error was: %s' % (filepath, newfilename, e)) def main(): usage = "usage: %prog \n" @@ -95,7 +95,7 @@ parser.error("Please supply the path to the XML content") if options.loglevel: - logging.basicConfig(level=options.loglevel) + logger.basicConfig(level=options.loglevel) rename(args[0],options.publishing_target)