diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-11-25 16:05:34 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-11-25 16:06:41 +0100 |
commit | 0e7db6c33bfa2c31439eb602065377428c8c700b (patch) | |
tree | 8b47af27069aad9a5051508fc34c0e121b3e67c4 /scripting | |
parent | scripting: pythonscript.py: adapt to Python 3 (diff) | |
download | core-0e7db6c33bfa2c31439eb602065377428c8c700b.tar.gz core-0e7db6c33bfa2c31439eb602065377428c8c700b.zip |
scripting: Capitalise.py example: fix Python 3 syntax errors
Change-Id: I000e32ed1701c657046ae3b7f836012a7fd56fe4
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/examples/python/Capitalise.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripting/examples/python/Capitalise.py b/scripting/examples/python/Capitalise.py index 274a502f72df..d9c6f07868ce 100644 --- a/scripting/examples/python/Capitalise.py +++ b/scripting/examples/python/Capitalise.py @@ -22,10 +22,10 @@ def getNewString( theString ) : return "" # should we tokenize on "."? if theString[0].isupper() and len(theString)>=2 and theString[1].isupper() : - # first two chars are UC => first UC, rest LC + # first two chars are UC => first UC, rest LC newString=theString[0:1].upper() + theString[1:].lower(); elif theString[0].isupper(): - # first char UC => all to LC + # first char UC => all to LC newString=theString.lower() else: # all to UC. newString=theString.upper() @@ -47,7 +47,7 @@ def capitalisePython( ): count = xIndexAccess.getCount(); if(count>=1): #ie we have a selection i=0 - while i < count : + while i < count : xTextRange = xIndexAccess.getByIndex(i); #print "string: " + xTextRange.getString(); theString = xTextRange.getString(); @@ -70,7 +70,7 @@ def capitalisePython( ): if newString: xTextRange.setString(newString); xSelectionSupplier.select(xTextRange); - i+= 1 + i+= 1 # lists the scripts, that shall be visible inside OOo. Can be omited, if |