-
Notifications
You must be signed in to change notification settings - Fork 1
Snippet Updating
With the tool it is possible to update python scripts using a snippet approach. The snippet placeholder in a python script has a Start and End marker for one or several snippets. The vcm tool will then go through each python script and remove all text between Start and End; and insert a text from a file there.
Each Start marker in the python script specifies which snippet that should be inserted and the user can control which file is loaded for each snippet through the command line.
The tool can update several snippets in several python scripts in several component files.
To run the command:
java -jar vcm-console.jar snippet -s SNIPPETNAME=FILENAME -s SNIPPETTWO=OTHERFILE *.vcm
Example: Python script in component Comp.vcm:
import sys
# PythonSnippet Start WarningSnippet
# this will be removed
# PythonSnippet Stop`
The text file named "Warning.txt" looks like this:
# this is inserted`
Command line:
java -jar vcm-console.jar snippet -s WarningSnippet=c:\temp\Warning.txt Comp.vcm
The python script will look like this after the command:
import sys
# PythonSnippet Start WarningSnippet
# this is inserted
# PythonSnippet Stop