-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all,
I've looked around a bit and tried to more or less copy'n'paste together some python-script, which would enable a UNO connection to OOo by using the same techniques/interface, that the current OOo Basic macro uses. As it's fairly small, I took the freedom to attach it directly to this mail. It seems to work here, but I'm far away from a thorough understanding of what I'm actually doing, so I would like to ask for some feedback. ;-) I've also CCed bibus' upstream author Pierre - please comment on it, too, if you like. It's of course, not nice+polished and so. It's just a skeleton... But in case, it looks like the right way to do things, I could try to add the flesh to the bones (some GUI for user interaction, bibus-integration, maybe even error checking?!?). Of course, every kind of help for this is most welcome! Many thanks for your help+feedback so far! Best Regards, Jan - -- Jan Beyer happy Debian Maintainer ;-) mail [email protected] GPG key ID 0x0CA6B4AA jabber [email protected] web http://www.beathovn.de/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkoYU+EACgkQ8eMP5QymtKosDwCg4lbsZbDCG7U+5KcPnhNTDsm/ sNMAnRP1OgkLG9n9MgW1N8FwUtBjUb6s =cL4j -----END PGP SIGNATURE-----
import uno
from com.sun.star.beans import PropertyValue
ctx = uno.getComponentContext()
configProvider = ctx.ServiceManager.createInstance("com.sun.star.configuration.ConfigurationProvider")
prop = PropertyValue()
prop.Name = "nodepath"
prop.Value = "org.openoffice.Setup/Office"
nolazywrite = PropertyValue()
nolazywrite.Name = "lazywrite"
nolazywrite.Value = uno.Bool(0)
updateAccess = configProvider.createInstanceWithArguments ("com.sun.star.configuration.ConfigurationUpdateAccess",(prop,nolazywrite) )
if updateAccess.ooSetupConnectionURL != "":
print "Currently the UNO Connection URL looks like: ",updateAccess.ooSetupConnectionURL
else:
print "Currently no UNO Connection URL defined."
# Ask, whether to enable or disable UNO Connection?
# enableUNOconn =
# Ask for the pipe name?
pipename = "testpipename"
if enableUNOconn:
updateAccess.ooSetupConnectionURL = "pipe,name="+pipename+";urp;StarOffice.ServiceManager"
updateAccess.commitChanges()
print "Now I've set up a pipe like ",updateAccess.ooSetupConnectionURL
else:
updateAccess.ooSetupConnectionURL = ""
print "Now I've deactivated UNO connections to OOo."
openUNOconnection.py.sig
Description: Binary data

