Author Archive

LUG Radio Live 2008 - Saturday

Posted by mattw on Jul 19 2008 | Software

So, after going all round the Wrekin on a Travel West Midlands bus trying to get into Wolves I have now ended up at LUG Radio Live.  I’ve just listened to a 60 minute talk on bzr from a Canonical employee and Bazaar developer Robert Collins.  After giving us an overview of Bazaar and the design goals (laudable principles such as user friendliness and hackability), he showed some demonstrations of some cool plugins.

I very much enjoyed the bzr search command which I could imagine using all the bloody time.  There’s also an IRC bot plugin, much nicer than using the CIA disc image I have been.  As the SVN binding are different in design to git (which put me off dVCS systems) I’ve decided to have a play next week and see how it works in practice.

I also have a SUSE cuddly toy.

no comments for now

Just a bunch of buildout changes

Posted by mattw on Jul 15 2008 | Software

You may have noticed that version 0.2 of Malthe Borch’s truly excellent JBOT came out last night.  We use this in some of our themes, and hence has found its way in as a dependency for a good deal of our recent projects.

I ran development buildout last night and suddenly saw a lot of zope 3 components being downloaded, which if you’ve done it before you know is a recipe for disaster.

It seems one of the new features in version 0.2 (aside from the long-anticipated browser layer support) is it now correctly defines its dependencies.  This is a Good Thing™ but it does mean that JBOT now requires you to use fake-zope-eggs in your buildout.

Your zope2install section now needs to look like this:

[zope2]
recipe = plone.recipe.zope2install
fake-zope-eggs=true
url = ${plone:zope2-url}

Not a big change, but it will cause Zope to advertise the packages it provides properly.  Incidentally, you also need to do this to try out plone.app.batch, a summer of code project that’s looking for comments for its demo.

no comments for now

Google Charts in Zope

Posted by mattw on Apr 29 2008 | Software

This afternoon was spent tidying and open sourcing packages that we’ve been meaning to release back to the community for a long, long time. Today’s lucky winner was teamrubber.googlechart (formerly ZGoogleChart) written by Richard Wilson. This also has the honour of being the first product released in our namespace.

teamrubber.googlechart is a Zope2ish wrapper for pygooglechart, it provides an object that can be added to the ZMI to configure some standard options such as colours to be used which then exposes a very basic API. The most useful (in our humble opinion) charts are there already, but we’re open to suggestions as to what should be supported next.

<img tal:attributes='src
  python:here.chart.getSimpleLineChart(data={
                "1":[1,2,3],
                “2″:[3,2,1]
                })’
/>

No automated tests yet, coming in 0.2.1. There are also a couple of known bugs with large data points, but we thought we’d open for comments/suggestions sooner rather than later.

 http://pypi.python.org/pypi/teamrubber.googlechart/0.1 

no comments for now

Saturday in Paris

Posted by mattw on Apr 26 2008 | Software

Today was my first day actually at the Plone 3 Paris sprint – last night I got here just in time to go to the pub.  This morning I was looking over MrTopf’s plone.app.localconf code which uses Five sitemanagers to store configuration of subsections of a site as local adapters with the intention of having local configlets to allow people to reconfigure parts of their site.

This fits in quite well with collective.sectionsubskin: my product that allows for variable interpolation into CSS via marker interfaces on folders.  It seems it should be possible to use PersistantDict based local utilities or just references to .props files to implement the same functionality with localconf. It would be great if CSSManager could be integrated with this, allowing users to go to a local CSS Manager to modify the appearace of folders or even individual content items.  Which would be nice.

Then, after a lovely pizza and glass of rosé with the sun beating down on us we went for a group photo in the park.  And got lost.  After that cerfuffle I moved onto working with PloneSoftwareCenter with Tarek, specifically allowing multiple related eggs to be grouped into the same PSCProject so eggs that are conceptually just supporting products for a larger project won’t crowd the listings.  This obviously had to work with the new PyPI support so new eggs that are added are put in the correct place.  I spent most of the afternoon working on making sure that two projects couldn’t claim responsibility over one egg.

What keeps catching my eye is the Misty theme that DaftDog et al are working on, whenever I walk past their laptops there’s something pretty on screen.  Buildbot support in buildouts was also mentioned, but I had zoned out a bit so don’t know exactly what was going on, but the concept of a buildbot recipe is pretty cool, I’ll look into that later.

