Thanx for the response Adam, perhaps my initial message wasn't clear. As you say, The SECOND case fails because "something.py" should really be passed as an argument in the config; as is the case in the FIRST example. The first case fails because python expects to see the script name as the first argument it receives but CC.Net passes it as the last argument after any arguments it wants to pass. Thus Python terminates with an error: "Can't open file GETMODS"
If CC.Net needs to pass in arguments on the command line then it should append them to the end of any user arguments already supplied. This is especially true since they are of the POSITIONAL form and don't follow the POSIX standard. Regards, Shaun On 27 Jan, 18:14, "Adam V." <[email protected]> wrote: > The script name "something.py" is an argument, not part of the > executable. > > On Jan 27, 9:22 am, CinnamonDonkey <[email protected]> > wrote: > > > A possible way around this is to use: > > > http://www.py2exe.org/ > > > On 27 Jan, 11:35, CinnamonDonkey <[email protected]> > > wrote: > > > > Ooops - sorry for shouting in the subject heading. > > > > ;-) > > > > On 27 Jan, 10:02, CinnamonDonkey <[email protected]> > > > wrote: > > > > > Issue created here: > > > > > http://jira.public.thoughtworks.org/browse/CCNET-1349 > > > > > Regards, > > > > Shaun > > > > > On 27 Jan, 09:44, CinnamonDonkey <[email protected]> > > > > wrote: > > > > > > Hi All, > > > > > > There seems to be a problem using Python for "External Source > > > > > Control", CC.NET Version - 1.4.1.3795 :-( > > > > > > What I have done to try this out: > > > > > > PYTHON SCRIPT (The essentials) - sourceControl.py: > > > > > > # The modules entry point when executed as a command line script. > > > > > > def main( args ): > > > > > print args > > > > > > cmdLine = "" > > > > > > for a in args: > > > > > cmdLine = cmdLine + a + " " > > > > > > debugFile = open ( 'C:\\automation\\SC-Debug.txt', 'a' ) > > > > > debugFile.write( '\n--> ' + cmdLine ) > > > > > debugFile.close() > > > > > > return 0 > > > > > > # Ensure we only run command line functionality when we are the > > > > > __main__ module . > > > > > > if __name__ == "__main__": > > > > > sys.exit( main( sys.argv[0:] ) ) > > > > > > As you can see, it doesn't do much... it simply prints the > > > > > applications call arguments to STDIO and at the same time appends > > > > > (creates if necessary) the arguments to a file in case I miss STDIO. > > > > > But the script will never get called! > > > > > > The ccnet.config has this section: > > > > > > <!-- External Source Control, Calls Python Script to > > > > > retrieve the > > > > > #NEXT Changelist not #HEAD --> > > > > > <sourcecontrol type="external"> > > > > > <executable>python</executable> > > > > > <args>C:\automation\sourceControl.py</args> > > > > > <autoGetSource>true</autoGetSource> > > > > > <labelOnSuccess>false</labelOnSuccess> > > > > > <timeout units="minutes">5</timeout> > > > > > </sourcecontrol> > > > > > > Here's the catch! Looking at the server log, see if you can spot the > > > > > problem: > > > > > > [projectSample:DEBUG] Preparing to run source control command: > > > > > python GETMODS "2009-01-27 09:04:56" "2009-01-26 14:12:52" C: > > > > > \automation\sourceControl.py > > > > > > [projectSample:DEBUG] python: can't open file 'GETMODS': [Errno > > > > > 2] No such file or directory > > > > > > [projectSample:ERROR] Exception: Source control operation > > > > > failed: python: can't open file 'GETMODS': [Errno 2] No such file or > > > > > directory > > > > > > PYTHON requires the format: PYTHON <PYTHON_SCRIPT.PY> [ARGS] > > > > > > Changing the ccnet.config like so, does not fix the problem: > > > > > > <executable>c:\python26\python > > > > > C:\automation\sourceControl.py</ > > > > > executable> > > > > > <args></args> > > > > > > Also does not work the server log reports: > > > > > > [projectSample:DEBUG] Preparing to run source control command: > > > > > c: > > > > > \python26\python C:\automation\sourceControl.py GETMODS "2009-01-27 > > > > > 09:25:00" "2009-01-26 14:12:52" > > > > > > [projectSample:ERROR] INTERNAL ERROR: Unable to execute file [c: > > > > > \python26\python C:\automation\sourceControl.py]. The file may not > > > > > exist or may not be executable. > > > > > > This starts out looking promising but then fails, "Unable to execute > > > > > file", (incidentally, this same problem happens with <EXEC/> tasks). > > > > > > :-( > > > > > > One for the issue tracker I think! > > > > > > Has anyone got around this? > > > > > > Regards, > > > > > Shaun
