From: buliabyak Date: Sun, 3 Sep 2006 18:43:10 +0000 (+0000) Subject: rename, move to render submenu, make it always start with lorem ipsum X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8b56a29ff1d9a47fbe0eaccd26bac543e07811f4;p=inkscape.git rename, move to render submenu, make it always start with lorem ipsum --- diff --git a/share/extensions/lorem_ipsum.inx b/share/extensions/lorem_ipsum.inx index 7722b4549..6adc4a91a 100644 --- a/share/extensions/lorem_ipsum.inx +++ b/share/extensions/lorem_ipsum.inx @@ -1,14 +1,17 @@ - <_name>Generate Fill Text + <_name>Lorem ipsum com.kaioa.lorem_ipsum lorem_ipsum.py inkex.py - 5 - 16 - 4 - - Fill Text - + 5 + 16 + 4 + + all + + + + diff --git a/share/extensions/lorem_ipsum.py b/share/extensions/lorem_ipsum.py index e71b2adcc..d246fe0b4 100644 --- a/share/extensions/lorem_ipsum.py +++ b/share/extensions/lorem_ipsum.py @@ -24,6 +24,7 @@ import inkex import random foo=[ +'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ', 'Duis sem velit, ultrices et, fermentum auctor, rhoncus ut, ligula. ', 'Phasellus at purus sed purus cursus iaculis. ', 'Suspendisse fermentum. ', @@ -124,7 +125,6 @@ foo=[ 'Curabitur accumsan felis in erat. ', 'Curabitur lorem risus, sagittis vitae, accumsan a, iaculis id, metus. ', 'Nulla sagittis condimentum ligula. ', -'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ', 'Aliquam imperdiet lobortis metus. ', 'Suspendisse molestie sem. ', 'Ut venenatis. ', @@ -188,14 +188,19 @@ class MyEffect(inkex.Effect): action="store", type="int", dest="fluctuation", default=4, help="+/-") - + self.first_sentence = 1 + def makePara(self): _min=max(1,self.options.sentencecount-self.options.fluctuation) _max=max(2,self.options.sentencecount+self.options.fluctuation) scount=random.randint(_min,_max) text='' for i in range(scount): - text+=foo[random.randint(0,len(foo)-1)] + if self.first_sentence == 1: + text+=foo[0] + self.first_sentence = 0 + else: + text+=foo[random.randint(0,len(foo)-1)] return text def addText(self, node):