class csurf_info

Information about the CodeSurfer installation.

You do not need to instantiate this class: all members are static.

csurf_info Details

class cs.csurf_info

Information about the CodeSurfer installation.

static install_path()

Retrieve the file system path for the CodeSecure installation.

Return type:str
Returns:The CodeSecure installation directory path.
>>> csurf_info.install_path()
'/mys0/alex/trunk'
static major_version()

Get the major part of the CodeSurfer version number for the current installation.

Return type:int
Returns:The major part of the CodeSurfer version number for the current installation (that is, the number before the “.”), as an int.
>>> csurf_info.major_version()
2
static minor_version()

Get the minor part of the CodeSurfer version number for the current installation.

Return type:int
Returns:The minor part of the CodeSurfer version number for the current installation (that is, the number before the “.”), as an int.
>>> csurf_info.minor_version()
3
static patch_version()

Get the patch number for the current CodeSurfer installation.

Return type:int
Returns:The patch number for the current CodeSurfer installation, as an int.
>>> csurf_info.patch_version()
0
static startup_argv()

Get the argv array used to start the process hosting the plugin.

Return type:[str]
Returns:A list of string. The format corresponds to the argument to a main function traditionally called ‘argv’. (‘argc’ is implicit in the number of elements.)

CodeSurfer and CodeSonar ignore command-line arguments provided after a ‘–’; this can be used to pass arguments to the plugin. For example, ‘csurf -l my-plugin.so – –do-something-cool’. However, the full argument list will be provided as the return from this function; for the example, it would be {“csurf”, “-l”, “my-plugin.so”, “–”, “–do-something-cool”}.

>>> csurf_info.startup_argv()
('c:\\cygwin\\home\\alex\\trunk\\codesonar\\bin\\codesonar.exe', 'slave', '127.0.0.1:64353')
static version()

Get the CodeSurfer version number for the current installation.

Return type:str
Returns:A string representation of the CodeSurfer version number for the current installation, in format “major#.minor#”.
>>> csurf_info.version()
'2.3p0'