Code

fix namespaces
authorbuliabyak <buliabyak@users.sourceforge.net>
Tue, 10 Jul 2007 01:05:35 +0000 (01:05 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Tue, 10 Jul 2007 01:05:35 +0000 (01:05 +0000)
share/extensions/lorem_ipsum.py

index 2de7b0e60894578b2c9aa4f73b05b006af1d92d8..602b1eedfedc3854165c6e60b8e38ac836de99e7 100644 (file)
@@ -188,18 +188,18 @@ class MyEffect(inkex.Effect):
       action="store", type="int", \r
       dest="fluctuation", default=4,\r
       help="+/-")\r
-    self.first_sentence = 1
-
+    self.first_sentence = 1\r
+\r
   def makePara(self):\r
     _min=max(1,self.options.sentencecount-self.options.fluctuation)\r
     _max=max(2,self.options.sentencecount+self.options.fluctuation)\r
     scount=random.randint(_min,_max)\r
     text=''\r
     for i in range(scount):\r
-      if self.first_sentence == 1:
-        text+=foo[0]
-        self.first_sentence = 0
-      else:
+      if self.first_sentence == 1:\r
+        text+=foo[0]\r
+        self.first_sentence = 0\r
+      else:\r
         text+=foo[random.randint(0,len(foo)-1)]\r
     return text\r
   \r
@@ -219,7 +219,7 @@ class MyEffect(inkex.Effect):
     if found==0:\r
       #inkex.debug('No "flowRoot" elements selected. Unable to add text.')\r
       svg=self.document.getroot()\r
-      gattribs = {inkex.addNS('label','inkscape'):'fill text',inkex.addNS('groupmode','inkscape'):'layer'}\r
+      gattribs = {'inkscape:label':'lorem ipsum','inkscape:groupmode':'layer'}\r
       g=inkex.etree.SubElement(svg,inkex.addNS('g','svg'),gattribs)\r
       flowRoot=inkex.etree.SubElement(g,inkex.addNS('flowRoot','svg'),{'xml:space':'preserve'})\r
       flowRegion=inkex.etree.SubElement(flowRoot,inkex.addNS('flowRegion','svg'))\r