Posts Tagged ‘qooxdoo’

Compile Qooxdoo for eyeOS (I)

dimecres, juliol 6th, 2011

Sometimes an eyeOS developer may need to use a Qooxdoo contrib, or to update Qooxdoo, or to fix anything. For instance, contribs extend the library and let the hacker have more backend features, widgets, themes, etc. There is a manual that helps Qooxdoo applications developers, but in eyeOS things might turn a bit tricky.

The first part of this article explains the standard method. The second part, the patches that sometimes are required.

To include a contrib, you have to ‘compile’ Qooxdoo. That is, Qooxdoo needs to resolve dependencies and to be compressed.

Requirements

When is this article useful?

  • Contribs — you want to use a Qooxdoo contrib
  • Core modifications — If you modified qx.* or aristo.Aristo or a dependency declared in the config file.
  • Debugging — If your face turned green fixing a bug.
  • Deployment — generate files to deploy eyeOS.

Getting the big picture

Edit eyeOS config file. This file differs a bit from Qooxdoo’s in order to include the Aristo theme and to adapt paths to libraries. Run the generate.py script.
generate.py build

Where ‘build’ is a job defined in config.json. In eyeOS you can use ‘debug’ as well, but it won”t work most times.

config.json

This file defines what to include, what to exclude, where to find the libraries… In eyeOS two jobs are declared: ‘build’ and ‘debug’. In the ‘build’ job you’ll find a line to declare your libraries. If you need to use a contrib, add it there.
"include": ["qx.*", "aristo.Aristo", "svg.*"]

Right beneath this line you’ll have to tell Qooxdoo where to find the code you’re including:
{
"manifest" : "/home/edu/svg/Manifest.json"
}

All contribs contain a Manifest.json. Just extract all the files of the contrib anywhere (e.g  /home/edu/mycontrib). They’ll be copied and compressed to the source/ folder of your Qooxdoo application.

Adapt all other paths. You may need to download the Aristo theme and edit the path in this file so the “compiler” finds it, like you did for the contrib and the “manifest” field 30 seconds before.

Troubleshooting

If you’re using a Qooxdoo version older than 1.4.1 and GNU/Linux, you might see ‘global name ‘WindowsError’ is not defined’. There’s a very quick fix available explained in bug 5273.

Fixing a WindowsError in Qooxdoo’s generate.py

divendres, juny 24th, 2011

eyeOS 2.5 uses Qooxdoo  1.3. For my project I needed to include the SVG contrib by Marc Puts, so I checked if there was an easy way to do this in eyeOS.

A step in this process is calling generate.py, which is quite simple but wouldn’t finish on my laptop. Well, it happened to be a bug with a very quick patch. I sent a bug report and it has been fixed for trunk and branch 1.4.x.

Under certain circumstances generate.py can't finish its job.

I tried to build an app with
generate.py build
where build is a job defined in our (eyeOS) custom config.json

It failed with the message "global name 'WindowsError' is not defined".
The program was attempting to copy some files and the destination folder's
owner was somebody with higher privileges.

The affected file is qooxdoo-sdk/tool/pylib/misc/copytool.py
line 82:
   except WindowsError:
     try:
       os.chmod(targetPath, stat.S_IWUSR)

WindowsError is a subclass of OSError, as stated in
http://docs.python.org/library/exceptions.html#exceptions.WindowsError
"it's raised when a Windows-specific error occurs or when the error number does
not correspond to an errno value"

I suggest changing WindowsError for OSError.

I'm running Fedora 14 (2.6.35.13-92.fc14.i686)
Python 2.7 (r27:82500, Sep 16 2010, 18:03:06) 

Steps to reproduce
1. get a working qooxdoo app
2. set its owner to somebody but yourself (e.g. chown apache:apache -R myApp/ )
3. run generate.py

Entra