There’s so much going on I’ll leave it to the other participants to blog about what they’re doing; it’s almost time for the pub.

no comments for now

Google Summer of Code

Posted by mattw on Mar 03 2008 | Software

I’m guessing most of you will be aware of the Google Summer of Code project. Plone has participated for the last two years and will be applying to participate again this year. I’ve taken up the job of bothering people until they help out, so consider yourself bothered!

Mentoring

Are you interested in mentoring a student? If you’re chosen as a mentor you’ll be assigned a student who has submitted a proposal to participate in SoC. It’ll be your job to get this student involved and up to speed as a Plone developer. You should expect to commit between 30 and 60 minutes a day, with up to an additional two hours a week for testing and commenting on the student’s code.

You’re acting as the face of the Plone Foundation, supporting somebody who may be about to start university, or may be a post-doctoral student. They’ll be passionate, willing to learn but not necessarily
experienced with Plone.

Above all, you’ll be ensuring the student stays motivated and on trac, giving praise and helping with problems and helping him integrate with the community by shouting successes to the whole planet (see what I did there? ;))

Join our OpenPlans project to get more information on volunteering.

Ideas

Students submit their own ideas for projects, but we need to provide a list of possibilities to get their brains churning. Do you have an itch with Plone that you want scratched? Submit it as a possible idea and you may pique a student’s interest. There’s no need for you to mentor a project you suggest if you don’t want to or feel you’re not able, but we really appreciate the ideas.

Students

We’re glad to hear you’re interested in working with Plone! Please stop by #plone-soc on freenode and join our open plans, we’d love to hear your feedback on our ideas so far, but more importantly, we want to meet you!

no comments for now

Plone’s default look

Posted by mattw on Feb 11 2008 | Software

Plone’s standard template is quite familiar to many of us now, but lets remind ourselves:

Plone default theme

There’s also NuPlone which was brought in with Plone 3, as used on quite a few sites (but nowhere near as many as the standard):

NuPlone

During the sprint at Naples some clever little monkeys were working on plonetheme.pizza which looks pretty damn snazzy. It’s not quite ready yet, but so far looks like this:

Pizza

As you can see, this seems mostly based on the default with a few influences from NuPlone, specifically the way tabs are rendered. Most strikingly it’s very blue to match our brand spanking new logo. This got me thinking, the colour scheme in the default theme matches Vidar Andersen’s original version of the logo from years ago. What if that original theme was updated with the new colours?

A couple of minutes with paster create and I came up with this. I can’t decide what I think about it, opinions?
Mixture

4 comments for now

A taste of GHOP

Posted by mattw on Jan 02 2008 | Software

Something slightly less rubbery is the GHOP competition I mentioned a few weeks back. I thought I’d update everyone and put up some screenshots of the themes that our GHOP participants have created to date. These are all plone 3 themes, and in the collective to play with right now.



7 comments for now

GHOP help needed (with pretty graph)

Posted by mattw on Dec 12 2007 | Software

If you haven’t heard of GHOP yet, check out optilude’s blog post on the subject.

… right, now everyone’s up to speed, here’s a pretty graph from the statistics that have been sent around everyone on the admin email list:

graph2.gif

You’ll notice we’re dead last in terms of students claiming tasks. I don’t accept that plone is inherently less interesting than these other projects, so we’ve just not got the right tasks.

Please, take the time to have a look at the list of available tasks and submit new ideas to the wiki. If you’ve got some more free time, email optilude and volunteer to help out by maintaining the task list and helping students.

This is a great opportunity to get young people involved in the community and have some niggling issues fixed, let’s not waste it.

no comments for now

Cookin’ with traverse_subpath

Posted by mattw on Oct 21 2007 | Software

I’ve heard a few people mention this, so I thought I’d post this recipe. We’re using a simpler version in Vice to prettify some URLs, but it was so easily generalised I knocked an example together.

The idea is that the traverse_subpath variable from Script (Python) was a nice recipe for getting information from URLs. You might have a URL http://127.0.0.1:8080/test/traverse_subpath/a/v/121/a/a/a/1213 and want the list ["a", "v" "121", "a", "a", "a", "1213"].

