[scribus] python script help
John Culleton
John at wexfordpress.com
Sat Jan 3 18:54:21 UTC 2015
I need one more tweak to my softcover_eng.py
script.
Here is the script thus far:
------------------------
#/usr/bin/env python
# -*- coding: utf-8 -*-
import scribus
import math
from scribus import *
P = scribus.valueDialog('Book Cover
Calculator','Enter Number of pages') P = float(P)
G = scribus.valueDialog('Book Cover
Calculator','Enter Paper Weight (ppi)') G =
float(G) W = scribus.valueDialog('Book Cover
Calculator','Enter Page Width') W = float(W)
H = scribus.valueDialog('Book Cover
Calculator','Enter Page Height') H = float(H)
R = scribus.valueDialog('Book Cover
Calculator','Enter Cover Paper thickness') R =
float(R) W1 = W
WW = W + 0.125
S = P/G + (R*2)
S = float(S)
W = W + S + W + 0.25
H = H + 0.25
scribus.newDocument((W,H), (0.375, 0.375, 0.375,
0.375), scribus.PORTRAIT, 1, scribus.UNIT_INCHES,
scribus.PAGE_1, 0, 1) scribus.setVGuides([WW,
(W1/2 + 0.125), (WW + S/2), (WW + S), (WW + S +
W1/2)]) SS=str(S) end = scribus.messageBox('Book
Spine Width', 'dummy', ICON_WARNING, BUTTON_OK)
-----------------------------------------------
In the last line I want to substitute the value
of S as a text string instead of the the string
'dummy'. The conversion in the next-to-last line
doesn't quite get it.If I substitute SS for
'dummy' instead of a number like 1.25 I get what
appears to be the ascii numbers for the
characters I need. In any case I want to have a
human-readable representation of the value of S.
I ask here as well as on the python news
group because "scribus.messageBox" is specific to
Scribus.
--
John Culleton
Wexford Press
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Updated PDF e-book: "Create Book Covers with
Scribus 1.4.5" coming soon at
http://www.booklocker.com/!
More information about the scribus
mailing list