Re: [dabo-users] will this work for a Mac?
On Monday 10 August 2009 01:09:50 pm Henning Hraban Ramm wrote: > Am 2009-08-09 um 16:00 schrieb John: > > I created a pth file to point to the uno.py folder and it works for > > me. That > > will be my suggestion to the reader instead of helping them find the > > file. > > I suggest to pop up a dialog asking "Where is OpenOffice.app?" if you > can't find it in /Applications. > Perhaps look for NeoOffice.app also. > > > Greetlings from Lake Constance! > Hraban > --- > http://www.fiee.net > https://www.cacert.org (I'm an assurer) Thanks and that occurred to me too. But to be honest the article will wait until I have more time and I determine fixes with some other issues. Johnf ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/200908101320.18197.jfabi...@yolo.com
Re: [dabo-users] will this work for a Mac?
Am 2009-08-09 um 16:00 schrieb John: > I created a pth file to point to the uno.py folder and it works for > me. That > will be my suggestion to the reader instead of helping them find the > file. I suggest to pop up a dialog asking "Where is OpenOffice.app?" if you can't find it in /Applications. Perhaps look for NeoOffice.app also. Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/9a08a613-cebc-4f96-8d13-7173249dd...@fiee.net
Re: [dabo-users] will this work for a Mac?
On Saturday 08 August 2009 11:52:19 pm Paul McNett wrote: > Ed Leafe wrote: > > On Aug 8, 2009, at 10:07 PM, Paul McNett wrote: > >> Not necessarily all dependencies. A bundle could use the system python > >> instead of bundling a specific python, for example. > > > > True, but specific modules, such as uno.py, are usually bundled. > > Back onto the topic at hand, I think at least in years past OpenOffice > bundled a specific python that *had* to be used with the py-uno bridge. > Perhaps the system python can be used now but they still prefer you use > the Python that comes with OpenOffice, which would explain why they > don't install uno.py in the system python's site-packages. > > Not sure what to recommend as far as packaging uno.py, as it depends on > OpenOffice and I sure wouldn't want to bundle OpenOffice in an app I > distribute. > > So I see John's quandary. > > Paul I'm not to sure about the history. But I have been able to use both 2.4 and 2.5 python on openoffice 3. I created a pth file to point to the uno.py folder and it works for me. That will be my suggestion to the reader instead of helping them find the file. While I'm doing that I'll publish a screencast of Larry's front end to Paul's report writer. I like it and it's another example of a real world app. Thanks for the discussion. Johnf ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/200908090700.32658.jfabi...@yolo.com
Re: [dabo-users] will this work for a Mac?
Ed Leafe wrote: > On Aug 8, 2009, at 10:07 PM, Paul McNett wrote: > >> Not necessarily all dependencies. A bundle could use the system python >> instead of bundling a specific python, for example. > > > True, but specific modules, such as uno.py, are usually bundled. Back onto the topic at hand, I think at least in years past OpenOffice bundled a specific python that *had* to be used with the py-uno bridge. Perhaps the system python can be used now but they still prefer you use the Python that comes with OpenOffice, which would explain why they don't install uno.py in the system python's site-packages. Not sure what to recommend as far as packaging uno.py, as it depends on OpenOffice and I sure wouldn't want to bundle OpenOffice in an app I distribute. So I see John's quandary. Paul ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/4a7e7223.5050...@ulmcnett.com
Re: [dabo-users] will this work for a Mac?
On Aug 8, 2009, at 10:07 PM, Paul McNett wrote: > Not necessarily all dependencies. A bundle could use the system python > instead of bundling a specific python, for example. True, but specific modules, such as uno.py, are usually bundled. -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/9976d5df-a143-42d3-b375-57727a8c3...@leafe.com
Re: [dabo-users] will this work for a Mac?
Ed Leafe wrote: > Doesn't look like it. Mac apps are distributed in "bundles": a > directory that appears in the OS as a single, double-clickable file, > but which contains all dependencies. Not necessarily all dependencies. A bundle could use the system python instead of bundling a specific python, for example. Paul ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/4a7e3d6b.4000...@ulmcnett.com
Re: [dabo-users] will this work for a Mac?
On Aug 8, 2009, at 6:46 PM, John wrote: > So I'll tell the reader that they'll have to find the file and > somehow get it > to import? Can you import the file from a Dabo app? Probably not, as it isn't in my path. I would imagine that anyone who wants to use this will have to install it themselves. -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/acbeb9ba-8a81-4d11-a095-1981eee78...@leafe.com
Re: [dabo-users] will this work for a Mac?
On Saturday 08 August 2009 03:50:44 pm Ed Leafe wrote: > On Aug 8, 2009, at 5:35 PM, John wrote: > > Doesn't a user have to have access to /usr/bin? If that is true > > then reading > > anything under /usr is possible - right? > > It depends on the usr and the directory. The code could barf if it > hit a directory for which the user does not have read privs. I just > tried it on my machine: > > [...@homer ~]$ find /usr -iname uno.py > find: /usr/local/pgsql/data: Permission denied > find: /usr/share/wikid/help/de.lproj/wiki: Permission denied > find: /usr/share/wikid/help/en.lproj/wiki: Permission denied > find: /usr/share/wikid/help/fr.lproj/wiki: Permission denied > find: /usr/share/wikid/help/ja.lproj/wiki: Permission denied > > So it looks like it will hit some bumps. Oh, and there is no uno.py > there. But if I look in the application bundle: > > [...@homer ~]$ find /Applications/NeoOffice.app -iname uno.py > /Applications/NeoOffice.app/Contents/MacOS/uno.py > > > 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? > > Doesn't look like it. Mac apps are distributed in "bundles": a > directory that appears in the OS as a single, double-clickable file, > but which contains all dependencies. > > > -- Ed Leafe So I'll tell the reader that they'll have to find the file and somehow get it to import? Can you import the file from a Dabo app? Johnf ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/200908081646.08012.jfabi...@yolo.com
Re: [dabo-users] will this work for a Mac?
On Aug 8, 2009, at 5:35 PM, John wrote: > Doesn't a user have to have access to /usr/bin? If that is true > then reading > anything under /usr is possible - right? It depends on the usr and the directory. The code could barf if it hit a directory for which the user does not have read privs. I just tried it on my machine: [...@homer ~]$ find /usr -iname uno.py find: /usr/local/pgsql/data: Permission denied find: /usr/share/wikid/help/de.lproj/wiki: Permission denied find: /usr/share/wikid/help/en.lproj/wiki: Permission denied find: /usr/share/wikid/help/fr.lproj/wiki: Permission denied find: /usr/share/wikid/help/ja.lproj/wiki: Permission denied So it looks like it will hit some bumps. Oh, and there is no uno.py there. But if I look in the application bundle: [...@homer ~]$ find /Applications/NeoOffice.app -iname uno.py /Applications/NeoOffice.app/Contents/MacOS/uno.py > 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? Doesn't look like it. Mac apps are distributed in "bundles": a directory that appears in the OS as a single, double-clickable file, but which contains all dependencies. -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/9fea300a-3a27-4b89-8d06-1dbc24a95...@leafe.com
Re: [dabo-users] will this work for a Mac?
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 ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/200908081535.32443.jfabi...@yolo.com
Re: [dabo-users] will this work for a Mac?
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 ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/1ced3c76-ef73-4e51-a696-d096e8e31...@leafe.com
[dabo-users] will this work for a Mac?
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'. import os myflag = False for direct in os.walk('/usr'): for wds in direct[1]: pathlist = '/usr/' + wds for x in os.walk(pathlist): for fn in x[2]: if fn == 'uno.py': path_to_file = x[0]+'/'+fn myflag= True print path_to_file break if myflag: break if myflag: break Johnf ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/200908080949.46040.jfabi...@yolo.com