It turns out that as z3 views are based on their own traversal mechanism, it’s really easy to override to get something to emulate this behaviour.

So, set up your view as you usually would, but note the subtle differences from the boilerplate:

traversesubpath.py

from Products.Five.browser.pagetemplatefile
import ViewPageTemplateFile
from zope.publisher.browser import BrowserPage

class subpath(BrowserPage):

 def __init__(self, context, request):
     self.context = context  # Use Martin's aq_magic
     self.request = request
     self._path = []

 def publishTraverse(self, request, name):
     self._path.append(name)
     return self

 @property
 def traverse_subpath(self):
     return self._path

 __call__ = ViewPageTemplateFile(’traversesubpath.pt’)

traversesubpath.pt

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
    xmlns:tal="http://xml.zope.org/namespaces/tal"
    xmlns:metal="http://xml.zope.org/namespaces/metal"
    xmlns:i18n="http://xml.zope.org/namespaces/i18n"
    lang="en"
    i18n:domain="plone">

  <ul>
  <li
 tal:repeat="pathitem view/traverse_subpath"
 tal:content="pathitem" />
  </ul>

</html>

With the URL I gave above, I get the following page rendered:

  • a
  • v
  • 121
  • a
  • a
  • a
  • 1213

It’s that simple.

no comments for now

Miami, er, Bristol Vice

Posted by mattw on Sep 28 2007 | Software

We’ve been working on the new Vice syndication project, integrating it into our new Viral Content Manager system. Although the system is still pre-alpha it is very impressive! The basic structure of our content types is:

ContentItems are contained in a folderish portal tool, and contain a reference to 0..* ContentChannels which can be anywhere.

We now have working RSS and ATOM feeds for the ContentItems associated with a given ContentChannel, looking like this:

from zope.interface import implements
from zope.component import adapts, queryMultiAdapter, getMultiAdapter
from zope.interface import Interface
from Products.VCNArchetypes.interfaces import IChannel, IViral
from plone.syndication.outbound.interfaces import IFeed, IFeedItem
import logging

from plone.app.syndication.outbound.adapters.atct import ATFeedBase, ATFeedItemBase

class ContentFeed(ATFeedBase):
"""Adapter from IChannel to IFeed.
>>> from zope.interface.verify import verifyClass
>>> verifyClass(IFeed, ContentFeed)
True
"""

implements(IFeed)
adapts(IChannel, str)

def __iter__(self):
items = self.context.getContentItems()
while 1:
yield queryMultiAdapter((items.next(), self), IFeedItem)

class ViralFeedItem(ATFeedItemBase):
"""Adapter from IViral to IFeedItem.
Make sure that ViralFeedItem implements the IFeedItem
interface
>>> from zope.interface.verify import verifyClass
>>> verifyClass(IFeedItem, ViralFeedItem)
True
"""
implements(IFeedItem)
adapts(IViral, IFeed)

@property
def url(self):
return self.context.getViral_url()

@property
def body(self):
return self.context.getViral_description()

and called in with:

<configure>
xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml"
xmlns:five="http://namespaces.zope.org/five"></configure>

<class class="Products.VCNArchetypes.ContentChannel.ContentChannel">
<implements interface="plone.syndication.outbound.interfaces.IFeedable"></implements>
</class>

<!-- Adapt IChannel to IFeed -->
<adapter>
</adapter>    factory=".contentfeed.ContentFeed"
trusted="true" />
<class class=".contentfeed.ContentFeed">
<require>
permission="plone.syndication.ViewFeeds"
interface="plone.syndication.outbound.interfaces.IFeed" />
</require></class>

<!-- Adapt IViral to IFeedItem -->
<adapter>
</adapter>    factory=".contentfeed.ViralFeedItem"
trusted="true" />
<class class=".contentfeed.ViralFeedItem">
<require>
permission="plone.syndication.ViewFeeds"
interface="plone.syndication.outbound.interfaces.IFeedItem" />
</require></class>

One of the sprint tasks is creating an easy to follow, doctested, readme. Until that comes out hopefully this will help people use this brilliant addition to Plone!

Thanks derek_richardson, pbugni and everyone else who’s contributed!

no comments for now