Hi Lorenzo,
Sorry for delays.
Thanks for your investigation! See my comments below.
On Aug 6, 2009, at 2:28 PM, Lorenzo Vegetti wrote:
>
> Can't tell you the revision, I just exported it from svn maybe 6 weeks
> ago... sorry I can't be more precise.
> The OS is Vista 64 bit, with Active Python 2.6
>
> A new test with the current trunk tells me it cannot find dialect.json
>
> Tried to debug the code a little (first time in both python and
> qxtransformer!) here's what i've found:
> 1-with the code checked-out from the trunk Processor constructor gets
> called with dialects_config_path just as specified in
> qxtransformer.json param -D, i.e. dialect.json
> 2-I assumed it tried to look for it in the cwd (at least in vista 64)
The working directory for qxt is bin of toolkit, not a project's dir.
It looks for a dialect.json starts from dir.
> 3-so I first changed qxtransformer.json -D param in '$
> {QXTRANSFORMER_PATH}/bin/${QXT_DIALECTS_CONFIG}' and line 66 in
> qxtransformer.py in
> return processor.Processor(getProjectPath(dialect_config_path))
> 4-it still was not working because dialect_config_path contained the '
> char. I removed them from qxtransformer.json and everything works
> (even the initial problem with the component in a subdirectory). But I
> saw a light! The ' character was the problem!
> 5-went back on my steps, undid the changes in qxtransformer.py and
> qxtransformer.json.
> 6-simply remove the ' char from the -D param: it works!
If you take a look at qxtransformer.json, you will see this line:
"${PYTHON} ${QXTRANSFORMER_PATH}/bin/${QXTRANSFORMER} --dir source/
class --out source/class -v '${QXT_VERBOSE}' -D '$
{QXT_DIALECTS_CONFIG}'"
This is a command which is wrapped in double quotes (as json format
requires). Single quotes are used to pass a parameters with whitespace
to process them as one param not two. In this particular situation
single quotes are redundant because you have both params without
spaces. But it could be a problem if you specify a full path to your
extended dialect.json which contains whitespace.
I will check it on Win XP box at my office to make sure that it
doesn't work with single quotes because it works fine on mac os and I
suppose on linux as well.
Cheers,
Serge
P.S. BTW dialect.json is a new way how you can extend dialect with
your own extensions. We have moved qcl related tags to separate folder
and any user who would like to use them can include a dialect
extension in this file. This is a really good way to have your own
custom tag set. More information is coming.