upload.py A python script I use to manage my website. After making modifications to a local copy, I run the script to commit the changes to cvs and upload the changed files to the remote site. #!/usr/bin/env python # $ Id: upload.py,v 1.2 2002/03/01 08:11:42 mulix Exp $ # commit to cvs and upload modified pages for # http://vipe.technion.ac.il/~mulix/ # mulix@actcom.co.il, license: GPL import re # the regular expression module import os # the os module import string # the string module class SpawnError(Exception): # the exception we throw if any error occurs def __init__(self, value): # constructor self.value = value def __str__(self): # string representation return `self.value` def run_command(command): """ run a command in the local directory """ if (command == None): return com = command.split(); rc = os.spawnvp(os.P_WAIT, com[0], com); if (rc != 0): raise SpawnError, command + " failed"