Re: [dabo-users] will this work for a Mac?

Author: John

Posted: 2009-08-08 at 18:35:32

On Saturday 08 August 2009 10:24:56 am Ed Leafe wrote:

> On Aug 8, 2009, at 11:49 AM, John wrote:

> > I'm writing an article for the wiki and was wondering if the below

> > code will

> > work on a Mac to find the file 'uno.py'.

>

> Possibly, but there are several things there that are problematic.

> First, assuming that the user has access rights to /usr is never

> smart. Second, Mac apps are typically self-contained; if uno.py is

> needed for the app, it will be contained in the Resources subdirectory

> inside the app itself, rather than installed in a system location.

> Third, you should use os.sep instead of hard-coding '/' as the path

> separator.

>

> Lastly, does this actually work in Linux? Doesn't os.walk

> automatically recurse? It seems that you have recursion inside of

> recursion.

>

>

> -- Ed Leafe

Doesn't a user have to have access to /usr/bin? If that is true then reading

anything under /usr is possible - right?

Works on Linux and windows (just change the starting location for windows).

But I'm always open to better code. os.sep is much better - thanks.

The problem with uno.py is it does not following standard python practice. On

linux (ubuntu and openSUSE) uno.py is in "/usr/lib/ooo3/basis3.1/program" and

there is no pth file created from the install of openoffice. Windows is

similar. So I was hoping I could find the file and add the path to

PythonPath.

I don't have a Mac but I was hoping to again to just find the file (assuming

the openoffice install did not register the file). And again add the

location to the path. But it sounds like that will not work?

I'm writing the article on how to use Dabo with openoffice. I'm also setting

up an openoffice server/client environment using two computers. It's geeky

cool to be able to create a doc (and print it) on a server anywhere on the

lan or wlan. Anyway I think it's cool.

Johnf

©2009 John