Component model (again)

1 view
Skip to first unread message

Lorenzo Vegetti

unread,
Aug 6, 2009, 4:31:30 AM8/6/09
to QxTransformer
How I made it work:
Snippet from Application.xml (in source/class/ds)
xmlns:dsWindows="ds.*"
className="ds.Application">
<dsWindows:mainWindowComponent/>
Snippet from MainWindow.xml (in source/class/ds)
className="ds.MainWindow"
extend="ds.MainWindowController"
tagName="mainWindowComponent">

How I would have liked it, but couldn't make it work
Snippet from Application.xml (in source/class/ds)
xmlns:dsWindows="ds.windows.*"
className="ds.Application">
<dsWindows:mainWindowComponent/>
Snippet from MainWindow.xml (in source/class/ds/windows)
className="ds.windows.MainWindow"
extend="ds.windows.MainWindowController"
tagName="mainWindowComponent">
The error i get is the following:
[ERROR] - settings.getConfigByTagName:403 - Unable to get configuraton
for tag dsWindows:mainWindowComponent. Please check dialect
configuration files and make sure that there is a mapping for such tag
there.

Siarhei Barysiuk

unread,
Aug 6, 2009, 5:42:33 AM8/6/09
to qxtran...@googlegroups.com
Hi Lorenzo,

Could you provide some info:
1) repo resivion of qxt
2) OS

I've just tested this and it seems to work. Could you please post root
tags for Application.xml and MainWindow.xml for the second variant?
Also please make sure that you use qxt:component for MainWindow.xml as root tag.

Cheers,
Serge

Lorenzo Vegetti

unread,
Aug 6, 2009, 7:28:53 AM8/6/09
to QxTransformer
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)
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!

Now, maybe the problem is simply in the different way the cmd.exe
(windows vista command line) parses the arguments, in particular maybe
the " char should be used instead of '?

Lorenzo

On Aug 6, 11:42 am, Siarhei Barysiuk <s.barys...@gmail.com> wrote:
> Hi Lorenzo,
>
> Could you provide some info:
> 1) repo resivion of qxt
> 2) OS
>
> I've just tested this and it seems to work. Could you please post root
> tags for Application.xml and MainWindow.xml for the second variant?
> Also please make sure that you use qxt:component for MainWindow.xml as root tag.
>
> Cheers,
> Serge
>

Siarhei Barysiuk

unread,
Aug 6, 2009, 11:19:10 AM8/6/09
to qxtran...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages