diff --git a/README.md b/README.md index 969f5de..0dafc19 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,6 @@ You can just download the docker container and run it locally without Kubernetes ``` $ docker run -d -e PRJID="9ca799e6-52c4-4a9e-8b40-461eef4f57e9" -e WSNAME="tpk" -e APIKEY="plane_api_xxxxxxxxxxxxxxxxxxxxxx" -e TABLETITLE="Passed In Title" -e IGNORESTATE="Cancelled" -p 8999:80 --name pyplanetest pyplanelist:0.0.7 20903d6f949e0ebb150f0d5c54825350cc521af4194b039e75a0f6fa7bafcb4e -``` \ No newline at end of file +``` + +Note: Ignore state can be a comma seperated list of states to hide \ No newline at end of file diff --git a/src/app.py b/src/app.py index 6c4e8b4..4d1698b 100644 --- a/src/app.py +++ b/src/app.py @@ -12,6 +12,10 @@ tableTitle = os.environ.get("TABLETITLE") ignoreState = os.environ.get("IGNORESTATE") +# check if csv a contains b +def check_string_in_list(a, b): + return any(e in b for e in a.split(',')) + @app.route('/') def index(): url = f'https://api.plane.so/api/v1/workspaces/{workspacename}/projects/{projectid}/issues/' @@ -36,7 +40,7 @@ def index(): for state in stateresults: if state["id"] == result['state']: stateName = state["name"] - if ignoreState != stateName: + if not check_string_in_list(ignoreState,stateName): table_data.append([result['name'], stateName, description_html, result['target_date']]) env = Environment(loader=FileSystemLoader('/app')) template = env.get_template('table.html')