graphicstest/graphicstestharness/batch/replace.py
author MattD <mattd@symbian.org>
Tue, 23 Mar 2010 18:45:37 +0000
branchNewGraphicsArchitecture
changeset 23 b07aefc73cd7
parent 0 5d03bc08d59c
child 18 5e30ef2e26cb
permissions -rw-r--r--
Added 'minigui-stripped.oby' and 'wsini_minigui-stripped.ini'for building mini roms with graphics (based on minigui wiki page)

#
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description: 
#

import sys
# first argument is path to file to modify
filePath=sys.argv[1]
outFile=filePath
# second argument is string to find
findstring=sys.argv[2]
# third argument is string to replace first find with
replacestring=sys.argv[3]

inF = open(filePath,'rb')
s=unicode(inF.read(),'utf-16')
inF.close()

outtext=s.replace(findstring,replacestring)

outF = open(outFile,'wb')
outF.write(outtext.encode('utf-16'))
outF.close()