Modifying the installed Komodo code

Posted by toddw on 2008-02-28 12:42
OS: All / Any | Product: Komodo
Question: 

For my Komodo installation, how do I change parts of the code?

Answer: 

This really depends upon what your looking at modifying. If your not sure, the best idea is to use the OpenKomodo svn and grok tools to first find the details of what you'd like to change:
http://svn.openkomodo.com/
http://grok.openkomodo.com/source/

Once you know what you'd like to change, you need to find where the corresponding file(s) reside inside your Komodo installation.

Python
Most of the Python code resides in one of two directories:

<komodo_install_dir>/lib/mozilla/components
<komodo_install_dir>/lib/mozilla/python/komodo

These files can be edited directly and the code changes will be automatically be included on the next restart of Komodo.

JavaScript, CSS and XUL
Most of the JavaScript, CSS and XUL code will be inside a ".jar" file (a type of zip file):

<komodo_install_dir>/lib/mozilla/chrome/komodo.jar
<komodo_install_dir>/lib/mozilla/chrome/xtk.jar

Which you can use an unzip tool to extract the sources from. Modification to these files can be done on the extracted files, but the modified files will need to be repackaged into the komodo.jar file to have any affect. Changes will be noticed on the next restart of Komodo.

Here is the example process to update one of the JavaScript files inside of the komodo.jar:

  • shutdown Komodo
  • unzip the "dialogs/alert.js" file from the komodo.jar
    unzip komodo.jar content/dialogs/alert.js
  • modify the JavaScript code as you like
  • repackage the modified file (use -u "update" zip flag)
    zip -u komodo.jar content/dialogs/alert.js
  • restart Komodo

Tools
For Windows, here are some links to free tools that provide zipping, patching and other utilities:
Zip/Unzip: http://www.info-zip.org/
Patching and other tools linux tools: http://sourceforge.net/projects/unxutils