minor refactoring

This commit is contained in:
Bernardo Damele 2012-12-19 00:46:23 +00:00
parent 318fcee49c
commit 8e95470415

View File

@ -25,6 +25,7 @@ from lib.core.common import isListLike
from lib.core.common import isNumPosStrValue from lib.core.common import isNumPosStrValue
from lib.core.common import listToStrValue from lib.core.common import listToStrValue
from lib.core.common import readInput from lib.core.common import readInput
from lib.core.convert import hexdecode
from lib.core.convert import htmlunescape from lib.core.convert import htmlunescape
from lib.core.data import conf from lib.core.data import conf
from lib.core.data import kb from lib.core.data import kb
@ -208,16 +209,17 @@ def _errorReplaceChars(value):
def _formatPartialContent(value): def _formatPartialContent(value):
""" """
Prepares (possibly hex) partial content for safe console output Prepares (possibly hex-encoded) partial content for safe console output
""" """
if value and isinstance(value, basestring): if value and isinstance(value, basestring):
try: try:
value = value.decode("hex") value = hexdecode(value)
except: except:
pass pass
finally: finally:
value = safecharencode(value) value = safecharencode(value)
return value return value
def errorUse(expression, dump=False): def errorUse(expression, dump=False):