Merge pull request #266 from oHTGo/master

add new version of symbol block & empty
This commit is contained in:
Anmol Singh
2022-03-09 11:20:45 +05:30
committed by GitHub
3 changed files with 18 additions and 2 deletions

View File

@@ -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 dont 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)

View File

@@ -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'

View File

@@ -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'''
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))}"