[help] Driving Visual Studio From Python

Michael Schneider Michael.L.Schneider at eds.com
Tue Nov 27 13:29:10 EST 2001


I have received several requests for more information on what I am trying to do.  Here is some info that may
help


problem:  We have a very large CAD/CAM software product ( > 10 Mil lines of code)
effect:     It is not effective to build a big workspace that contains projects with all of the source
              necessary to build the entire product


Given:  All source is managed in clearcase, so you can freeze the code on a base line
Given:  Full Builds of the product are avail for different baselines
Given:  database that maps include files to all source files that include them

Visual Studio Limitation: A Visual Studio project seems to be able to effectively manage ~2500 files,
                                       This requires us to break up our file set over several projects

Proposed working model (working sets of files) :
                       Developer has a working set of files that add functionality to the product, or
                      fix a defect.  This working set of files can contain:   UI files, source files, header
files




Desired behavior of Python Addin

  1) ask clearcase for  list of working files (can be done by exec'ing cleartool common)
  2) Ask user for baseline environment
  3) copy all libraries from nightly build to local workspace area
  4) create a Visual Studio Workspace
  5) create a Visual Studio Project that contains all of the working set files

   Note:  We now have a workspace, a project with the working set of files.  We do not yet have projects to
let
              Visual studio compile the source files that are impacted by the header files in the working
set.
   Example.   Point.h contains a class with two data members  x, and y.  We need to add z to the header file,
this will require
                    a recompile of all source files that include point.h
  6)  For each header file in the working set
         - query the include->source database to get a list of source files that are dependent on the header
file
         - add these source files to a file list
         - create a Visual studio project for each library that contains a dependent source file
         - add the dependent source files for this library to the project
  7) create a project to link the exe that is dependent on the working set project and all dependent projects



What you have:
      - Project that contains the working set of files
      - A dependent project for each library that contains a source file that is dependent on header files in
the working set
        (this allows you to change a header file, and the system will update all source files that include
the header file)
      - workspace that contains a project to link the exe, this project is dependent on working set and all
dependent projects
      - (Optional) a quick-build  project that links the exe, but is only dependent on the working set.  This
allows for a quicker
        build time for the cycles that you are only modifying source files

I have serveral suggestions that I am going to look at this afternoon,  any suggestions, or modifications to
approach
are welcome.

I will post what I come up with.


Thanks again,
Mike

Michael Schneider wrote:

> Hello  All,
>
> I am an old unix developer finally moving to Windows Visual C++.  I have
> been using python on Unix since 96,
> and have been really happy with python as a scripting/tools language.
>
> I need to drive visual studio to create projects, add configurations,
> and add files to projects.
>
> The COM extensions  make it look like it is possible to do this, but I
> am having trouble getting
> it going.
>
> I have ran makepy and added the visual studio type libs.
>
> I copied the following code from a post
>
> -----------------------------------------
> import win32com.client
> app = win32com.client.Dispatch( 'MSDev.Application')
>
> wnd = app.ActiveWindow
> if wnd.Type == 'Text':
>     print wnd.Selection
> app = None
> ------------------------------------------
>
> This prints on the selected test.
>
> I can't seem to get the syntax to obtain and print out project
> properties, or to add a project
>
> Could someone help my out by giving me the python code to try to get
> this to go, I am missing something
> very basic here.
>
> Thanks
> Mike
>
> PS.  I added the MSDEV links to the visual studio docs
> ++++++++++++++++++
> DeveStudio Link to add project
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcug98/html/vcrefaddprojectmethod.asp
>
> Link to Visual Studio Application Object
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcug98/html/_asug_application_object.asp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Michael.L.Schneider.vcf
Type: text/x-vcard
Size: 184 bytes
Desc: Card for Michael Schneider
URL: <http://mail.python.org/pipermail/python-list/attachments/20011127/3a106d0b/attachment.vcf>


More information about the Python-list mailing list