Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Mar 15, 2022
1 parent e2027c6 commit 7da5105
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/java/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def __repr__(self):
def __str__(self):
ret = self.language
if self.country:
ret += "_{}".format(self.country)
ret += f"_{self.country}"
if self.variant:
ret += "_{}".format(self.variant)
ret += f"_{self.variant}"
return unicode(ret)

@ClassProperty
Expand Down
2 changes: 1 addition & 1 deletion src/system/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def dataSetToHTML(
The HTML page as a string.
"""
print(showHeaders, dataset, title)
return "<html><head>{}</head><body>data</body></html>".format(title)
return f"<html><head>{title}</head><body>data</body></html>"


def deleteRow(dataset, rowIndex):
Expand Down
2 changes: 1 addition & 1 deletion src/system/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def getTempFile(extension):
Returns:
The path to the newly created temp file.
"""
suffix = ".{}".format(extension)
suffix = f".{extension}"
with tempfile.NamedTemporaryFile(suffix=suffix) as temp:
return temp.name

Expand Down
2 changes: 1 addition & 1 deletion src/system/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def inputBox(
options = ["OK", "Cancel"]

panel = JPanel()
label = JLabel("{}: ".format(message))
label = JLabel(f"{message}: ")
panel.add(label)
text_field = JTextField(25)
text_field.setText(defaultText)
Expand Down
2 changes: 1 addition & 1 deletion src/system/sfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def resumeChart(instanceId):
KeyError: If the ID does not match any running chart instance.
"""
if not instanceId:
raise KeyError("Invalid UUID string: {}".format(instanceId))
raise KeyError(f"Invalid UUID string: {instanceId}")


def setVariable(
Expand Down
4 changes: 2 additions & 2 deletions src/system/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def getProperty(propertyName):
elif propertyName == "os.version":
ret = platform.release()
elif propertyName == "user.home":
ret = os.path.expanduser(str("~"))
ret = os.path.expanduser("~")
elif propertyName == "user.name":
ret = getpass.getuser()

Expand Down Expand Up @@ -869,7 +869,7 @@ def threadDump():
Returns:
The dump of the current running JVM.
"""
return "Ignition version: {}...".format(version.__version__)
return f"Ignition version: {version.__version__}..."


def translate(
Expand Down

0 comments on commit 7da5105

Please sign in to comment.