Removing some obsolete functions

This commit is contained in:
Miroslav Stampar 2013-01-18 11:18:56 +01:00
parent bcc907ce09
commit 4d5bae7131
2 changed files with 0 additions and 64 deletions

View File

@ -1307,20 +1307,6 @@ def getCharset(charsetType=None):
return asciiTbl return asciiTbl
def searchEnvPath(filename):
retVal = None
path = os.environ.get("PATH", "")
paths = path.split(";") if IS_WIN else path.split(":")
for _ in paths:
_ = _.replace(";", "")
retVal = os.path.exists(os.path.normpath(os.path.join(_, filename)))
if retVal:
break
return retVal
def directoryPath(filepath): def directoryPath(filepath):
""" """
Returns directory path for a given filepath Returns directory path for a given filepath
@ -1428,13 +1414,6 @@ def showStaticWords(firstPage, secondPage):
logger.info(infoMsg) logger.info(infoMsg)
def isWindowsPath(filepath):
"""
Returns True if given filepath is in Windows format
"""
return re.search("\A[\w]\:\\\\", filepath) is not None
def isWindowsDriveLetterPath(filepath): def isWindowsDriveLetterPath(filepath):
""" """
Returns True if given filepath starts with a Windows drive letter Returns True if given filepath starts with a Windows drive letter
@ -2467,20 +2446,6 @@ def showHttpErrorCodes():
for code, count in kb.httpErrorCodes.items()) for code, count in kb.httpErrorCodes.items())
logger.warn(warnMsg) logger.warn(warnMsg)
def getComparePageRatio(firstPage, secondPage, filtered=False):
"""
Returns comparison ratio between two given pages
"""
if filtered:
(firstPage, secondPage) = map(getFilteredPageContent, (firstPage, secondPage))
seqMatcher = getCurrentThreadData().seqMatcher
seqMatcher.set_seq1(firstPage)
seqMatcher.set_seq2(secondPage)
return seqMatcher.quick_ratio()
def openFile(filename, mode='r'): def openFile(filename, mode='r'):
""" """
Returns file handle of a given filename Returns file handle of a given filename
@ -2734,16 +2699,6 @@ def unsafeSQLIdentificatorNaming(name):
return retVal return retVal
def isBinaryData(value):
"""
Tests given value for binary content
"""
retVal = False
if isinstance(value, basestring):
retVal = reduce(lambda x, y: x or not (y in string.printable or ord(y) > 255), value, False)
return retVal
def isNoneValue(value): def isNoneValue(value):
""" """
Returns whether the value is unusable (None or '') Returns whether the value is unusable (None or '')

View File

@ -47,25 +47,6 @@ def hexdecode(value):
def hexencode(value): def hexencode(value):
return utf8encode(value).encode("hex") return utf8encode(value).encode("hex")
def md5hash(value):
if "hashlib" in sys.modules:
return hashlib.md5(value).hexdigest()
else:
return md5.new(value).hexdigest()
def orddecode(value):
packedString = struct.pack("!" + "I" * len(value), *value)
return "".join(chr(char) for char in struct.unpack("!" + "I" * (len(packedString) / 4), packedString))
def ordencode(value):
return tuple(ord(char) for char in value)
def sha1hash(value):
if "hashlib" in sys.modules:
return hashlib.sha1(value).hexdigest()
else:
return sha.new(value).hexdigest()
def unicodeencode(value, encoding=None): def unicodeencode(value, encoding=None):
""" """
Return 8-bit string representation of the supplied unicode value: Return 8-bit string representation of the supplied unicode value: