trying with key
This commit is contained in:
@@ -130,7 +130,7 @@ class Config(object):
|
|||||||
config[name] = template['min']
|
config[name] = template['min']
|
||||||
|
|
||||||
if template['type'] == 'list':
|
if template['type'] == 'list':
|
||||||
if 'index' in template:
|
# if 'index' in template:
|
||||||
config = config[name]
|
config = config[name]
|
||||||
|
|
||||||
for i in range(len(template['index'])):
|
for i in range(len(template['index'])):
|
||||||
@@ -213,14 +213,14 @@ class Config(object):
|
|||||||
|
|
||||||
# Handle list
|
# Handle list
|
||||||
if tmpl['type'] == 'list':
|
if tmpl['type'] == 'list':
|
||||||
if 'index' in tmpl:
|
# if 'index' in tmpl:
|
||||||
for i in range(len(tmpl['index'])):
|
for i in range(len(tmpl['index'])):
|
||||||
if config is not None and i < len(config): conf = config[i]
|
if config is not None and i < len(config): conf = config[i]
|
||||||
else: conf = None
|
else: conf = None
|
||||||
self._encode(name, index + tmpl['index'][i], conf,
|
self._encode(name, index + tmpl['index'][i], conf,
|
||||||
tmpl['template'], with_defaults)
|
tmpl['template'], with_defaults)
|
||||||
else:
|
# else:
|
||||||
self.values[name]=value;
|
# self.values[name]=value;
|
||||||
return
|
return
|
||||||
|
|
||||||
# Update config values
|
# Update config values
|
||||||
|
|||||||
@@ -535,6 +535,7 @@
|
|||||||
|
|
||||||
"macros": {
|
"macros": {
|
||||||
"type": "list",
|
"type": "list",
|
||||||
|
"index": "12345678",
|
||||||
"default": [
|
"default": [
|
||||||
{
|
{
|
||||||
"name": "Macros 1",
|
"name": "Macros 1",
|
||||||
@@ -595,6 +596,7 @@
|
|||||||
|
|
||||||
"macrosList": {
|
"macrosList": {
|
||||||
"type": "list",
|
"type": "list",
|
||||||
|
"index": "0123456",
|
||||||
"default": [],
|
"default": [],
|
||||||
"template": {
|
"template": {
|
||||||
"file_name": {
|
"file_name": {
|
||||||
@@ -606,6 +608,7 @@
|
|||||||
|
|
||||||
"gcodeList": {
|
"gcodeList": {
|
||||||
"type": "list",
|
"type": "list",
|
||||||
|
"index": "012345",
|
||||||
"default": [],
|
"default": [],
|
||||||
"template": {
|
"template": {
|
||||||
"file_name": {
|
"file_name": {
|
||||||
|
|||||||
Reference in New Issue
Block a user