for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import os
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 String, List
yorm.types
from ..domain import Template
class UpperString(String):
__init__
@classmethod
def to_data(cls, obj):
value = super().to_data(obj)
value = value.upper()
return value
@yorm.attr(name=String)
@yorm.attr(link=String)
@yorm.attr(default=List.of_type(UpperString))
@yorm.attr(aliases=List.of_type(String))
@yorm.sync("{self.root}/{self.key}/config.yml")
class TemplateModel:
"""Persistence model for templates."""
def __init__(self, key, root):
self.key = key
self.root = root
self.name = ""
self.default = []
self.link = ""
self.aliases = []
@property
def domain(self):
return Template(
key=self.key,
name=self.name,
lines=self.default,
aliases=self.aliases,
link=self.link,
root=self.root,
)
class TemplateStore:
def __init__(self, root):
self._items = {}
for key in os.listdir(self.root):
if key[0] not in ('.', '_'):
model = TemplateModel(key, self.root)
yorm.save(model)
self._items[key] = model
def read(self, key):
try:
model = self._items[key]
except KeyError:
return None
else:
return model.domain
def filter(self, **_):
templates = []
for model in self._items.values():
templates.append(model.domain)
return templates
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.