GUI: demonstrate that blender has recieved results of the request
This commit is contained in:
@@ -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'}
|
||||
|
Reference in New Issue
Block a user