[Tutor] Python with Clearcase

Magnus Lycka magnus@thinkware.se
Tue, 08 Oct 2002 15:38:41 +0200


At 15:46 2002-10-08 +0000, schalla wrote:
>Hi fellow Pythoners,
>
>Im new to Python. Im working on a project in which i want to start a=20
>python file when any action (add, delete or update files) happens in the=20
>Clearcase repository.
>what i want is the following:
>
>1) The python file should start a trigger and the trigger should execute=20
>another python file.

Huh? Surely a ClearCase event starts the trigger? If you
want to run clearcase commands from python, that's no big issue.
E.g.

---
import os
os.system('cleartool ci myfile.c')
---

That's the basic concept. If you need to do things based on
stdout/stderr instead you need some more code. See the use
of popen4 in mktrig.py (follow linkbelow).

>2) The second python file should get the commit message, version and the=20
>person who updated the page into the repository.
>
>It would be gr8 if anyone tell me how to go abt that, or if anyone worked=
=20
>on something similar a piece of code would be of great help.

I have some example code that registers triggers
and use python scripts to implement triggers as
well. They don't really do anything useful. They
where written as demonstrations for a course. See
http://www.thinkware.se/cgi-bin/thinki.cgi/PythonClearCase



--=20
Magnus Lyck=E5, Thinkware AB
=C4lvans v=E4g 99, SE-907 50 UME=C5
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se