vsgen.project module¶
This module provides the neccessary defintions to support a base project file defintion.
-
class
vsgen.project.
VSGProject
(**kwargs)[source]¶ Bases:
object
VSGProject encapsulates the data and logic needed to act as a base project.
Variables: - GUID (uuid) – The GUID of the project; if not provided one is generated automatically.
- FileName (str) – The absolute filename of the project file; if not provided the value is “”
- Name (str) – The display name of the project; if not provide the value is “”.
- WorkingDirectory (str) – The absolute directory that will be the working directory of the project; if not provide the value is “”
- OutputPath (str) – The absolute directory that will be the output directory of the project; if not provide the value is “”.
- RootNamespace (str) – The name of the root namespace of the project; if not provide the value is “”. Ignored.
- ProjectHome (str) – The absolute directory of the project’s source root folder; if not provide the value is “”
- StartupFile (str) – The absolute path to the Startup file; if not provide the value is “”
- CompileFiles (list) – The list of absolute files that will comprise the projects compile group; if not provide the value is [].
- ContentFiles (list) – The list of absolute files that will comprise the projects content group; if not provide the value is [].
- Directories (list) – The list of absolute directories that will comprise the projects directory group; if not provide the value is [].
- DirectoryInFilter (list) – A list of fnmatch expressions to match directories to be included during the item generation step; if not provided the value is [].
- DirectoryExFilter (list) – A list of fnmatch expressions to match directories to be excludes during the item generation step; if not provided the value is [].
- CompileInFilter (list) – A list of fnmatch expressions to match compile files to be included during the item generation step; if not provide the value is [].
- CompileExFilter (list) – A list of fnmatch expressions to match compile files to be excluded during the item generation step; if not provide the value is [].
- ContentInFilter (list) – A list of fnmatch expressions to match content files to be included during the item generation step; if not provide the value is [].
- ContentExFilter (list) – A list of fnmatch expressions to match content files to be excluded during the item generation step; if not provide the value is [].
- VSVersion (float) – The Visual Studio version; if not provide the value is
None
.
-
CompileFilesRelative
¶ Returns a generator iterating over the each file in
ContentFiles
relative toProjectHome
directory.
-
ContentFilesRelative
¶ Returns a generator iterating over the each file in
ContentFiles
relative toProjectHome
directory.
-
DirectoriesRelative
¶ Returns a generator iterating over the each directory referenced by the project, relative to
ProjectHome
directory.
-
OutputPathRelative
¶ Returns the
OutputPath
relative toProjectHome
directory.
-
ProjectHomeRelative
¶ Returns the
ProjectHome
relative toFileName
directory.
-
StartupFileRelative
¶ Returns the
StartupFile
relative toProjectHome
directory.
-
WorkingDirectoryRelative
¶ Returns the
WorkingDirectory
relative toProjectHome
directory.
-
classmethod
from_section
(config, section, **kwargs)[source]¶ Creates a
VSGProject
from aConfigParser
section.Parameters: - config (ConfigParser) – A
ConfigParser
instance. - section (str) – A
ConfigParser
section key. - kwargs – List of additional keyworded arguments to be passed into the
VSGProject
.
Returns: A valid
VSGProject
instance if succesful; None otherwise.- config (ConfigParser) – A
-
insert_files
(rootpath, directoryInFilter=None, directoryExFilter=None, compileInFilter=None, compileExFilter=None, contentInFilter=None, contentExFilter=None)[source]¶ Inserts files by recursive traversing the rootpath and inserting files according the addition filter parameters.
Parameters: - rootpath (str) – The absolute path to the root directory.
- directoryInFilter (list) – A list of fnmatch expressions to match directories to be included. A None value will default to
DirectoryInFilter
. - directoryExFilter (list) – A list of fnmatch expressions to match directories to be excluded. A None value will default to
DirectoryExFilter
. - compileInFilter (list) – A list of fnmatch expressions to match compile files to be included. A None value will default to
CompileInFilter
. - compileExFilter (list) – A list of fnmatch expressions to match compile files to be excludes. A None value will default to
CompileExFilter
. - contentInFilter (list) – A list of fnmatch expressions to match content files to be includes. A None value will default to
ContentInFilter
. - contentExFilter (list) – A list of fnmatch expressions to match content files to be excludes. A None value will default to
ContentExFilter
.