Skip to content

Commit 8d7fd0d

Browse files
committed
black
1 parent b9224ba commit 8d7fd0d

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

fcpd/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def runPD():
6262
pdBin = userPref.GetString("pd_path")
6363

6464
if not shutil.which(pdBin):
65-
FreeCAD.Console.PrintError(f"Unable to find {pdBin}.\r\nPlease check the pure-data client binary path in the Edit menu/Preferences…/FCPD page.")
65+
FreeCAD.Console.PrintError(
66+
f"Unable to find {pdBin}.\r\nPlease check the pure-data client binary path in the Edit menu/Preferences…/FCPD page."
67+
)
6668
return
6769

6870
pdlib = "pdlib"

fcpd/pdserver.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ def errorHandler(self, msg):
103103
"""can be overwriten"""
104104
return f"ERROR {sys.exc_info()[1]}"
105105

106-
107106
## stores a message processing function for specific first words
108107
# @param self
109108
# @param first_words list of first words for which the function is called
@@ -137,17 +136,20 @@ def _pdMsgListProcessor(self, msgList):
137136
self.isWaiting = False
138137
Log(
139138
"FCPD",
140-
f"PDServer : Callback initialized to {self.remoteAddress.toString()}:{words[1]}\n"
139+
f"PDServer : Callback initialized to {self.remoteAddress.toString()}:{words[1]}\n",
141140
)
142141
if self.writeBuffer:
143-
Wrn("FCPD", "PDServer : The data previously stored are now sent\n")
142+
Wrn(
143+
"FCPD",
144+
"PDServer : The data previously stored are now sent\n",
145+
)
144146
self.outputSocket.write(bytes(self.writeBuffer, "utf8"))
145147
Log("FCPD", f"PDServer : >>> {self.writeBuffer}\r\n")
146148
self.writeBuffer = ""
147149
else:
148150
Log(
149151
"FCPD",
150-
f"PDServer : ERROR during callback initialization\n{self.outputSocket.error()}\n"
152+
f"PDServer : ERROR during callback initialization\n{self.outputSocket.error()}\n",
151153
)
152154
elif words[0] == "close":
153155
self.terminate()
@@ -183,7 +185,7 @@ def send(self, *data):
183185
Wrn(
184186
"FCPD",
185187
"WARNING : Data are sent to PDServer but Pure-Data is not connected.\n"
186-
"The data will be kept until connection.\n"
188+
"The data will be kept until connection.\n",
187189
)
188190

189191
## launch the server
@@ -216,7 +218,7 @@ def newConnection(self):
216218
self.remoteAddress = self.inputSocket.peerAddress()
217219
Log(
218220
"FCPD",
219-
f"PDServer : Connection from {self.remoteAddress.toString()}:{self.inputSocket.peerPort()}\r\n"
221+
f"PDServer : Connection from {self.remoteAddress.toString()}:{self.inputSocket.peerPort()}\r\n",
220222
)
221223
Notif("FCPD", "The server is now connected.")
222224

@@ -239,7 +241,7 @@ def readyRead(self):
239241
def remoteClose(self):
240242
Log(
241243
"FCPD",
242-
f"PDServer : {self.inputSocket.peerAddress().toString()} close connection\r\n"
244+
f"PDServer : {self.inputSocket.peerAddress().toString()} close connection\r\n",
243245
)
244246
if self.isRunning:
245247
self.terminate()

fcpdwb_commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ def IsActive(self):
180180
return True
181181

182182

183-
FreeCADGui.addCommand('FCPD_Run', FCPD_CommandRun())
184-
FreeCADGui.addCommand('FCPD_Stop', FCPD_CommandStop())
183+
FreeCADGui.addCommand("FCPD_Run", FCPD_CommandRun())
184+
FreeCADGui.addCommand("FCPD_Stop", FCPD_CommandStop())
185185
FreeCADGui.addCommand("FCPD_Launch", FCPD_CommandLaunch())
186186
FreeCADGui.addCommand("FCPD_AddInclude", FCPD_CommandAddInclude())
187187
FreeCADGui.addCommand("FCPD_AddPopulatedInclude", FCPD_CommandAddPopulatedInclude())

0 commit comments

Comments
 (0)