Compare commits

..

4 Commits

Author SHA1 Message Date
skullY 9cab9ea610 New release: 0.0.20 → 0.0.21 2019-11-11 13:04:13 -08:00
skullY 177fa55bce fix pytest in qmkfm/base_container 2019-11-11 13:03:39 -08:00
skullY 0783864629 New release: 0.0.19 → 0.0.20 2019-11-11 11:56:35 -08:00
skullY 8ec66dd599 Improve --version 2019-11-11 11:56:20 -08:00
5 changed files with 18 additions and 5 deletions
+8 -1
View File
@@ -249,6 +249,9 @@ class MILC(object):
"""
def __init__(self):
"""Initialize the MILC object.
version
The version string to associate with your CLI program
"""
# Setup a lock for thread safety
self._lock = threading.RLock() if thread else None
@@ -263,7 +266,7 @@ class MILC(object):
self.config = None
self.config_file = None
self.default_arguments = {}
self.version = os.environ.get('QMK_VERSION', 'unknown')
self.version = 'unknown'
self.release_lock()
# Figure out our program name
@@ -356,6 +359,9 @@ class MILC(object):
logging.root.setLevel(logging.DEBUG)
self.release_lock()
def initialize_arguments(self):
"""Setup the global parser arguments
"""
self.add_argument('-V', '--version', version=self.version, action='version', help='Display the version and exit')
self.add_argument('-v', '--verbose', action='store_true', help='Make the logging more verbose')
self.add_argument('--datetime-fmt', default='%Y-%m-%d %H:%M:%S', help='Format string for datetimes')
@@ -666,6 +672,7 @@ class MILC(object):
self.release_lock()
colorama.init()
self.initialize_arguments()
self.parse_args()
self.merge_args_into_config()
self.setup_logging()
+1 -1
View File
@@ -1,3 +1,3 @@
"""A program to help you work with qmk_firmware."""
__version__ = '0.0.19'
__version__ = '0.0.21'
+6 -1
View File
@@ -56,7 +56,10 @@ def find_qmk_firmware():
return Path(milc.cli.config.user.qmk_home).expanduser().resolve()
if 'QMK_HOME' in os.environ:
return Path(os.environ['QMK_HOME']).expanduser().resolve()
path = Path(os.environ['QMK_HOME']).expanduser()
if path.exists():
return path.resolve()
return path
return Path.home() / 'qmk_firmware'
@@ -65,6 +68,8 @@ def main():
"""Setup the environment before dispatching to the entrypoint.
"""
# Environment setup
import qmk_cli
milc.cli.version = qmk_cli.__version__
qmk_firmware = find_qmk_firmware()
os.environ['QMK_HOME'] = str(qmk_firmware)
os.environ['ORIG_CWD'] = os.getcwd()
+1 -1
View File
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.19
current_version = 0.0.21
commit = True
tag = True
tag_name = {new_version}
+2 -1
View File
@@ -44,6 +44,7 @@ if __name__ == "__main__":
"appdirs",
"argcomplete",
"colorama",
"hjson"
"hjson",
"yapf"
],
)