for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import logging
import yorm
yorm
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 yorm.types import List, Object
yorm.types
import profanityfilter
profanityfilter
log = logging.getLogger(__name__)
@yorm.attr(items=List.of_type(Object))
@yorm.sync("data/cache/{self.name}.yml")
class Cache:
SIZE = 100
def __init__(self, filtered=True):
self.items = []
self.disabled = False
self.filtered = filtered
@property
def name(self):
return 'filtered' if self.filtered else 'unfiltered'
def add(self, **kwargs):
if self._skip_cache(kwargs):
return
log.info("Caching: %s", kwargs)
self.items.insert(0, kwargs)
while len(self.items) > self.SIZE:
self.items.pop()
def get(self, index):
log.info("Getting cache index: %s", index)
try:
data = self.items[index]
except IndexError:
data = {}
log.info("Retrieved cache: %s", data)
return data
def _skip_cache(self, kwargs):
if self.disabled:
log.debug("Caching disabled")
return True
if kwargs in self.items:
log.debug("Already cached: %s", kwargs)
if self.filtered:
if kwargs['key'] == 'custom':
log.debug("Skipped caching of custom background: %s", kwargs)
if profanityfilter.is_profane(kwargs['path']):
log.debug("Skipped caching of profane content: %s", kwargs)
return False
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__.pyfiles in your module folders. Make sure that you place one file in each sub-folder.