[scribus] A new Scripter API documentation

ale rimoldi ale.comp_06 at xox.ch
Mon Aug 17 08:12:46 UTC 2020


hi josé antonio

thanks for your comments!

> # Line 8:
> # To avoid error:
> # Traceback (most recent call last):
> #   File "<console>", line 1, in <module>
> # PermissionError: [Errno 13] Permission denied: 'api.txt'
> -- sys.stdout = open("api.txt", "w")
> ++ sys.stdout = open("./api.txt", "w")

both probably do not work correctly, depending on how scribus is
started.

it was a leftover (probably the last one) from the script i've used as a
starting point.

i've fixed it to always write to the same directory where the
script is (in a file called `output.txt`).
it should always be writable.

i've also commented it out, so that, by default, the output goes to the
terminal, not to the file.

> 
> # Line 32
> -- print('Constants')
> ++ print('<h2>Constants')
> # Lines 36-37; 44-45
> --    print(command[0])
> --    print(command[1] + ': ' + command[2])
> ++    print('<Command>' + command[0])
> ++    print('<Syntax>' + command[1] + ': ' + command[2])
> # Line 40
> -- print('Functions')
> ++ print('<h2>Functions')
> 
> Create Scribus paragraph styles "<Command>", "<Syntax>" and "<h2>".
> Import as text filtering to apply the paragraphs styles and erase the
> marks.

those are lines are from the "old" script that has been used as an
inspiration.

the script i'm using for the ouput is:

https://github.com/aoloe/scribus-script-repository/tree/master/export-scripter-api

there should be no active print() in there anymore.

ciao
a.l.e



More information about the scribus mailing list