forked from expo/troggle
tidying and prep for python3
This commit is contained in:
@@ -82,14 +82,14 @@ def get_or_create_placeholder(year):
|
||||
# logging.info("added survey " + survey[header['Year']] + "#" + surveyobj.wallet_number + "\r")
|
||||
|
||||
# dead
|
||||
def listdir(*directories):
|
||||
try:
|
||||
return os.listdir(os.path.join(settings.SURVEYS, *directories))
|
||||
except:
|
||||
import urllib.request, urllib.parse, urllib.error
|
||||
url = settings.SURVEYS + reduce(lambda x, y: x + "/" + y, ["listdir"] + list(directories))
|
||||
folders = urllib.request.urlopen(url.replace("#", "%23")).readlines()
|
||||
return [folder.rstrip(r"/") for folder in folders]
|
||||
# def listdir(*directories):
|
||||
# try:
|
||||
# return os.listdir(os.path.join(settings.SURVEYS, *directories))
|
||||
# except:
|
||||
# import urllib.request, urllib.parse, urllib.error
|
||||
# url = settings.SURVEYS + reduce(lambda x, y: x + "/" + y, ["listdir"] + list(directories))
|
||||
# folders = urllib.request.urlopen(url.replace("#", "%23")).readlines()
|
||||
# return [folder.rstrip(r"/") for folder in folders]
|
||||
|
||||
# add survey scans
|
||||
# def parseSurveyScans(expedition, logfile=None):
|
||||
@@ -171,13 +171,13 @@ def listdir(*directories):
|
||||
# parseSurveyScans(expedition)
|
||||
|
||||
# dead
|
||||
def isInterlacedPNG(filePath): #We need to check for interlaced PNGs because the thumbnail engine can't handle them (uses PIL)
|
||||
file=Image.open(filePath)
|
||||
print(filePath)
|
||||
if 'interlace' in file.info:
|
||||
return file.info['interlace']
|
||||
else:
|
||||
return False
|
||||
# def isInterlacedPNG(filePath): #We need to check for interlaced PNGs because the thumbnail engine can't handle them (uses PIL)
|
||||
# file=Image.open(filePath)
|
||||
# print(filePath)
|
||||
# if 'interlace' in file.info:
|
||||
# return file.info['interlace']
|
||||
# else:
|
||||
# return False
|
||||
|
||||
|
||||
# handles url or file, so we can refer to a set of scans on another server
|
||||
|
||||
Reference in New Issue
Block a user