forked from ungleich-public/cdist
Unify string formatting
Use one way of string formatting: replace old `%` style with new `str.format`. Resolve #855.
This commit is contained in:
parent
f984a918b9
commit
4c2d273f07
17 changed files with 67 additions and 65 deletions
|
|
@ -30,7 +30,7 @@ class AbsolutePathRequiredError(cdist.Error):
|
|||
self.path = path
|
||||
|
||||
def __str__(self):
|
||||
return 'Absolute path required, got: %s' % self.path
|
||||
return 'Absolute path required, got: {}'.format(self.path)
|
||||
|
||||
|
||||
class FileList(collections.MutableSequence):
|
||||
|
|
@ -218,7 +218,7 @@ class FileBasedProperty:
|
|||
|
||||
def _get_attribute(self, instance, owner):
|
||||
name = self._get_property_name(owner)
|
||||
attribute_name = '__%s' % name
|
||||
attribute_name = '__{}'.format(name)
|
||||
if not hasattr(instance, attribute_name):
|
||||
path = self._get_path(instance)
|
||||
attribute_instance = self.attribute_class(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue