View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006062 | Scribus | Scripter | public | 2007-08-03 13:48 | 2008-07-24 19:35 |
Reporter | barros | Assigned To | avox | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Ubuntu | OS Version | 7.04 |
Product Version | 1.3.4 | ||||
Target Version | 1.3.5 | Fixed in Version | 1.3.5svn | ||
Summary | 0006062: setStyle problem | ||||
Description | Script in Scribus 1.3.4 does not handle setStyle properly. When called, setStyle applies the style to the entire text frame, and not just to the selected text (selected using selectText). This is the message I sent to the list: http://nashi.altmuehlnet.de/pipermail/scribus/2007-August/025169.html | ||||
Steps To Reproduce | Create a new page with two styles: - STYLE_1: with red color; - STYLE_2: with blue color; Then run the attached script (sample.py). If you run in 1.3.3.9, it will display a red and a blue paragraph, but in 1.3.4, it will display two blue paragraphs. | ||||
Tags | No tags attached. | ||||
Patch | |||||
child of | 0005693 | closed | 1.3.5 bug collection (prior to roadmap) |
2007-08-03 13:48
|
sample.py (1,469 bytes)
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys try: import scribus except ImportError,err: print 'This Python script is written for the Scribus scripting interface.' print 'It can only be run from within Scribus.' sys.exit(1) def main(argv): """Main script routine""" str1 = "This is the first paragraph" str2 = "This is the second paragraph" frame = scribus.createText(50,50,200,300) # first paragraph scribus.insertText(str1,-1,frame) scribus.selectText(0,len(str1),frame) scribus.setStyle("STYLE_1",frame); # break scribus.insertText("\r",-1,frame); # second paragraph scribus.insertText(str2,-1,frame) scribus.selectText(len(str1)+1,len(str2),frame) scribus.setStyle("STYLE_2",frame); def main_wrapper(argv): """The main_wrapper() function disables redrawing, sets a sensible generic status bar message, and optionally sets up the progress bar. It then runs the main() function. Once everything finishes it cleans up after the main() function, making sure everything is sane before the script terminates.""" try: scribus.statusMessage('Running script...') scribus.progressReset() main(argv) finally: # Exit neatly even if the script terminated with an exception, # so we leave the progress bar and status bar blank and make sure # drawing is enabled. if scribus.haveDoc(): scribus.setRedraw(True) scribus.statusMessage('') scribus.progressReset() if __name__ == '__main__': main_wrapper(sys.argv) |
|
Seems to work ok now |
Date Modified | Username | Field | Change |
---|---|---|---|
2007-08-03 13:48 | barros | New Issue | |
2007-08-03 13:48 | barros | File Added: sample.py | |
2007-08-03 22:18 | christoph_s | Status | new => confirmed |
2007-09-27 19:34 | christoph_s | Relationship added | child of 0005693 |
2007-12-06 23:13 | avox | Status | confirmed => assigned |
2007-12-06 23:13 | avox | Assigned To | => avox |
2007-12-20 22:51 | cbradney | Target Version | => 1.3.5svn |
2007-12-26 17:02 | cbradney | Target Version | 1.3.5svn => 1.3.5 |
2008-07-23 22:27 | jghali | Note Added: 0020026 | |
2008-07-23 22:30 | jghali | Status | assigned => resolved |
2008-07-23 22:30 | jghali | Fixed in Version | => 1.3.5svn |
2008-07-23 22:30 | jghali | Resolution | open => fixed |
2008-07-24 19:35 | cbradney | Status | resolved => closed |