return to DevFabric
from fabric.api import get, put
REMOTE_DIR = "/remote/dir"
LOCAL_WD = "/tmp"
def update_remote_file(fname, subs=):
"""subs is a list of tuples: (find, replace)"""
local_path = pathjoin(LOCAL_WD, fname)
remote_path = pathjoin(REMOTE_DIR, fname)
f = open(local_path, "r")
contents = f.read()
for find,replace in subs:
contents = contents.replace(find, replace)
f = open(local_path, "w")