Skip to content

Create a vertical ProgressBar Widget #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 55 commits into from
Apr 25, 2021
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a3362c9
Move library file into directory for packaging
hugodahl Feb 5, 2021
b733a99
Add git ignore file
hugodahl Feb 5, 2021
8407b23
Add docstrings to the created base class
hugodahl Feb 5, 2021
d9c8bd0
Tidy up some Pylint issues
hugodahl Feb 5, 2021
73d5fca
Rename package directory for Pylint script
hugodahl Feb 5, 2021
a154e96
Infrastructure changes to use as a package
hugodahl Feb 6, 2021
2d01c31
Making more use of the base class from the descendant
hugodahl Feb 8, 2021
30207ff
Cleanup, and add additional range parameters and properties
hugodahl Feb 8, 2021
a9ee271
Updated ReadTheDocs config for new structure
hugodahl Feb 10, 2021
a0836c9
Fixup some Pylint issues
hugodahl Feb 12, 2021
7a29bc0
Fix CP syntax issues
hugodahl Feb 12, 2021
90640b7
Temp pylint bypass for WIP
hugodahl Feb 12, 2021
eb16c1a
Fix display issues
hugodahl Feb 13, 2021
d91cc96
Add starter MatrixPortal example
hugodahl Feb 13, 2021
e1f87ae
Start importing and refactoring vertical bat
hugodahl Feb 14, 2021
abf1765
Add docstring info about fill direction
hugodahl Feb 14, 2021
91865d0
Continue refactor to include vertical progressbar
hugodahl Feb 15, 2021
656c642
Refactor out changes to ProgressBarBase
hugodahl Feb 15, 2021
ea4b835
Update documentation
hugodahl Feb 16, 2021
e46aefb
Some refactoring. Getting negative values working
hugodahl Feb 16, 2021
104c0e1
Add Blinka/PyGame display example
hugodahl Feb 16, 2021
2f33d72
Fixup DisplayIO/Blinka example
hugodahl Feb 16, 2021
e3a4cb4
Add blinka-displayio-pygamedisplay requirement for example
hugodahl Feb 17, 2021
d356dce
Fixed up based and vertical logic, minus edge case
hugodahl Feb 17, 2021
60d27d6
Vertical range 0-100 working. Alternates not scaling right
hugodahl Feb 18, 2021
630abe1
Proper ratio calculation for various ranges
hugodahl Feb 19, 2021
c8c664d
Fixup final touches for ratio
hugodahl Feb 19, 2021
a507cc8
Adjustments for fully working shim
hugodahl Feb 19, 2021
7dc19bc
Remove debug 'print' statement
hugodahl Feb 20, 2021
3bc9bcd
Change margin to support a numeric value
hugodahl Feb 20, 2021
f3658c5
Add validation of initial values at instantiation
hugodahl Feb 20, 2021
17e22e0
Add enumerations for fill direction
hugodahl Feb 20, 2021
41dbeda
Changes to style and behaviour based on PR feedback
hugodahl Feb 20, 2021
44cb1f8
Update ProgressBar to use native values
hugodahl Feb 20, 2021
13721ce
Fix issue with floating point rendering
hugodahl Feb 20, 2021
9048455
Update sample for 0.0-1.0 range
hugodahl Feb 21, 2021
dc2daf7
Changes completed
hugodahl Feb 21, 2021
549c3ad
Changes based on PR feedback
hugodahl Feb 22, 2021
c5f52eb
Fix issues with borders & margins
hugodahl Feb 27, 2021
cc07251
Update requirements
hugodahl Feb 27, 2021
e8e6dad
Apply changes from cookiecutter
hugodahl Feb 27, 2021
ad83ce1
Fixup docstrings for __init__ method
hugodahl Feb 27, 2021
7be06b6
Update examples
hugodahl Feb 27, 2021
a2e3ada
Add type hints
hugodahl Feb 27, 2021
d29176a
Don't fail if the 'typing' library isn't available
hugodahl Mar 9, 2021
a0a661b
Validate values are in range for 'value' and 'progress'
hugodahl Mar 9, 2021
da82b42
Make 'render()' method private
hugodahl Mar 12, 2021
f1767bc
Refactor more common code to the core class
hugodahl Mar 14, 2021
999a8da
Remove duplicated code
hugodahl Mar 14, 2021
e6a0c73
Refactor for duplicate code
hugodahl Mar 27, 2021
8a72116
Handle both fill directions
hugodahl Mar 28, 2021
b8120f8
All widgets working
hugodahl Mar 28, 2021
2526085
Update MatrixPortal example
hugodahl Mar 28, 2021
f5d7ed9
Update examples and docs
hugodahl Apr 18, 2021
a51a1f6
Added example provided by @FoamyGuy
hugodahl Apr 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,19 @@ jobs:
- name: Pre-commit hooks
run: |
pre-commit run --all-files
- name: PyLint
run: |
pylint $( find . -path './adafruit*.py' )
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
- name: Build assets
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
- name: Archive bundles
uses: actions/upload-artifact@v2
with:
name: bundles
path: ${{ github.workspace }}/bundles/
- name: Check For docs folder
id: need-docs
run: |
echo ::set-output name=docs::$( find . -wholename './docs' )
- name: Build docs
if: contains(steps.need-docs.outputs.docs, 'docs')
working-directory: docs
run: sphinx-build -E -W -b html . _build/html
- name: Check For setup.py
Expand Down
341 changes: 341 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,341 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT

# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.toptal.com/developers/gitignore/api/macos

# Created by https://www.toptal.com/developers/gitignore/api/windows
# Edit at https://www.toptal.com/developers/gitignore?templates=windows

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows

# Created by https://www.toptal.com/developers/gitignore/api/linux
# Edit at https://www.toptal.com/developers/gitignore?templates=linux

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# End of https://www.toptal.com/developers/gitignore/api/linux

# Created by https://www.toptal.com/developers/gitignore/api/jetbrains
# Edit at https://www.toptal.com/developers/gitignore?templates=jetbrains

### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

# End of https://www.toptal.com/developers/gitignore/api/jetbrains

# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
pytestdebug.log

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
pythonenv*

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# profiling data
.prof

# End of https://www.toptal.com/developers/gitignore/api/python
.idea/
19 changes: 17 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

repos:
- repo: https://github.com/python/black
rev: stable
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/fsfe/reuse-tool
rev: latest
rev: v0.12.1
hooks:
- id: reuse
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -17,3 +17,18 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/pylint
rev: pylint-2.7.1
hooks:
- id: pylint
name: pylint (library code)
types: [python]
exclude: "^(docs/|examples/|setup.py$)"
- repo: local
hooks:
- id: pylint_examples
name: pylint (examples code)
description: Run pylint rules on "examples/*.py" files
entry: /usr/bin/env bash -c
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
language: system
Loading