summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorPedro Giffuni <pfg@apache.org>2012-07-31 22:04:42 +0000
committerPedro Giffuni <pfg@apache.org>2012-07-31 22:04:42 +0000
commit0ce5e664b83fddfbc5557b63102416835f51b716 (patch)
tree30aabc994dbfdc0029eead52b86b6446444510c2 /scripting
parent383d0ef226e449a4104b14348030c332f58146c8 (diff)
Python reindent.
Notes
ignore: whitespace
Diffstat (limited to 'scripting')
-rw-r--r--scripting/examples/python/Capitalise.py10
-rw-r--r--scripting/examples/python/pythonSamples/TableSample.py8
2 files changed, 9 insertions, 9 deletions
diff --git a/scripting/examples/python/Capitalise.py b/scripting/examples/python/Capitalise.py
index b3a9069b3a39..67facb2bc136 100644
--- a/scripting/examples/python/Capitalise.py
+++ b/scripting/examples/python/Capitalise.py
@@ -26,16 +26,16 @@ 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()
return newString;
-def capitalisePython( ):
+def capitalisePython( ):
"""Change the case of a selection, or current word from upper case, to first char upper case, to all lower case to upper case..."""
import string
@@ -51,7 +51,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();
@@ -74,7 +74,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
diff --git a/scripting/examples/python/pythonSamples/TableSample.py b/scripting/examples/python/pythonSamples/TableSample.py
index 678d409b9ac9..a2acb1417eef 100644
--- a/scripting/examples/python/pythonSamples/TableSample.py
+++ b/scripting/examples/python/pythonSamples/TableSample.py
@@ -36,19 +36,19 @@ def insertTextIntoCell( table, cellName, text, color ):
def createTable():
- """creates a new writer document and inserts a table with some data (also known as the SWriter sample)"""
+ """creates a new writer document and inserts a table with some data (also known as the SWriter sample)"""
ctx = uno.getComponentContext()
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)
-
+
# open a writer document
doc = desktop.loadComponentFromURL( "private:factory/swriter","_blank", 0, () )
-
+
text = doc.Text
cursor = text.createTextCursor()
text.insertString( cursor, "The first line in the newly created text document.\n", 0 )
text.insertString( cursor, "Now we are in the second line\n" , 0 )
-
+
# create a text table
table = doc.createInstance( "com.sun.star.text.TextTable" )