From 29f7c240c42830cef787102b087c17a55ac1b00f Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Thu, 16 Jun 2016 20:37:32 +0200 Subject: [PATCH] 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. --- plugins/SliceInfoPlugin/SliceInfo.py | 6 +++++- plugins/SliceInfoPlugin/__init__.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index c2e8b9a147..6a9e821b10 100644 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -8,6 +8,7 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Scene.SceneNode import SceneNode from UM.Message import Message from UM.i18n import i18nCatalog +from UM.Logger import Logger import collections 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 # no model files are being sent (Just a SHA256 hash of the model). class SliceInfo(Extension): + info_url = "https://stats.youmagine.com/curastats/slice" + def __init__(self): super().__init__() Application.getInstance().getOutputDeviceManager().writeStarted.connect(self._onWriteStarted) @@ -114,7 +117,8 @@ class SliceInfo(Extension): # Submit data 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: print("Exception occured", e) diff --git a/plugins/SliceInfoPlugin/__init__.py b/plugins/SliceInfoPlugin/__init__.py index da9111b2e4..f6e77fbf22 100644 --- a/plugins/SliceInfoPlugin/__init__.py +++ b/plugins/SliceInfoPlugin/__init__.py @@ -11,7 +11,7 @@ def getMetaData(): "author": "Ultimaker", "version": "1.0", "description": catalog.i18nc("@info:whatsthis", "Submits anonymous slice info. Can be disabled through preferences."), - "api": 2 + "api": 3 } }