Q & A
Trouble shooting CSS
Q: There is a strange difference in point size behaviour in CSS definitions between the .py and old .xsl files.
A: Although the specs tell different, it is not enough to define pointsize just for the body tag. Instead make sure the definition for the general table, th, td is in the CSS code. The CSS pointsize and leading attributes must have a trailing px. Best using the function (example: px(12)) from
from xpyth.xierpa.tools.transformer import px
Q: How can I make stylesheets for different media (i.e. print, tv, etc.)?
A: Add a 'media' tag at the bottom of your css.py file
self.text('\n@media print{')
self.css(ids='#toolbar', display='none')
self.text('}')
Trouble shooting access to sources
Q: When I am working on a remote desktop: why do folders disappear now and then?
A: The Finder information about folders gets corrupted, probably if more users are working in the same folder at the same time. Excecute the following command in the terminal for every machine that has access to the sources desktop folder:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Trouble shooting Python includes
Q: Why do I get an error message exceptions.ImportError: No module named xxx when doing an import xxx in application, while sure there is a local valid _py/xxx.py?
A: Check if there is an _xsl/_base file (else the Xierpa gethandler cannot find the local Python _py module directory). Or check if there is an _py/__init__.py file (else the _py will not be recognized as a Python module directory).
Q: How do I avoid clashes of included modules between sites?
A: For Python two dynamic included modules from defines import * look the same, so they get mixed up when asked to import a module with the same name in another site. To solve this create a file ./_py/_packagename containing the name of the site (e.g. “mysite”). Then modules inside the ./_py folder can be imported as from mysite.defines import *.
Trouble shooting authorization
Q: Why do I get a password form, while I am authorized to see the page? When I click “cancel” it shows all right.
A: Probably there is a reference to the “favicon.ico” file that is outside the bounds of the user’s authorization (e.g. when there is only view permission on a lower level and the default icon file is on the root). Solution is to create a “favicon.ico” file at the ./ level of the site. Then use e.g. self.favicon('./favicon.ico')") in the head of the page to refer to that icon file.
Trouble shooting browser compatibiity
Q: Why does Javascript code run in Safari and FireFox and not in IE?
A: Safari and Firefax do allow a trailing commma in an array or dictionary definition an in {1,2,3,4,} where this does not work in IE6 and IE7. There the definition should be {1,2,3,4}.
Q: Why does my “wysiwyg” textarea disappears?
A: The happens if there is not form tag specified around the textarea tag.
Trouble shooting the generated XHTML source
Q: The HTML output is mostly without additional returns an other whitespace. How to get closer to an error indicated by the browser debug function (as in Safari), generating one separate XHTML tag per line?
A: You can overwrite the behaviour of the closing tag by adding the following method to your application builder class:
def _closetag(self, tag):
self.result.write('</%s>\n' % tag)
self._poptag(tag)
