Wednesday 30 November 2011

Something for next time

Remember, if you change something in a buildout script - rerun buildout if you want the change to have efffect.

Tuesday 30 August 2011

Vim Stuff

Add/Delete indent

When in insert mode,
  • CTRL-T increase indent by one shiftwidth
  • CTRL-D decreases indent by one shiftwidth

Word completion

keystrokesaction
^x^nword completion
^x^lline completion
^x^ffilename completion

Exuberent Ctags

keystrokesaction
Turn on taglist
:TlistAddFilesRecursive *.Add files recursively e.g. :TlistAddFilesRecursive ~/code/instance/parts/omlette/ *.py

Package configuration

When creating a new package and you need to add a new dependency
  1. edit profiles/default/metadata.xml to add in a new dependency and increase version number
  2. edit configure.zcml to add the upgrade step for the new version
  3. edit setup.py in the top level of the package directory structure and add in the new package to theinstall_requires list.
  4. rerun buildout so that new dependency can be pulled down
  5. rerun instance and go to the Add-on Products section of Site Setup and run the upgrade

Plone debugging

To get an interactive debugger in your plone code:
  • add import ipdb; ipdb.set_trace() into the code
  • the set_trace function sets a breakpoint at the point in the code.

To reload the code you are debugging after you have made changes with out having to restart the service, to gohost:port/@@reload
this doesn't always work. If you get a complaint mentioning something to do with calling super then you will probably just have to live with restarting the service instead.

Friday 29 July 2011

Documentation

I hate documentation - writing it that is. I really appreciate being on the receiving end of documentation (well, good documentation anyway) but I loathe writing it. My typical level of productivity is about a paragraph a day and, since I have 2 working days left to write both a final report and user documentation for a web site that doesn't seem like it will work.

Only thing worse that writing documentation is reviewing/assessing bad documentation - my eyes just slide off the page mid-way through sentences and my brain start throwing anything it can into the conscious thought-space to distract from the task at hand.

P.S. Think I need to change blog title from Ponderings to Grumblings.

Friday 18 March 2011

Argh!

Do you know what I hate? I hate it when the boss says "it'll be easy, just use this code as the basis of the project - we want the same thing just a bit different." Then you find the code and you find out there is no documentation, no comments and it doesn't just install and run. So then you are stuck trying to work out what the hell the code does and why it doesn't work. And its written in a language you are unfamiliar with.

It sucks.