If you’re working with Buildout, then check out mr.scripty, a fantastic Buildout recipe that allows you to use Python code in functions within its options. This means that – in the few instances I’ve used it so far – have conditional statements regarding effectively anything.
In the two examples I added to the source documentation, I go and configure download links based upon architecture and separately, configure some (Java) environment variables based upon which directories exist (eg to handle different Linux distributions that might be running). This is only the start, but it’s a fantastic one.
Amazing I hadn’t gone looking for this earlier. Anyone know of any other Buildout awesomeness out there?
Had this issue when you’ve been trying to run something like Funnelweb, and you hit an ImportError for BeautifulSoup? You’re definitely not alone, because I just hit the same issue. The answer is simple — just ensure that you don’t use BeautifulSoup 4 or above (this is still beta) — it uses a different namespace, specifically bs4. Thus, whilst you might have the BeautifulSoup egg satisfying your dependencies, any imports of this package are going to fail.
For me, I’m using buildout, so I just pinned my version of BeautifulSoup thusly:
[buildout] ... versions = versions [versions] BeautifulSoup = 3.2.0
Now, we stop using BeautifulSoup 4.0 and everything works again.
After upgrading from Ubuntu 10.10 (Maverick Meerkat) to Ubuntu 11.04 (Natty Narwhal), you’ll probably find that if you’re running a Plone 4 buildout where you need to upgrade the Plone version, that compilation of Zope will fail. The output will look something like this:
Getting distribution for 'Zope2==2.12.17'. In file included from src/AccessControl/cAccessControl.c:51:0: include/ExtensionClass/ExtensionClass.h:83:20: fatal error: Python.h: No such file or directory compilation terminated. error: Setup script exited with error: command 'gcc' failed with exit status 1 An error occured when trying to install Zope2 2.12.17. Look above this message for any errors that were output by easy_install.
The reason for this is that the default Python version in Ubuntu 11.04 is now Python 2.7, rather than 2.6 as was previously the case. The message here is telling us our Python development libraries/headers aren’t available, so do this:
sudo apt-get install python2.6-dev
and re-run your buildout. Make sure too that if you’re using Plone 4 that you’re using Python 2.6, as newer versions like 2.7 aren’t supported (yet).
This is pretty trivial (and trivial to fix), but I’m chronicling it for my knowledge as much as anyone else’s. The issue is that a given Python egg is missing some form of files, most commonly the ‘docs’ directory in my experience, because the build wasn’t configured correctly.
Continue reading »
Okay. So, anyone out here who’s listening — particularly those overly-enthusiastic users — don’t try to recursively wget your Plone site (or other CMS, for that matter) whilst you’re logged in with an account that can make edits. It will lead to a very bad situation where your site administrator and technical team need to step in and fix your mistakes. For the uninitiated, a loose recursive wget (when logged in with some degree of Edit rights) will hit every link that’s on your pages, and I mean in the (X)HTML source. For a Plone site, this means hitting every “Edit” link, every “Revert to this version” link, and every other link that might be dangerous when clicked randomly. Oh, and if the account you’ve got has admin rights, well, it’s not getting any better and requires the Data.fs to be undone back to before it happened. Here’s how to do that easily.
Continue reading »
