aboutsummaryrefslogtreecommitdiff
path: root/lib/python/milc.py
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2020-02-17 11:42:11 -0800
committerGitHub <noreply@github.com>2020-02-17 11:42:11 -0800
commitc66930445f7d5941eb847568288046d51f853786 (patch)
tree273f290ca81a27bbbe7bdbf90221c02ac11f42cd /lib/python/milc.py
parent58724f8dcb9eccb1c132b8ddab422790ddd26be0 (diff)
downloadqmk_firmware-c66930445f7d5941eb847568288046d51f853786.tar.gz
qmk_firmware-c66930445f7d5941eb847568288046d51f853786.zip
Use pathlib everywhere we can (#7872)
* Use pathlib everywhere we can * Update lib/python/qmk/path.py Co-Authored-By: Erovia <Erovia@users.noreply.github.com> * Update lib/python/qmk/path.py Co-Authored-By: Erovia <Erovia@users.noreply.github.com> * Improvements based on @erovia's feedback * rework qmk compile and qmk flash to use pathlib * style * Remove the subcommand_name argument from find_keyboard_keymap() Co-authored-by: Erovia <Erovia@users.noreply.github.com>
Diffstat (limited to 'lib/python/milc.py')
-rw-r--r--lib/python/milc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/python/milc.py b/lib/python/milc.py
index 949bb0252..83edfc7f5 100644
--- a/lib/python/milc.py
+++ b/lib/python/milc.py
@@ -273,7 +273,7 @@ class MILC(object):
273 self._inside_context_manager = False 273 self._inside_context_manager = False
274 self.ansi = ansi_colors 274 self.ansi = ansi_colors
275 self.arg_only = [] 275 self.arg_only = []
276 self.config = None 276 self.config = self.config_source = None
277 self.config_file = None 277 self.config_file = None
278 self.default_arguments = {} 278 self.default_arguments = {}
279 self.version = 'unknown' 279 self.version = 'unknown'
@@ -473,6 +473,7 @@ class MILC(object):
473 """ 473 """
474 self.acquire_lock() 474 self.acquire_lock()
475 self.config = Configuration() 475 self.config = Configuration()
476 self.config_source = Configuration()
476 self.config_file = self.find_config_file() 477 self.config_file = self.find_config_file()
477 478
478 if self.config_file and self.config_file.exists(): 479 if self.config_file and self.config_file.exists():
@@ -498,6 +499,7 @@ class MILC(object):
498 value = int(value) 499 value = int(value)
499 500
500 self.config[section][option] = value 501 self.config[section][option] = value
502 self.config_source[section][option] = 'config_file'
501 503
502 self.release_lock() 504 self.release_lock()
503 505
@@ -530,12 +532,14 @@ class MILC(object):
530 arg_value = getattr(self.args, argument) 532 arg_value = getattr(self.args, argument)
531 if arg_value is not None: 533 if arg_value is not None:
532 self.config[section][argument] = arg_value 534 self.config[section][argument] = arg_value
535 self.config_source[section][argument] = 'argument'
533 else: 536 else:
534 if argument not in self.config[entrypoint_name]: 537 if argument not in self.config[entrypoint_name]:
535 # Check if the argument exist for this section 538 # Check if the argument exist for this section
536 arg = getattr(self.args, argument) 539 arg = getattr(self.args, argument)
537 if arg is not None: 540 if arg is not None:
538 self.config[section][argument] = arg 541 self.config[section][argument] = arg
542 self.config_source[section][argument] = 'argument'
539 543
540 self.release_lock() 544 self.release_lock()
541 545