Posts by 'davidjb' – Page 10

Buildout: Trying to create a Plone/Zope instance

Eeek…what’s this mean?

install() got an unexpected keyword argument 'allow_hosts'

after trying to build zope2zeoserver from my buildout configuration.

After some searching, I found that it was due to my bootstrap.py script (the one the gets buildout in the first place and creates the relevant scripts) was actually pulling down an outdated version of zc.buildout. So, the problem results because this old version of buildout doesn’t have a clue how to handle the given argument.

Solution: update the buildout. For me, that meant correcting the bootstrap script, but for you, it could be a matter …

Buildout: Trying to build Pound

So, trying to build pound through a Buildout recipe was failing part of the way through.

Two problems and their solutions (not necessarily in that order):

  • Needed to install libssl-dev because lcrypto was missing (ambiguity anyone?) - Synaptic says that the package provides “libssl and libcrypto development libraries, header files and manpages” (but never mind a search for `libcrypto`…)
  • Had to correct the relevant user that the recipe was telling pound to build as.

The first point was pretty silly and the second one was just clearly my copy-and-paste mistake.

Ubuntu: Dual Monitors & Separating Tasks

Today’s puzzle: how to get Ubuntu (specifically GNOME Panels as it turns out) to use my new dual-monitor setup and show only the tasks from one monitor on that monitor’s panel. Sure, people had mentioned that it was possible (everywhere) but noone actually seemed to take the time to mention how. That’s when I found this: http://www.lloydleung.com/2006/10/14/gnome-multiple-monitor-taskbar-window-listing/ so cheers go to Lloyd there. Still works (and should be fine on any version from at least now on):

  1. Right click on anywhere on the launchbar, click “New Panel”
  2. Drag that to …

Plone: URL Encoding In A Script

So, for today’s problem, how can we get a URL (specifically the GET request arguments) suitably encoded? Easy, if we’re talking about a Python script that lives on the file system and can be used within Zope/Plone that way. But what about some sort of Python script that has to exist on the Plone site (specifically, creating a PloneFormGen (PFG) Custom Adapter)?

First thing I jumped to is urllib and urlecode: but no luck because you’re unauthorised to import the library in your script. Boo!

After much poking, and Googling for something that I thought should …

Linux: Graphics Card Woes & BIOS Issues

…and I had thought that installing a graphics card in a computer was as easy as opening the case, inserting the card, and booting the machine (then Xorg config etc). Well, to tell the truth, I just moved my HDD, peripherals (gfx card included) to a new box - now a Dell OptiPlex 755. But, it’s not that easy if you can’t boot your Ubuntu 8.10 OS!

The computer kept spitting this message out, even though it just worked a few days ago:

15.848000 NVRM: This PCI I/O region assigned to your NVIDIA device is invalid …

Plone: Correcting Page Template Errors Easily

Here’s how to correct pesky problems in your code/XHTML since the line number and column references are slightly useless in the ZMI.

Paste contents from a page or page template from the ZMI into a program like gedit and then the line and column reference numbers will be correct (once you remove the comment about the error from the top of the page).

Editing in the ZMI is a bit painful, but we persevere.

Plone: Varnish Configuration (Cache Hits, Purge Fails)

What a painful, painful day. It’s taken about the entire day, but I’ve finally figured out why our Varnish configuration around here for Plone/Zope hasn’t been accepting PURGE requests. Thus, without accepting purge requests correctly, any content that gets changed in Plone doesn’t get updated in the cache until it times out (or we restart it). Ouch - especially because it affects all sites under virtual hosting, and a lot of these sites have publicly visible content that needs to be available immediately.

So, the problem manifested itself as thus:

  • Cache hits happen
  • Performance was good …

Plone: Re-ordering Folder Contents

Ahhh, a new work week.

The first perplexing puzzle for the week was a seemingly silly idea (it still is) in Plone where it allows you to view the contents of a given folder in batches of 20. Now, combine this concept (which is good) with a concept of being able to re-order items within the folder (which is good too), you end up with not being able to move items between ‘batches’.

Troublesome. There’s nothing obvious that you can do aside from disabling your browser’s JavaScript and using the manual buttons. Nope: not feasible.

Try making your …

Plone How-To: XHTML Compliant Flash Insertion

Wow, it seems easy doesn’t it. Just add an object tag, params, and embed and we’re done, right? Well, sure, if we didn’t want to adhere to W3C standards.

To do the right thing, we need something like this:

<object type="application/x-shockwave-flash" data="movie.swf" width="100" height="100">
    <param name="movie" value="movie.swf" />
    <img src="alt.jpg" width="100" height="100" alt="" />
</object>

Not much to it there, and this is available everywhere on the web. It validates okay, and that’s what we need.

However, if you follow normal procedure for sticking this …

Plone: PloneFormGen Customisations

Another fun problem for me to address today: upgrading to the latest version of Plone (3.1.7 at time of writing) caused my custom PloneFormGen (otherwise known as PFG) view to break in a nasty way:

Module None, line 13, in fgvalidate_base
- <fscontrollervalidator at /site/fgvalidate_base used for /site/registration-form>
- Line 13
Module Products.PloneFormGen.content.form, line 519, in fgvalidate
Module plone.protect.authenticator, line 60, in check
Forbidden: Form authenticator is invalid.

Obviously there’s some new validation code for forms in Plone 3.1+. Thanks to a very simple (and useful!) blog entry: http://www.die-welt …