README.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. About
  2. -----
  3. This version of PyXPCOM is designed to work with Firefox/XULRunner 35.0.
  4. You will find compatible PyXPCOM code for older versions of Mozilla at:
  5. http://hg.mozilla.org/pyxpcom/tags
  6. PyXPCOM allows for communication between Python and XPCOM, such that a Python
  7. application can access XPCOM objects, and XPCOM can access any Python class
  8. that implements an XPCOM interface. With PyXPCOM, a developer can talk to
  9. XPCOM or embed Gecko from a Python application.
  10. Requirements
  11. ------------
  12. * requires Python 2.x (most tested with Python 2.7)
  13. * requires Mozilla XULRunner SDK (version 35.0)
  14. * autoconf 2.13
  15. Build Steps
  16. -----------
  17. $ autoconf2.13
  18. $ mkdir obj
  19. $ cd obj
  20. $ ../configure --with-libxul-sdk=/path/to/xulrunner-sdk
  21. $ make
  22. Installation
  23. ------------
  24. When successfully built, there will be a "obj/dist/bin" directory that contains
  25. the necessary files.
  26. * libpyxpcom.so - the core PyXPCOM library
  27. * components/pyxpcom.manifest - to tell Firefox/XULRunner to load PyXPCOM
  28. * components/libpyloader.dll - loader library for setting up PyXPCOM
  29. * python - the pure Python files, this directory must be on the PYTHONPATH
  30. You'll need to ensure that the pyxpcom.manifest is registered/loaded by
  31. XULRunner/Firefox by adding this file to the manifest list.
  32. Testing
  33. -------
  34. You can run/test PyXPCOM from the command line using these methods:
  35. $ cd obj/dist/bin
  36. $ export MOZILLA_FIVE_HOME=/path-to-firefox/dist/bin # Adjust this to your Firefox/XULrunner path
  37. $ export LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME:`pwd`/ # Note the `pwd` for the obj/dist/bin dir
  38. $ export PYTHONPATH=`pwd`/python
  39. $ python
  40. >>> from xpcom import components
  41. >>> print components.classes["@mozilla.org/file/local;1"]