Text Editors

Any text editor that can edit python and Fortran code can be used to edit the Continuity source. If you already have a favorite (such as vi/emacs) you should be able to use that editor without a problem. However, we have a few favorites that you might want to check out and we can provide some useful settings.

  • SciTE SciTE is a lightweight source code editor that is easy to use and very customizable. It’s available for Windows and Linux. It can be installed with darwin ports for the Mac, but this can be a little tricky. See instructions below for details.

  • Notepad++ Similar to SciTE. Only available on Windows.

  • Sublime Text 3 Available on all platforms. Medium weight application, with lots of plug-ins available, including SVN/GIT integration.

  • Komodo Edit Also based on scintilla (like Notepad++ and SciTE) but a bit heavier-weight. It’s available on Windows, Linux, and Mac.

    • Turning on whitespace / line numbers
      • Edit > Preferences > Editor > “Show whitespace characters” and “Show line numbers”

    • Changing whitespace color to grey and disabling “line caret”
      • (From toolbox panel click the “tree” icon) > New Macro

             komodo.editor.setWhitespaceFore(1, 0xE8E8E8);
             komodo.editor.caretLineVisible = 0;

      • Triggers > Macro should trigger on Komodo event > After file open

    • Running python files
      • (From toolbox panel click the “tree” icon) > New Command

      • “Run Python File”
      • %(python) -u “%F”
      • Start in: %D
      • Key Bindings (set to F5)
    • Checking python syntax
      • %(python) -c “import py_compile; py_compile.compile(r’%F’)”
    • Discovering scintilla based settings (from a javascript file):
      • Components.interfaces.ISciMoz.
    • Enable “line duplication”
      • Edit > Preferences > Editor > Key Bindings > Editor::Duplicate Line > Ctrl-D

  • Eclipse is another option, should you want something more than a text editor. It can include SVN functionality as well as class/method browsing and other features. It is a bit a of heavy-weight application, but some might find all the features worthwhile.

Installing SciTE for the Mac

  • Download and install gtk

  • Download and unzip SciTE

  • Right click on SciTE and select “Show Package Contents”
  • Copy the Contents/Resources directory somewhere else such as SciTE_resources in your home directory
  • In your home directory, create a directory called .MacOSX and a text file called environment.plist
  • Populate environment.plist with something like this, except for it should contain the full path to your new SciTE_resources directory

    • <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <plist version="1.0">
      <dict>
              <key>SciTE_HOME</key>
              <string>/Users/<your_user_name>/SciTE_resources/</string>
      </dict>
      </plist>
      

  • In your SciTE_resources directory, replace the SciTEGlobal.properties with this

  • Move SciTE from the SciTE177_osx folder to Applications or wherever you want to keep it permanently
  • Run SciTE from this directory, right click the SciTE icon in the toolbar, and select”Keep in Dock”

Installing SciTE for the Mac

  • This is the inferior version of SciTE; use the directions above if at all possible
  • This steps assume you are using Leopard
  • Install XCode from the Leopard Installation DVD
  • Download and install darwinports

  • Update darwin ports
    • sudo /opt/local/bin/port -d selfupdate
  • create this path by using “sudo mkdir” until it exists:
    • /opt/local/bin/dports/scite
  • cd /opt/local/bin/dports/scite
  • sudo /opt/local/bin/port install scite
  • Use these properties

  • Setup a shortcut for the taskbar
    • Run “Script Editor”
    • do shell script “/opt/local/var/macports/software/scite/1.77_0/opt/local/bin/scite”
    • Save as application
    • Change icon; place in dock

Installing Eclipse

  • Download and install the basic Eclipse package: Eclipse for Java Developers

  • Install the Python plugin (PyDev). From Eclipse->Help->Install New Software, use this link: http://pydev.org/updates If you want SVN integrated within Eclipse, you’ll need to install 1) SVN and 2) the Eclipse SVN plugin

  • Install SVN from http://www.open.collab.net/downloads/community/

  • Install the SVN plugin (Subclipse). From Eclipse->Help->Install New Software, use this link: http://subclipse.tigris.org/update_1.6.x

  • You should already have all of Continuity checked out onto your computer before setting up a new project in Eclipse

  • When creating a new pydev project in Eclipse, you’ll need to specify the Python interpreter. For Mac, use this one: pcty/MglToolsLib/bin/python

  • Also, when creating the new project, just point the Eclipse workspace location to your home directory, and then when you create the new project containing the Continuity code, you can just make that directory the same as the project name. This assuming your workspace has been defined to be the base path of where you installed Continuity
  • When creating a new PyDev project, be sure to select the option: “Add project directory to the PYTHONPATH”

  • You’ll also need to specify a few environmental variables at: Eclipse->Preferences->Pydev->Interpreter – Python->Environment:

    • DYLD_LIBRARY_PATH <CONT_ROOT>/pcty/MglToolsLib/lib

    • PYTHONHOME <CONT_ROOT>/pcty/MglToolsLib

    • TCL_LIBRARY <CONT_ROOT>/pcty/MglToolsLib/tcl8.4

    • TK_LIBRARY <CONT_ROOT>/pcty/MglToolsLib/tk8.4

  • Lastly, you’ll need to add one more environment variable to the project.
    • Right click on the root folder of the project in the PyDev Package Explorer window and select Properties

    • Select PyDev – PYTHONPATH

    • Under the Source Folders tab, select ‘Add source folder’ and then add the pcty/MgltOolsLib/MGLToolsPckgs