Code

svn propset svn:eol-style native *.py
[inkscape.git] / share / extensions / text_randomcase.py
index 0961c594bd2ce2866cad50ac84d1464a4012fe54..0200aef3d6aee64798e1a483332c04f8d508abcf 100644 (file)
@@ -1,27 +1,27 @@
-import chardataeffect, inkex, string\r
-\r
-import random\r
-\r
-class C(chardataeffect.CharDataEffect):\r
-\r
-  def process_chardata(self,text, line, par):\r
-    r = ""\r
-    a = 1\r
-    for i in range(len(text)):\r
-      c = text[i]\r
+import chardataeffect, inkex, string
+
+import random
+
+class C(chardataeffect.CharDataEffect):
+
+  def process_chardata(self,text, line, par):
+    r = ""
+    a = 1
+    for i in range(len(text)):
+      c = text[i]
       # bias the randomness towards inversion of the previous case:
       if a > 0:
-        a = random.choice([-2,-1,1])\r
+        a = random.choice([-2,-1,1])
       else:
-        a = random.choice([-1,1,2])\r      
-      if a > 0 and c.isalpha():\r
-        r = r + c.upper()\r
-      elif a < 0 and c.isalpha():\r\r
-        r = r + c.lower()\r
-      else:\r
-        r = r + c\r
-\r
-    return r\r
-\r
-c = C()\r
-c.affect()\r
+        a = random.choice([-1,1,2])
+      if a > 0 and c.isalpha():
+        r = r + c.upper()
+      elif a < 0 and c.isalpha():
+        r = r + c.lower()
+      else:
+        r = r + c
+
+    return r
+
+c = C()
+c.affect()