mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Use black with -l 120 param.
This commit is contained in:
1 parent
f928738bd5
commit
c021e21309
194 files changed
+6034
-4564
No files matched your search
@@ -76,9 +76,10 @@ class Notification:
|
||||
os.makedirs("docs/api/notifications", exist_ok=True)
|
||||
try:
|
||||
import json
|
||||
|
||||
data = json.dumps(event, indent=4, sort_keys=True)
|
||||
if "MagicMock" not in data:
|
||||
with open(os.path.join("docs/api/notifications", action + ".json"), 'w+') as f:
|
||||
with open(os.path.join("docs/api/notifications", action + ".json"), "w+") as f:
|
||||
f.write(data)
|
||||
except TypeError: # If we receive a mock as an event it will raise TypeError when using json dump
|
||||
pass
|
||||
@@ -113,8 +114,8 @@ class Notification:
|
||||
except ControllerError: # Project closing
|
||||
return
|
||||
elif action == "ping":
|
||||
event["compute_id"] = compute_id
|
||||
self.project_emit(action, event)
|
||||
event["compute_id"] = compute_id
|
||||
self.project_emit(action, event)
|
||||
else:
|
||||
self.project_emit(action, event, project_id)
|
||||
|
||||
@@ -131,9 +132,10 @@ class Notification:
|
||||
os.makedirs("docs/api/notifications", exist_ok=True)
|
||||
try:
|
||||
import json
|
||||
|
||||
data = json.dumps(event, indent=4, sort_keys=True)
|
||||
if "MagicMock" not in data:
|
||||
with open(os.path.join("docs/api/notifications", action + ".json"), 'w+') as f:
|
||||
with open(os.path.join("docs/api/notifications", action + ".json"), "w+") as f:
|
||||
f.write(data)
|
||||
except TypeError: # If we receive a mock as an event it will raise TypeError when using json dump
|
||||
pass
|
||||
|
||||
Reference in new issue
Block a user