[wingide-users] New project synchronization scripts

Wingware Support support at wingware.com
Thu May 26 17:20:51 EDT 2005


Russell E Owen wrote:
> It's a very nice idea, but I'm not sure how to implement it with any 
> sort of efficiency. For example the following sort of thing would 
> probably work, but I worry that it's too inefficient:
> 
> currFiles = self.proj.GetAllFiles()
> currDirSet = sets.Set()
> for fname in currFiles:
>   currDirSet.add(os.path.dirname(fname))

Getting all the dirnames is probably the most significant added time. 
The script needs to visit each directory in any case, so it's not really 
added time.

> Is there a nicer way to get hold of all root dirs in the project (i.e. 
> the minimal set of dirs that one could walk to find all project files)? 
> It'd be so nice if the project object itself could tell me that.

If you want to poke through the api wrapper, it would be:
   [l.fName for l in proj.fProject.GetDirsWithFiles()]

> One "interesting" issue is that WingIDE projects are so general that 
> they can include just a subset of files from various dirs. I'm not sure 
> this is a good thing since it makes file synchronization a real pain in 
> the butt -- any sort of half-way sensible synch script would really mess 
> up such a project by adding in a bunch of unwanted files.

I'd say that these synch scripts should only be used if all files (minus 
the exclusions) in all directories should be in the project. 
Ultimately, we may add the capability in Wing of adding a directory with 
a certain file set and update it automatically when it is opened and 
files are added / removed.

John


More information about the wingide-users mailing list