for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import os
from flask import current_app as app
flask
This can be caused by one of the following:
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
# .scrutinizer.yml before_commands: - sudo pip install abc # Python2 - sudo pip3 install abc # Python3
This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.
__init__.py
from ..extensions import redis
from ..domain import Image, Text
def decode_bytstring_dict(dct):
out = {}
for k, v in dct.items():
out[k.decode()] = v.decode()
return out
class ImageStore:
def __init__(self, root):
self.root = root
@property
def latest(self):
data = redis.hgetall('latest')
if not data:
raise FileNotFoundError()
data = decode_bytstring_dict(data)
text = Text(data['path'])
style = data.get('style', None)
if style == 'None':
style = None
template = app.template_service.find(
data['template'],
allow_missing=True
)
image = Image(template, text, style=style, root=self.root)
return image
def exists(self, image):
image.root = self.root
# TODO: add a way to determine if the styled image was already generated
return os.path.isfile(image.path) and not image.style
def create(self, image):
image.generate()
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.