From 16495c40566af58a5089b9babaad88b4dcfd8e68 Mon Sep 17 00:00:00 2001 From: Reiko Kaps Date: Wed, 5 Feb 2020 23:11:44 +0100 Subject: [PATCH 1/6] Create pythonapp.yml --- .github/workflows/pythonapp.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pythonapp.yml diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml new file mode 100644 index 0000000..73e1394 --- /dev/null +++ b/.github/workflows/pythonapp.yml @@ -0,0 +1,30 @@ +name: Python application + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint with flake8 + run: | + pip install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pip install pytest + pytest From a3e8dd7f855cc50422a00429038e5628d75d957b Mon Sep 17 00:00:00 2001 From: Reiko Kaps Date: Wed, 5 Feb 2020 23:16:12 +0100 Subject: [PATCH 2/6] Update pythonapp.yml --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 73e1394..3b4345d 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + python setup.py install - name: Lint with flake8 run: | pip install flake8 From 1961aa8df464e212d027f1c56bd3d98559b1be7c Mon Sep 17 00:00:00 2001 From: Reiko Kaps Date: Sun, 9 Feb 2020 16:45:14 +0100 Subject: [PATCH 3/6] update pythonapp.yml less is more --- .github/workflows/pythonapp.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 3b4345d..6352ac4 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -17,14 +17,4 @@ jobs: run: | python -m pip install --upgrade pip python setup.py install - - name: Lint with flake8 - run: | - pip install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pip install pytest - pytest + From b4b2edb4096d7b6a9f4ca21d0122537ee81f7d84 Mon Sep 17 00:00:00 2001 From: Reiko Kaps Date: Sun, 9 Feb 2020 16:47:29 +0100 Subject: [PATCH 4/6] Badge added --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1ee3f2f..c72cdc1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # SpaceApiCli +![Python application](https://github.com/reikkaps/spaceapicli/workflows/Python%20application/badge.svg) + a simple cmdline tool to access the hackspace-API from the unix console or toolbars like polybar From 1e47040b750d0844722781a44c359ae29dc1866e Mon Sep 17 00:00:00 2001 From: Reiko Kaps Date: Sun, 9 Feb 2020 16:48:57 +0100 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c72cdc1..797bc67 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SpaceApiCli -![Python application](https://github.com/reikkaps/spaceapicli/workflows/Python%20application/badge.svg) +![Python application](https://github.com/reikkaps/spaceapicli/workflows/Python%20application/badge.svg?branch=master) a simple cmdline tool to access the hackspace-API from the unix console or toolbars like polybar From 9215b20a138a0fda0c82035612055cc25ff991b1 Mon Sep 17 00:00:00 2001 From: "Reik Kaps (lulu)" Date: Sun, 9 Feb 2020 18:43:13 +0100 Subject: [PATCH 6/6] Some beauty fixes --- src/SpaceApiCli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SpaceApiCli.py b/src/SpaceApiCli.py index d904f41..b745b7c 100644 --- a/src/SpaceApiCli.py +++ b/src/SpaceApiCli.py @@ -49,10 +49,10 @@ def status(json, verbose): pass if json['state']['open'] is False: - print('🧘 closed'.format(str(json['space']))) + print(' {} is closed'.format(str(json['space']))) return False - print('🌞 open'.format(str(json['space']))) + print(' {} is open'.format(str(json['space']))) return True