QooXDoo example for config.json from manual produce error pretty-print
I take the example from the doc 1.4 for "pretty-print" job key in my config.json.
"jobs" : {
"pretty-print" : {
"general" : { ..... },
"comments" : { ...... },
"blocks" : { ....... }
},
python Generate.py produce this:
Warning: ! Unknown job config key "blocks" - ignored.
Warning: ! Unknown job config key "comments" - ignored. Warning: ! Unknown job config key "general" - ignored.
I looked everywere, doc & source and not understand why
EDITED I am using QooXdoo 1.4 whit Python 2.6
I am working wh开发者_如何学编程it source javascript generated from another system I need to reformat the source .js and need to modify the standard setting QooXdoo use
From http://manual.qooxdoo.org/1.4.x/pages/tool/generator_config_ref.html i take the example:
"pretty-print" :
{
"general" :
{
"indent-string" : " "
},
"comments" :
{
"trailing" :
{
"keep-column" : false,
"comment-cols" : [50, 70, 90],
"padding" : " "
}
},
"blocks" :
{
"align-with-curlies" : false,
"open-curly" :
{
"newline-before" : "N",
"indent-before" : false
}
}
}
and put into the config.json of my app
the job "pretty-print" is executed but ignoring the settingRE-EDITED i have problem only whit this key "pretty-print", other variation on config.json is ok
You got it nearly right, you just missed one level of nesting.
The overall structure of the jobs
map is as follows (which is also documented here):
"jobs" : {
"job-name" : {
"pretty-print" : { ... }
...
}
...
}
So you just need to insert a job name between "jobs" and "pretty-print"; a job name is just a freely selectable string. (You can think of the "jobs" map as being a container, the [job-name]'s as individual objects in this container, and "pretty-print", and all the other keys you saw documented on the generator_config_ref.html, as properties of the specific individual).
Now, you can define a job object from scratch, e.g. by giving it a unique name such as my-pretty-print
. But this requires you to put together all the necessary job properties, for the job to run successfully (This is hinted at with the peer-keys note given with many key descriptions).
I rather recommend using a pre-defined job, and refining it. In your case, use the default job pretty
, and refine that. By naming the job in your own config pretty
you automatically inherit all the properties from the pre-defined job. So just adding
"jobs" : {
"pretty" : {}
}
to your config map will create a custom job pretty
that does the exact same thing as the default job of the same name (as you have nothing changed). Now you are in the position to just provide the things you want differently from the default job, e.g.
"jobs" : {
"pretty" : { "general" : { "indent-string" : " " }}
}
will use all the default settings except the indent string will have 4 spaces instead of 2. This should get you going.
精彩评论