Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored master branch #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, value):
super(RegistryKeyHasNoParentException, self).__init__(value)

def __str__(self):
return "Registry key has no parent key: %s" % (self._value)
return f"Registry key has no parent key: {self._value}"


class RegistryKeyNotFoundException(RegistryParse.RegistryStructureDoesNotExist):
Expand All @@ -81,7 +81,7 @@ def __init__(self, value):
super(RegistryKeyNotFoundException, self).__init__(value)

def __str__(self):
return "Registry key not found: %s" % (self._value)
return f"Registry key not found: {self._value}"

class RegistryValueNotFoundException(RegistryParse.RegistryStructureDoesNotExist):
"""
Expand All @@ -95,7 +95,7 @@ def __init__(self, value):
super(RegistryValueNotFoundException, self).__init__(value)

def __str__(self):
return "Registry value not found: %s" % (self._value)
return f"Registry value not found: {self._value}"

class RegistryValue(object):
"""
Expand All @@ -111,10 +111,7 @@ def name(self):
Get the name of the value as a string.
The name of the default value is returned as "(default)".
"""
if self._vkrecord.has_name():
return self._vkrecord.name()
else:
return "(default)"
return self._vkrecord.name() if self._vkrecord.has_name() else "(default)"

def value_type(self):
"""
Expand Down Expand Up @@ -273,8 +270,8 @@ def value(self, name):
if v.name().lower() == name.lower():
return RegistryValue(v)
except RegistryParse.RegistryStructureDoesNotExist:
raise RegistryValueNotFoundException(self.path() + " : " + name)
raise RegistryValueNotFoundException(self.path() + " : " + name)
raise RegistryValueNotFoundException(f"{self.path()} : {name}")
raise RegistryValueNotFoundException(f"{self.path()} : {name}")

def find_key(self, path):
"""
Expand Down
Loading