Send repolist to blender and list contents

This commit is contained in:
Ellwood Zwovic
2017-07-13 19:06:31 -07:00
parent 67b1857e58
commit 2e45bf637a
2 changed files with 49 additions and 1 deletions

View File

@@ -66,6 +66,11 @@ class DownloadError(SubprocMessage):
class Success(SubprocMessage):
"""Sent when an operation finished sucessfully."""
class Result(SubprocMessage):
"""Sent when an operation returns data to be used on the parent process."""
def __init__(self, data):
self.data = data
class Aborted(SubprocMessage):
"""Sent as response to Abort message."""
@@ -492,7 +497,7 @@ def refresh(pipe_to_blender, storage_path: pathlib.Path, repository_url: str):
pipe_to_blender.send(DownloadError(err.status_code, err.message))
repo.to_file(repo_path) # TODO: this always writes even if repo wasn't changed
pipe_to_blender.send(Success())
pipe_to_blender.send(Result(repo.to_dict()))
def debug_hang():
"""Hangs for an hour. For testing purposes only."""