[wingide-users] New project synchronization scripts

Russell E. Owen rowen at cesmail.net
Wed May 25 14:58:18 EDT 2005

Ken Kinder's projectupkeep script is really handy
and prompted me to write two adaptations.

My goal was to add:
- The ability to remove files from my project that had been 
   deleted from disk.
- The ability to scan the whole project with one click
   (and not worry about what folder or file was selected).
- Simpler configuration for what to files and folders to ignore.
- Speed.

Feel free to try these out. I recommend synchfiles
if your projects are laid out according to its requirements,
else use addremovefiles.

- synchfiles: add and remove files with one go.
Warning: this script requires a very particular layout
of files for your project:
1) Your project file (<whatever>.wpu) must be in the
   root directory of your project.
2) Your project must consist of all "valid" files and subdirs
    in that root directory.

- addremovefiles. more basic than synchfiles
  with minimal assumptions about project layout
  and separate "add" and "remove" commands.
  Adding works just like Ken Kinder's projectupkeep:
  it recursively scans for new files in the selected dir
  (or parent dir of the selected file).
  Removal always scans the entire project.

For now, you can find them here:
Please ignore the files whose names start with a ".".

I hope WingWare will add these to their "contributions" page.
If/when that happens I will probably stop serving them myself.

-- Russell

P.S. a few interesting points came to light:
- For projects that consist of all files in a directory
  (which I assume is most projects but not all)
  it would be nice to be able to ask WingIDE
  what that directory is. Then I could make
  synchfiles much more robust -- e.g.
  have it only available for the "right kind" of projects.

- A minor esthetic thing: I wish that the callable item
that is the script could be a class instance instead of
having to be a function. This leads to minor ugliness:

class MyScript:
  """the actual script"""

myScriptInstance = MyScript()

# the hack:
def my_script():
my_script.contexts = ...

More information about the wingide-users mailing list