Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d5bae7

Browse files
committed
Removing some obsolete functions
1 parent bcc907c commit 4d5bae7

2 files changed

Lines changed: 0 additions & 64 deletions

File tree

lib/core/common.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,20 +1307,6 @@ def getCharset(charsetType=None):
13071307

13081308
return asciiTbl
13091309

1310-
def searchEnvPath(filename):
1311-
retVal = None
1312-
path = os.environ.get("PATH", "")
1313-
paths = path.split(";") if IS_WIN else path.split(":")
1314-
1315-
for _ in paths:
1316-
_ = _.replace(";", "")
1317-
retVal = os.path.exists(os.path.normpath(os.path.join(_, filename)))
1318-
1319-
if retVal:
1320-
break
1321-
1322-
return retVal
1323-
13241310
def directoryPath(filepath):
13251311
"""
13261312
Returns directory path for a given filepath
@@ -1428,13 +1414,6 @@ def showStaticWords(firstPage, secondPage):
14281414

14291415
logger.info(infoMsg)
14301416

1431-
def isWindowsPath(filepath):
1432-
"""
1433-
Returns True if given filepath is in Windows format
1434-
"""
1435-
1436-
return re.search("\A[\w]\:\\\\", filepath) is not None
1437-
14381417
def isWindowsDriveLetterPath(filepath):
14391418
"""
14401419
Returns True if given filepath starts with a Windows drive letter
@@ -2467,20 +2446,6 @@ def showHttpErrorCodes():
24672446
for code, count in kb.httpErrorCodes.items())
24682447
logger.warn(warnMsg)
24692448

2470-
def getComparePageRatio(firstPage, secondPage, filtered=False):
2471-
"""
2472-
Returns comparison ratio between two given pages
2473-
"""
2474-
2475-
if filtered:
2476-
(firstPage, secondPage) = map(getFilteredPageContent, (firstPage, secondPage))
2477-
2478-
seqMatcher = getCurrentThreadData().seqMatcher
2479-
seqMatcher.set_seq1(firstPage)
2480-
seqMatcher.set_seq2(secondPage)
2481-
2482-
return seqMatcher.quick_ratio()
2483-
24842449
def openFile(filename, mode='r'):
24852450
"""
24862451
Returns file handle of a given filename
@@ -2734,16 +2699,6 @@ def unsafeSQLIdentificatorNaming(name):
27342699

27352700
return retVal
27362701

2737-
def isBinaryData(value):
2738-
"""
2739-
Tests given value for binary content
2740-
"""
2741-
2742-
retVal = False
2743-
if isinstance(value, basestring):
2744-
retVal = reduce(lambda x, y: x or not (y in string.printable or ord(y) > 255), value, False)
2745-
return retVal
2746-
27472702
def isNoneValue(value):
27482703
"""
27492704
Returns whether the value is unusable (None or '')

lib/core/convert.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,6 @@ def hexdecode(value):
4747
def hexencode(value):
4848
return utf8encode(value).encode("hex")
4949

50-
def md5hash(value):
51-
if "hashlib" in sys.modules:
52-
return hashlib.md5(value).hexdigest()
53-
else:
54-
return md5.new(value).hexdigest()
55-
56-
def orddecode(value):
57-
packedString = struct.pack("!" + "I" * len(value), *value)
58-
return "".join(chr(char) for char in struct.unpack("!" + "I" * (len(packedString) / 4), packedString))
59-
60-
def ordencode(value):
61-
return tuple(ord(char) for char in value)
62-
63-
def sha1hash(value):
64-
if "hashlib" in sys.modules:
65-
return hashlib.sha1(value).hexdigest()
66-
else:
67-
return sha.new(value).hexdigest()
68-
6950
def unicodeencode(value, encoding=None):
7051
"""
7152
Return 8-bit string representation of the supplied unicode value:

0 commit comments

Comments
 (0)