From 25ac7956bca09c4c495d7c8c73cd5622e4e9480a Mon Sep 17 00:00:00 2001 From: oHTGo Date: Tue, 8 Mar 2022 03:01:29 +0000 Subject: [PATCH] add new version of symbol block & empty --- README.md | 2 ++ action.yml | 5 +++++ main.py | 13 +++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 17debd6..ce7214c 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,8 @@ CSS 2 repos █░░░░░░░░░░░░░░░░ `IGNORED_REPOS` flag can be set to `"waka-readme-stats, my-first-repo"` (just an example) to ignore some repos you don’t want to be counted +`SYMBOL_VERSION` flag can be set to `1` to use █ & ░; set to `2` to use ⣿ & ⣀ for progress bar (default: `1`) + **Timeline** ![Chart not found](https://raw.githubusercontent.com/anmol098/anmol098/master/charts/bar_graph.png) diff --git a/action.yml b/action.yml index 8279968..80b7f18 100644 --- a/action.yml +++ b/action.yml @@ -102,6 +102,11 @@ inputs: description: "Show Total Time you have coded" default: "True" + SYMBOL_VERSION: + required: false + description: "Version of the symbol block and empty of the progress bar" + default: "1" + runs: using: 'docker' image: 'Dockerfile' diff --git a/main.py b/main.py index 4139e25..b80589a 100644 --- a/main.py +++ b/main.py @@ -48,6 +48,7 @@ ignored_repos_name = str(os.getenv('INPUT_IGNORED_REPOS') or '').replace(' ', '' show_updated_date = os.getenv('INPUT_SHOW_UPDATED_DATE') commit_message = os.getenv('INPUT_COMMIT_MESSAGE') show_total_code_time = os.getenv('INPUT_SHOW_TOTAL_CODE_TIME') +symbol_version = os.getenv('INPUT_SYMBOL_VERSION').strip() show_waka_stats = 'y' # The GraphQL query to get commit data. userInfoQuery = """ @@ -173,8 +174,16 @@ def run_query(query): def make_graph(percent: float): '''Make progress graph from API graph''' - done_block = '█' - empty_block = '░' + if (symbol_version == '1'): # version 1 + done_block = '█' + empty_block = '░' + elif (symbol_version == '2'): #version 2 + done_block = '⣿' + empty_block = '⣀' + else: + done_block = '█' #default is version 1 + empty_block = '░' + pc_rnd = round(percent) return f"{done_block * int(pc_rnd / 4)}{empty_block * int(25 - int(pc_rnd / 4))}"