mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
CURA-1615: Updating SlicingInfoPlugin
Just bumped the API version to 3 and added a message that is sent to the log that data was sent to the given URL. As slicing is broken here, because of "Arcus Error (5, native 32): Could not send message size" this also needs testing here.
This commit is contained in:
parent
42a860535c
commit
29f7c240c4
2 changed files with 6 additions and 2 deletions
|
@ -8,6 +8,7 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
from UM.Scene.SceneNode import SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
from UM.Message import Message
|
from UM.Message import Message
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
|
from UM.Logger import Logger
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import json
|
import json
|
||||||
|
@ -25,6 +26,8 @@ catalog = i18nCatalog("cura")
|
||||||
# The data is only sent when the user in question gave permission to do so. All data is anonymous and
|
# The data is only sent when the user in question gave permission to do so. All data is anonymous and
|
||||||
# no model files are being sent (Just a SHA256 hash of the model).
|
# no model files are being sent (Just a SHA256 hash of the model).
|
||||||
class SliceInfo(Extension):
|
class SliceInfo(Extension):
|
||||||
|
info_url = "https://stats.youmagine.com/curastats/slice"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
Application.getInstance().getOutputDeviceManager().writeStarted.connect(self._onWriteStarted)
|
Application.getInstance().getOutputDeviceManager().writeStarted.connect(self._onWriteStarted)
|
||||||
|
@ -114,7 +117,8 @@ class SliceInfo(Extension):
|
||||||
|
|
||||||
# Submit data
|
# Submit data
|
||||||
try:
|
try:
|
||||||
f = urllib.request.urlopen("https://stats.youmagine.com/curastats/slice", data = binary_data, timeout = 1)
|
f = urllib.request.urlopen(self.info_url, data = binary_data, timeout = 1)
|
||||||
|
Logger.log("i", "Sent anonymous slice info to %s", self.info_url)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("Exception occured", e)
|
print("Exception occured", e)
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ def getMetaData():
|
||||||
"author": "Ultimaker",
|
"author": "Ultimaker",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"description": catalog.i18nc("@info:whatsthis", "Submits anonymous slice info. Can be disabled through preferences."),
|
"description": catalog.i18nc("@info:whatsthis", "Submits anonymous slice info. Can be disabled through preferences."),
|
||||||
"api": 2
|
"api": 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue