From 517644febd8d6ceffcf0e4f99afa22ddc4b87faf Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 15 Nov 2020 02:37:03 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0eb6285..350980d 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,15 @@ class DownloadExample(Coordinator): def name(cls): return "DownloadExample" + @property + def input(self): + return RssInput(f"http://www.obsrv.com/General/ImageFeed.aspx?{self.query}", + lambda x: FileData(x.title, x["media_content"][0]["url"], False)) + @property def pipeline(self) -> List[Union[Pipe, Callable[[APData], Union[APData, Pipe]]]]: return [Output(DownloaderPipe())] - def get_input(self): - return RssInput(f"http://www.obsrv.com/General/ImageFeed.aspx?{self.query}", - lambda x: FileData(x.title, x["media:content"], True)) - - ``` ### For this coordinator to be found by autopipe, you must use one of the three following way From 11c796410c6ac810fe7ae14d4b720c7eb87b85db Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 15 Nov 2020 02:47:57 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 350980d..43a340e 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,12 @@ class DownloadExample(Coordinator): ### For this coordinator to be found by autopipe, you must use one of the three following way 1) Place your coordinator file into the `autopipe/coordinators` folders, import your coordinator in the `autopipe/coordinators/__init__.py` file and place your coordinator name in the `__all__` array of this file. 2) Run autopipe with the coordinator argument set to the path of your file followed by ':' and the coordinator's class name. For example if your coordinator's file is named `coordinator.py`, is located in the current directory and your coordinator's name is `DownloadExample`, your coordinator argument would be `../coordinator.py:DownloadExample` - 3) Send your coordinator file to the standard input of autopipe and use `-` as your coordinator name. **SOON** + 3) Send your coordinator file to the standard input of autopipe and use `-` as your coordinator name. *SOON* -### To run this, you have two ways +### To run this, you have three ways 1) Use the autopipe file in the bin folder like so: ``./autopipe [coordinator_parameters]`` 2) Use the module syntaxe like so: ``python -m autopipe [coordinator_parameters]`` + 3) Use the shebang ``#!/usr/bin/env autopipe -``, set your coordinator file executable (``chmod +x file.py``) and execute it. *SOON* ## Coordinators options A pipeline always start with an `Input`. You specify the instance of thte input manager you will use in the `get_input()` method.