Live Projects and why I don't use them.
by Troy Topnik

Troy Topnik, January 21, 2009

I have to get this off my chest: I think the default "Live Import" on
Komodo projects can be dangerously confusing. A number of friends have,
after trying Komodo, have asked me "WTF is up with Komodo's file
manager project thingy?" I generally tell them two things:

  1. The projects sidebar is not a file manager. You'll get extremely
    confused and frustrated if you try to use it as such.
  2. Disable the following option immediately: Preferences|Directory
    Import|Live Import. Use Live Folders instead (see below).

A Komodo project is an XML file with a .kpf extension. It can

A typical project of mine

  • "Project components": Things like templates,
    , and snippets.
    These elements are stored in the XML file
  • Folders:
    There are two types:

    • Virtual Folders (pink): Buckets for project
      components. These can start to look like a filesystem (see the
      Toolbox|Abbreviations samples), but they're just a
      representation of the internal structure of the .kpf (XML) file
      that contains them. You can organize these however you like; the
      filesystem is not affected.
    • Live Folders (yellow): Pointers to
      filesystem directories. These are displayed in a tree view and
      show you the contents of those directories. You can add and
      delete files and sub directories within these, but you
      can't move things around. Well, you can
      try to move things around, and it might even look like
      you're doing so, but you're just changing an internal pointer in
      the project - nothing moves on your filesystem.
  • Files: As with Live Folders, these are just pointers to a file
    on your filesystem. Moving them around in the project doesn't change
    their real location.

It can get confusing because Komodo displays the "virtual" components
(templates, macros, etc.) pretty much the same way as "live" components
(pointers to files and directories). Sure, the live and virtual folders
are colored differently, but that's not immediately obvious (Mea culpa:
I chose those icons). There's also one additional twist that can further
blur the distinction: Live Projects.

"Live Import" is enabled by default in Komodo. This means that when
you create a new project in Komodo, it's a Live Project - the top level
of the project tree is a Live Folder pointing to the directory the
project was created in.

I understand the logic of using Live Projects by default: your Komodo
project file will always live with your actual project files (kind of
like .svn directories). If you know that's what is happening,
and you don't intend to add any project components to it (macros,
templates, etc.), and you don't attempt to move any of the
files or directories around, this will probably work fine for you.

It doesn't work for me. Here's what I do instead:

  • Keep all my Komodo projects in one directory:

    I personally like to keep all of my .kpf files in the same directory.
    It makes it easier for me to find projects to open them, and it allows
    me to check them in to a source code control repository separate from
    the source files. For example, I might not want to save my .kpf file in a
    public repository (though this might be useful in some situations - I'll
    blog about that sometime).

    With Live Import enabled, newly created projects would have this .kpf
    storage directory as the top level. This can be changed in the project
    properties (Properties|Live Import), but I'd rather set the project up
    initially as an empty "static" project and add a live folder for the top
    level directory of the files I want to work on.

  • Use multiple live folders at the top level:

    Admittedly, for some people this makes a project more
    confusing. But, if I'm working in a source tree that has lots of folders
    I don't care about, adding the few live folders that I am
    interested in at the top level (regardless of where they are in the
    source tree) lets me access my files from in the project manager a lot
    more quickly.

  • Add macros, templates, commands, etc. to a "Tools"

    I don't like to put my project-specific macros and templates in a
    directory that is supposed to represent a filesystem directory. I'd
    rather create a "Tools" folder at the top level of the project to
    contain those things. That way I don't have "virtual" things mixed up
    with my "real" files. If you create a lot of these components, you could
    create separate folders for macros, templates, commands, etc.

Hopefully this helps folks get their heads around what's happening in
that mysterious left pane. Feel free to post or comment on how you're
using Komodo projects. There's probably a lot of ways to use Komodo
projects that I've never thought of.

Subscribe to ActiveState Blogs by Email

Share this post:

About the Author: RSS

As ActiveState's Technical Product Manager for Stackato, Troy Topnik is responsible for defining and prioritizing the product roadmap to build the best cloud platform for deploying applications. Since joining ActiveState in 2001, he has held roles in Technical Support, Training, and Technical Writing. He believes in documentation-driven development as a pragmatic path to a better user experience.