Skip to main content

Routines and CLI to facilitate injection/extraction of OpenOffice.org macros.

Project description

Routines and CLI to facilitate injection/extraction of OpenOffice.org macros.

Works by connecting to a live instance of OOo.

It does not appear to be possible to use such a system to access Python macros in an OpenOffice document. This module only deals with Basic macros.

Dependencies

You will need to have the py-uno bridge set up.

On Debian-ish systems like Ubuntu and Linux Mint, this can generally be installed via

$ sudo aptitude install python-uno

Installation

Installation can be done via PyPI, or by fetching and installing the source code from the github repo.

Environment

The uno Python module will normally be imported without problems on systems which have the python-uno module properly installed.

If the uno Python module cannot be imported, ooo-macro-exchange will try to add it to the path.

If the environment variable PY_UNO_PATH is defined, ooo-macro-exchange will add it to the python path.

This can also be accomplished by setting PYTHONPATH.

If PY_UNO_PATH is unset, ooo-macro-exchange will try the path /usr/lib/openoffice/basis3.2/program/.

Usage

Basic functions are

  • pull: output a module’s code or save it to a file

  • push: replace a module’s code with lines from a file or stdin

  • invoke: run a macro.

The oomax script provides command-line access to these actions. E.G.:

$ oomax pull 'Document 1' Standard.Module1
sub Main()
    ' Content of main macro
end sub

sub AnotherMacro()
    ' Content of some other macro
end sub

Options etc. can be discovered by running oomax -h.

pull, push, and invoke are also available as methods of the class oomax.Exchange.

Relationship to other modules

The structure of the code is pretty similar to that used by openoffice-python. There are vague plans to integrate this module’s functionality with it.

The code in this module was originally derived from this forum post.

License

ooo-macro-exchange is licensed under the FreeBSD License. See the file COPYING for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ooo-macro-exchange-0.2.1.tar.gz (8.8 kB view details)

Uploaded Source

File details

Details for the file ooo-macro-exchange-0.2.1.tar.gz.

File metadata

File hashes

Hashes for ooo-macro-exchange-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cdcee4d28363eb127d834506c04fd92450f8462c50702d2d8656b703ca2d1be6
MD5 3aa04984e312ae26c9f8c44e548e8ce4
BLAKE2b-256 9c35c4d405bde0ed2cffb39b4f5d4df20f020eef013be9d71541a9f4cb6c3033

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page