ActiveState Community

Scratch projects in Komodo

Posted by weitzman on 2009-10-05 05:47
OS: OS X

I would love to be able to pass a folder when opening Komodo. Currently, you may only pass a filename. Komodo would open a new "scratch project" with just that folder in it. "Scratch project" is just what Textmate calls these. I think they are just unsaved Project files. Combined with Quicksilver, this is a very handy feature and obviates the need to create persistent Projects in many cases.

Kop
jeffg | Mon, 2009-10-05 10:40

My workaround for this is this script:

http://community.activestate.com/forum/kop-create-komodo-projects-comman...

All it does is create a project in the current folder in the terminal, but it acts very much like running 'mate' in the terminal using TM.

weitzman | Mon, 2009-10-05 13:43

Very helpful. May I make a few requests:

  1. can't be run twice on same directory. if you do, you get '"Error: project file already exists: %s" % fileName'. Perhaps use an existing .kpf if it exists. Or create filenames with timestamos in them.
  2. komodo 5.2 seems to be crashing after i use this. i'l try to isolate the steps to reproduce.
  3. this is going to litter .kpf files everywhere. could we create them in the OS temp dir?
  4. the command prompt stops and waits until you close komodo. mate does not do that.
  5. if i do `kop jmeter`, i get a nice jmeter.kpf file but the project name becomes jmeter.kpf.kpf. there is a duplicate extension at the end. the 'name' should just be 'jmeter' IMO. the duplication visible in the xml and in the komodo project drawer. just a cosmetic glitch.

Edit - some more

  1. Make it work for a file too. Less taxing on the brain to use 1 command for both.
  2. If there is a trailing slash, discard it. The slash is often added by tab completion.

jeffg | Mon, 2009-10-05 14:04

Heheh. A couple of points:

- I had thought of using the tmp directory, or a central project directory as some others do, but my pattern for dev has always been one of having a single project file in a directory. You could probably adjust the python code to suit your needs though, it is a fairly simple script.

- You should, *in all cases* have Komodo running *before* you use kop. Otherwise, Komodo is launched and may do strange things ( and the prompt does not return in the shell, which is also awkward. )

- I think point 5 is a Komodo bug, but perhaps not a known one.

--
JeffG
http://www.openkomodo.com/blogs/jeffg