Browse Source

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.

Thomas Karl Pietrowski 8 years ago
parent
commit
29f7c240c4
2 changed files with 6 additions and 2 deletions
  1. 5 1
      plugins/SliceInfoPlugin/SliceInfo.py
  2. 1 1
      plugins/SliceInfoPlugin/__init__.py

+ 5 - 1
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)
 

+ 1 - 1
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
         }
     }