Skip to content

Commit

Permalink
fix pylint/pep8 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
trey0 committed Oct 4, 2012
1 parent 80cfaaa commit 551fc58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions geocamTiePoint/models.py
Expand Up @@ -135,8 +135,8 @@ def getImage(self):
# apparently image.file is not a very good file work-alike,
# so let's delegate to StringIO(), which PIL is tested against
bits = self.imageData.image.file.read()
logging.info('getImage len=%s header=%s'
% (len(bits), repr(bits[:10])))
logging.info('getImage len=%s header=%s',
len(bits), repr(bits[:10]))
fakeFile = StringIO(bits)

im = PIL.Image.open(fakeFile)
Expand All @@ -157,8 +157,8 @@ def getGeneratorWithCache(cls, quadTreeId):
result = cachedGeneratorCopy['value']
else:
logging.debug('getGeneratorWithCache miss %s', key)
quadTree = get_object_or_404(QuadTree, id=quadTreeId)
result = quadTree.getGenerator()
q = get_object_or_404(QuadTree, id=quadTreeId)
result = q.getGenerator()
cachedGeneratorG = dict(key=key, value=result)
return result

Expand Down
12 changes: 6 additions & 6 deletions geocamTiePoint/views.py
Expand Up @@ -139,8 +139,8 @@ def overlayNew(request):
out = StringIO()
image.save(out, format='png')
convertedBits = out.getvalue()
logging.info('converted image to RGBA, output length %s bytes'
% len(bits))
logging.info('converted image to RGBA, output length %s bytes',
len(bits))
imageData.image.save('dummy.png', ContentFile(convertedBits),
save=False)
imageData.contentType = 'image/png'
Expand Down Expand Up @@ -316,10 +316,10 @@ def getPublicTile(request, quadTreeId, zoom, x, y):
cacheKey = 'geocamTiePoint.QuadTree.isPublic.%s' % quadTreeId
quadTreeIsPublic = cache.get(cacheKey)
if quadTreeIsPublic is None:
logging.info('getPublicTile MISS %s' % cacheKey)
logging.info('getPublicTile MISS %s', cacheKey)
try:
quadTree = QuadTree.objects.get(id=quadTreeId)
overlay = quadTree.alignedOverlays.get()
q = QuadTree.objects.get(id=quadTreeId)
overlay = q.alignedOverlays.get()
except ObjectDoesNotExist:
overlay = None
if overlay:
Expand All @@ -328,7 +328,7 @@ def getPublicTile(request, quadTreeId, zoom, x, y):
quadTreeIsPublic = False
cache.set(cacheKey, quadTreeIsPublic, 60)
else:
logging.info('getPublicTile hit %s' % cacheKey)
logging.info('getPublicTile hit %s', cacheKey)

if quadTreeIsPublic:
return getTile(request, quadTreeId, zoom, x, y)
Expand Down

0 comments on commit 551fc58

Please sign in to comment.