Toolboxcategory cloud |
ViewsPersonal toolsPython WrapperFrom Seapine LabsWorks with Surround SCM 2008 For those users looking to access Surround SCM programatically, their only option is through the Command Line Interface (CLI). Many of the examples I have posted on this site show how you can access the command line interface using python. For those that are looking for an easier and more reusable option, you may find using this python library helpful.
[edit] About the wrapperThe file is simply a wrapper over the CLI. The advantage of the wrapper is that instead of having to build commands to pass the CLI, you can simple use methods and pass the parameters. Remember that this is still the CLI running in the background. This means that you still need to have the CLI installed and running. The methods are subject to how the CLI works. Make sure you review the CLI user guide to make sure you are using the command properly. If you are not getting the results you expect, run the actual command on the command line. To use this python file, just import it into your namespace within your python script. [edit] DownloadDownload the python file here. [edit] Setting the connection parametersInstead of passing the connection parameters such as username, password, server address and port with each command, these are fields on the SCCM object.
Example:
from PySSCM import *
mySSCM = SSCM()
mySSCM.SCMServerAddr='localhost'
mySSCM.PortNum=4900
mySSCM.Username='test
mySSCM.Password='passtest'
[edit] Sample commandsHere are a few samples using the wrapper. Optional arguments can be skipped. If the command takes a set of known values (like FileType) then a simple class is provided for the allowed values, along with one value (called Empty) which means unspecified. [edit] Check out
Example:
from PySSCM import *
mySSCM = SSCM()
mySSCM.SCMServerAddr='localhost'
mySSCM.PortNum=4900
mySSCM.Username='test
mySSCM.Password='passtest'
mySSCM.checkout('Test.txt',Branch='b1',Repository='r1')
[edit] Get
Example:
from PySSCM import *
mySSCM = SSCM()
mySSCM.SCMServerAddr='localhost'
mySSCM.PortNum=4900
mySSCM.Username='test
mySSCM.Password='passtest'
mySSCM.get(['Test.txt','Test2,txt'],Branch='b1',Repository='r1')
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


