View Issue Details

IDProjectCategoryView StatusLast Update
0016090ScribusScripterpublic2020-04-19 23:33
Reporterquazgar Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version1.5.6.svn 
Target VersionFixed in Version1.5.6.svn 
Summary0016090: Python documentation for getText() and insertText() could be improved.
Description- getText() currently says it returns all the text although it's just the visible text.
- getAllText() should advertise that it returns all the text.
- insertText() should mention that it makes sense to call layoutText() before retrieving text for the next time.

See attached patch.
TagsNo tags attached.
PatchYes

Activities

quazgar

2020-04-19 22:47

reporter  

0001_python_doc.patch (1,926 bytes)
Index: cmdtext.h
===================================================================
--- cmdtext.h	(revision 23621)
+++ cmdtext.h	(working copy)
@@ -96,10 +96,12 @@
 PyDoc_STRVAR(scribus_getframetext__doc__,
 QT_TR_NOOP("getText([\"name\"]) -> string\n\
 \n\
-Returns the text of the text frame \"name\". If this text frame has some text\n\
-selected, the selected text is returned. All text in the frame, not just\n\
-currently visible text, is returned. If \"name\" is not given the currently\n\
-selected item is used.\n\
+Returns the visible text of the text frame \"name\". If this text frame has\n\
+some text selected, the selected text is returned.\n\
+\n\
+If \"name\" is not given the currently selected item is used.\n\
+\n\
+If you need all the text, not just the visible part, try getAllText() instead.\n\
 "));
 /*! Get frame text */
 PyObject *scribus_getframetext(PyObject * /*self*/, PyObject* args);
@@ -109,9 +111,11 @@
 QT_TR_NOOP("getAllText([\"name\"]) -> string\n\
 \n\
 Returns the text of the text frame \"name\" and of all text frames which are\n\
-linked with this frame. If this textframe has some text selected, the selected\n\
-text is returned. If \"name\" is not given the currently selected item is\n\
-used.\n\
+linked with this frame. All text in the frame, not just currently visible text,\n\
+is returned. If this textframe has some text selected, the selected text is\n\
+returned.\n\
+\n\
+If \"name\" is not given the currently selected item is used.\n\
 "));
 /*! Get all text */
 PyObject *scribus_gettext(PyObject * /*self*/, PyObject* args);
@@ -189,6 +193,9 @@
 not given the currently selected Item is used.\n\
 \n\
 May throw IndexError for an insertion out of bounds.\n\
+\n\
+After invoking this function, calling layoutText() may be necessary before\n\
+further calls to getText().
 "));
 /*! Insert text */
 PyObject *scribus_inserttext(PyObject * /*self*/, PyObject* args);
0001_python_doc.patch (1,926 bytes)

Issue History

Date Modified Username Field Change
2020-04-19 22:47 quazgar New Issue
2020-04-19 22:47 quazgar File Added: 0001_python_doc.patch
2020-04-19 23:33 jghali Assigned To => jghali
2020-04-19 23:33 jghali Status new => resolved
2020-04-19 23:33 jghali Resolution open => fixed
2020-04-19 23:33 jghali Fixed in Version => 1.5.6.svn