GUI: demonstrate that blender has recieved results of the request

This commit is contained in:
gandalf3
2017-06-29 21:11:43 -07:00
parent 0b506d8759
commit 1418c45a8a
3 changed files with 23 additions and 8 deletions

View File

@@ -42,6 +42,7 @@ class SubprocessOperatorMixin:
else:
newdata = None
except EOFError:
print("done polling")
return {'FINISHED'}
if newdata is not None:
@@ -52,13 +53,16 @@ class PACKAGE_OT_fetch(SubprocessOperatorMixin, bpy.types.Operator):
bl_idname = "package.fetch"
bl_label = "Update package list(s)"
last_response = None
def __init__(self):
SubprocessOperatorMixin.__init__(self)
settings = bpy.context.window_manager.package_manager_settings
self.subprocess = Process(target=blenderpack.fetch, args=(settings.url, self.pipe))
def handle_response(self, resp):
print("your response:", resp)
self.__class__.last_response = resp
self.report({'INFO'}, "Request returned %s" % self.__class__.last_response)
def execute(self, context):
return {'FINISHED'}