some code refactoring

This commit is contained in:
Miroslav Stampar
2010-04-16 19:57:00 +00:00
parent 1bdf94f236
commit 915d3441e9
5 changed files with 23 additions and 18 deletions

View File

@@ -34,8 +34,10 @@ import ntpath
import posixpath
import subprocess
from StringIO import StringIO
from tempfile import NamedTemporaryFile
from tempfile import mkstemp
from xml.sax import parse
from extra.cloak.cloak import decloak
from lib.contrib import magic
@@ -1084,4 +1086,12 @@ def getConsoleWidth(default=80):
except:
pass
return width if width else default
return width if width else default
def parseXmlFile(xmlFile, handler):
file = open(paths.GENERIC_XML)
content = file.read()
stream = StringIO(content)
parse(stream, handler)
stream.close()
file.close()