[Scribus] Help Introducing Text from a python Script
Luis Hurtiz
hurtiz
Thu Oct 28 18:25:54 CEST 2004
Hello again fellows:
In my previous post I told you I wanted to automatized
the publication of a newspaper (legal stuff) which is
simple enough because it doesn't use but two fonts and
three styles (1 column, 2 columns and graphics), I
have stumbled in to a problem with Python (or maybe
Scribus), in order to automatized the task I need to
integrate the documents I told you about from several
files (simple text files, and eventually some graphic
files), in order to do this I use this code I found in
the internet researching python (I am learning python
as I go, I am fluent on other script languages except
python which I find very interesting by the way):
...
primera = CreateText(.5, 4.5, 7.25, 6)
texto = open('/home/luis/textos/primera85.txt', 'r')
while 1:
lineas = texto.readline(100000)
if not lineas:
break
posicion = GetTextLength(primera)
InsertText(lineas, posicion, primera)
....
(units are inches)
It works until it finds a line with just one
enter secuence (or \n) with the following error:
File "", line 4, in ?
File "/home/luis/crearprimera.py", linea 41, in ?
InsertText(lineas, posicion, primera)
Exception: Oook ! Wrong arguments! Call:
InsertText(unicodetext, position [, objectname])
Judging from the output it says that I am not
passing all the arguments to the function in this case
it seems that the secuence of new line is not consider
text (or is empty), this is when it gets a line (like
I said with just one enter on it), I have already make
the text Unicode and it still doesnt work, what can I
do about?... My guess is I will have to put a space
and new line character, but I would like to avoid
this...
Any help is greatly appreciated, thanks again, just
one more question when is version 1.3 coming out? and
is this release going to solve the textframes linking
problem (gets slow when we have too much textframes
linked).
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
More information about the scribus
mailing list