View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0011286 | Scribus | Scripter | public | 2012-12-23 09:28 | 2026-03-13 16:39 |
| Reporter | vasco | Assigned To | jainbasil | ||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | assigned | Resolution | open | ||
| Product Version | 1.4.1 | ||||
| Target Version | 1.5.4 | ||||
| Summary | 0011286: Allow keyword arguments in scripter | ||||
| Description | Many scripter functions do not accept keywordt arguments. If i want to make a new document i have to type something like: newDocument((297,210), (14.111,14.111,14.111,14.111), oPORTRAIT, 1, UNIT_MILLIMETERS, PAGE_1, 0, 1) Code gets more readable is you can type: newDocument(size=(297,210), margins=(14.111,14.111,14.111,14.111), orientation=PORTRAIT, firstPageNumber=1, unit=UNIT_MILLIMETERS, pagesType=PAGE_1, firstPageOrder=0, numPages=1) Maybe a seperate python wrapper module could be generated, with something like: import Scribus def newDocument(size=(297,210), margins=(14.111,14.111,14.111,14.111), orientation=Scribus.PORTRAIT, firstPageNumber=1, unit=Scribus.UNIT_MILLIMETERS, pagesType=Scribus.PAGE_1, firstPageOrder=0, numPages=1): """ Add documentation here """ return Scribus.newDocument(size, margins, orientation, firstPageNumber, unit, pagesType, firstPageOrder, numPages) | ||||
| Tags | No tags attached. | ||||
| Patch | |||||
|
|
Still relevant ? |
|
|
Depending on the type of script, the argument are mostly meaningful as they are (most of all when using predefined constants to set them) or it should be possible to use the current's user default. A "better" usage example is: newDocument(PAPER_A4_MM, (10, 10, 20, 20), LANDSCAPE, 1, UNIT_MM, PAGE_2, 1, 1) With the addition of a "FIRST_PAGE_RIGHT" this would be mostly nicely readable. Personally, I would leave this open and fix it in a future complete rework of the scripter. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-12-23 09:28 | vasco | New Issue | |
| 2012-12-24 05:46 | christoph_s | Assigned To | => jainbasil |
| 2012-12-24 05:46 | christoph_s | Status | new => assigned |
| 2012-12-24 05:46 | christoph_s | Target Version | => 1.5.1 |
| 2016-01-23 17:17 | cbradney | Target Version | 1.5.1 => 1.5.3 |
| 2016-12-08 22:04 | Kunda | Target Version | 1.5.3 => 1.5.4 |
| 2026-03-09 15:57 | luzpaz | Note Added: 0053577 | |
| 2026-03-13 16:39 | ale | Note Added: 0053581 |