Setting the page of an Impress document from Python

The following is the minimal code to set the current page of an Impress document. This is actually considerably easier to do from Python than Java ...

PYTHON:
  1. import uno
  2.  
  3. # Get the uno component context from the PyUNO runtime
  4. localContext = uno.getComponentContext()
  5.  
  6. # Create the UnoUrlResolver
  7. resolver = localContext.ServiceManager.createInstanceWithContext(
  8.         "com.sun.star.bridge.UnoUrlResolver", localContext )
  9.  
  10. # Connect to the running office
  11. ctx = resolver.resolve(
  12.   "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
  13. smgr = ctx.ServiceManager
  14.  
  15. # Get the central desktop object
  16. desktop = smgr.createInstanceWithContext(
  17.     "com.sun.star.frame.Desktop",ctx)
  18.  
  19. # Pull the current document, we asssume this is an Impress doc
  20. doc = desktop.getCurrentComponent()
  21. frame = desktop.getCurrentFrame()
  22. ctrl = frame.getController()  # In impress this implements XDrawView
  23. pages = doc.getDrawPages()    # Page list of the current impress document
  24.  
  25. # Set to some page ...
  26. target = pages.getByIndex(8)
  27. ctrl.setCurrentPage(target)

JSF membership

To my moderate suprise I've been voted in as a Jabber Software Foundation member. I received a 75% yes vote, which isn't too bad. Apparently rantlets are acceptable application material. I'd better write that JEP then ...

Collaborative wiki chat

Havoc Pennington has just posted about '☠' (pronounced 'Yarr') on his blog. It's basically realtime chat in a blog context, with the conversations forming part of the document. One interesting feature is the ability for a chat message to contain an image for illustration of ideas. The manifesto is
here.

Thought for the day

While hacking on erlang and python the following occurs to me:

On being introduced to Lisp people always complain about all the parentheses. But the parentheses are always there; it's just that in other languages you're expected to mentally insert them yourself.

Back to work …

Had Monday off as I needed to do some shopping and have lunch with a friend who's off to work in Madrid. But it's back to work now, but first some google-juice ...

Dog-training in Sydney (Leichhardt); It's a volunteer organisation so is cheap. Ph: 02-9797-0508.

More Erlang/Lisp fusion work, this time based around Scheme: Termite.

Hacking lisp in real-time

I'm currently mirroring Rainer Joswig's live video tutorial on developing DSLs in lisp. DSLs are something of a hot topic at the moment and Martin Fowler weighed-in recently, and Rainer produced a lisp-specific example and accompanying video. It's an interesting example of how lisp development can differ from other languages through the use of interaction with the lisp runtime.

  1. Archives

  2. Categories

  3. Twitter

    • Just got pictures of the earthquake damage from my sister in Kaiapoi. Real "the ground opened up" stuff. 59 minutes ago
    • Ooo, the beta of Angry Birds is out on Android. 18 hours ago
    • Released a new version of my Android Internode widget; fixes the problem with Internode's new SSL cert. 23 hours ago
    • @wangjammer5: Cool, here's something to get you started: http://is.gd/eT33b :) 1 day ago
    • So, if iTune Ping is Apple's social network will the perpetual Apple tweet circle-jerk move there now? 1 day ago
  4. RSS Google Reader Shared Items