Some more drei updates

This commit is contained in:
Miroslav Stampar
2019-05-15 10:57:22 +02:00
parent cc9711ef5b
commit a4e9d3e661
8 changed files with 27 additions and 18 deletions

View File

@@ -33,7 +33,7 @@ from lib.core.settings import MAX_INT
from lib.core.settings import NULL
from lib.core.unescaper import unescaper
from lib.request import inject
from thirdparty import six
from thirdparty.six import unichr as _unichr
def pivotDumpTable(table, colList, count=None, blind=True, alias=None):
lengths = {}
@@ -143,7 +143,7 @@ def pivotDumpTable(table, colList, count=None, blind=True, alias=None):
if column == colList[0]:
if isNoneValue(value):
try:
for pivotValue in filterNone((" " if pivotValue == " " else None, "%s%s" % (pivotValue[0], six.unichr(ord(pivotValue[1]) + 1)) if len(pivotValue) > 1 else None, six.unichr(ord(pivotValue[0]) + 1))):
for pivotValue in filterNone((" " if pivotValue == " " else None, "%s%s" % (pivotValue[0], _unichr(ord(pivotValue[1]) + 1)) if len(pivotValue) > 1 else None, _unichr(ord(pivotValue[0]) + 1))):
value = _(column, pivotValue)
if not isNoneValue(value):
break

View File

@@ -13,8 +13,10 @@ import stat
import string
from lib.core.common import getSafeExString
from lib.core.common import openFile
from lib.core.compat import xrange
from lib.core.data import logger
from thirdparty.six import unichr as _unichr
def purge(directory):
"""
@@ -47,8 +49,8 @@ def purge(directory):
for filepath in filepaths:
try:
filesize = os.path.getsize(filepath)
with open(filepath, "w+b") as f:
f.write("".join(chr(random.randint(0, 255)) for _ in xrange(filesize)))
with openFile(filepath, "w+b") as f:
f.write("".join(_unichr(random.randint(0, 255)) for _ in xrange(filesize)))
except:
pass