Author: jghali
Date: Fri Apr 24 17:20:39 2020
New Revision: 23647
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23647
Log:
#16091: Rename Python getText() to getFrameText()
Modified:
trunk/Scribus/doc/de/scripterapi-textframes.html
trunk/Scribus/doc/en/scripterapi-textframes.html
trunk/Scribus/doc/fr/scripterapi-textframes.html
trunk/Scribus/doc/it/scripterapi-textframes.html
trunk/Scribus/doc/ru/scripterapi-textframes.html
trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h
trunk/Scribus/scribus/plugins/scriptplugin/samples/quote.py
trunk/Scribus/scribus/plugins/scriptplugin/samples/wordcount.py
trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py
trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote2.py
Modified: trunk/Scribus/doc/de/scripterapi-textframes.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/doc/de/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/de/scripterapi-textframes.html (original)
+++ trunk/Scribus/doc/de/scripterapi-textframes.html Fri Apr 24 17:20:39 2020
@@ -40,15 +40,19 @@
<dd><code>getFontSize(["name"]) -> float</code>
<p>Returns the font size in points for the text frame "name". If this text
frame has some text selected the value assigned to the first character of the
selection is returned. If "name" is not given the currently selected item is
used.</p></dd>
+<dt><a name="-getFrameText"><strong>getFrameText</strong></a>(...)</dt>
+<dd><code>getFrameText(["name"]) -> string</code>
+<p>Returns the text visible in text frame "name". If this text frame has some
text selected, the selected text is returned. If "name" is not given the
currently selected item is used.</p>
+<p>This function returns only the text visible in specified frame. If you need
to retrieve the text contained in a text chain, use <a
href="#-getAllText">getAllText()</a> instead.</p>
+<p>As this function depends on text layout being up-to-date, you may need to
call <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> before calling this function in
order to get expected result.</p></dd>
+
<dt><a name="-getLineSpacing"><strong>getLineSpacing</strong></a>(...)</dt>
<dd><code>getLineSpacing(["name"]) -> float</code>
<p>Returns the line spacing ("leading") of the text frame "name" expressed in
points. If "name" is not given the currently selected item is used.</p></dd>
<dt><a name="-getText"><strong>getText</strong></a>(...)</dt>
<dd><code>getText(["name"]) -> string</code>
-<p>Returns the text visible in text frame "name". If this text frame has some
text selected, the selected text is returned. If "name" is not given the
currently selected item is used.</p>
-<p>This function returns only the text visible in specified frame. If you need
to retrieve the text contained in a text chain, use <a
href="#-getAllText">getAllText()</a> instead.</p>
-<p>As this function depends on text layout being up-to-date, you may need to
call <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> before calling this function in
order to get expected result.</p></dd>
+<p>Deprecated. Use getFrameText() instead.</p></dd>
<dt><a name="-getTextColor"><strong>getTextColor</strong></a>(...)</dt>
<dd><code>getTextColor(["name"]) -> string</code>
@@ -92,7 +96,7 @@
<dt><a name="-insertText"><strong>insertText</strong></a>(...)</dt>
<dd><code>insertText("text", pos, ["name"])</code>
<p>Inserts the text "text" at the position "pos" into the text frame "name".
Text must be UTF encoded (see <a href="#-setText">setText</a>() as reference)
The first character has an index of 0. Inserting text at position -1 appends it
to the frame. If "name" is not given the currently selected item is used.</p>
-<p>For performance reason, this function does not update text layout in any
way. As a consequence, you may need to call <a
href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> at appropriate times after
calling this function and before calling functions such as <a
href="#-getText">getText()</a> or <a
href="#-getTextLines">getTextLines()</a>.</p>
+<p>For performance reason, this function does not update text layout in any
way. As a consequence, you may need to call <a
href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> at appropriate times after
calling this function and before calling functions such as <a
href="#-getFrameText">getFrameText()</a> or <a
href="#-getTextLines">getTextLines()</a>.</p>
<p>May throw IndexError for an insertion out of bounds.</p></dd>
<dt><a name="-isPDFBookmark"><strong>isPDFBookmark</strong>(...)</a></dt>
Modified: trunk/Scribus/doc/en/scripterapi-textframes.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/doc/en/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-textframes.html (original)
+++ trunk/Scribus/doc/en/scripterapi-textframes.html Fri Apr 24 17:20:39 2020
@@ -40,15 +40,19 @@
<dd><code>getFontSize(["name"]) -> float</code>
<p>Returns the font size in points for the text frame "name". If this text
frame has some text selected the value assigned to the first character of the
selection is returned. If "name" is not given the currently selected item is
used.</p></dd>
+<dt><a name="-getFrameText"><strong>getFrameText</strong></a>(...)</dt>
+<dd><code>getFrameText(["name"]) -> string</code>
+<p>Returns the text visible in text frame "name". If this text frame has some
text selected, the selected text is returned. If "name" is not given the
currently selected item is used.</p>
+<p>This function returns only the text visible in specified frame. If you need
to retrieve the text contained in a text chain, use <a
href="#-getAllText">getAllText()</a> instead.</p>
+<p>As this function depends on text layout being up-to-date, you may need to
call <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> before calling this function in
order to get expected result.</p></dd>
+
<dt><a name="-getLineSpacing"><strong>getLineSpacing</strong></a>(...)</dt>
<dd><code>getLineSpacing(["name"]) -> float</code>
<p>Returns the line spacing ("leading") of the text frame "name" expressed in
points. If "name" is not given the currently selected item is used.</p></dd>
<dt><a name="-getText"><strong>getText</strong></a>(...)</dt>
<dd><code>getText(["name"]) -> string</code>
-<p>Returns the text visible in text frame "name". If this text frame has some
text selected, the selected text is returned. If "name" is not given the
currently selected item is used.</p>
-<p>This function returns only the text visible in specified frame. If you need
to retrieve the text contained in a text chain, use <a
href="#-getAllText">getAllText()</a> instead.</p>
-<p>As this function depends on text layout being up-to-date, you may need to
call <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> before calling this function in
order to get expected result.</p></dd>
+<p>Deprecated. Use getFrameText() instead.</p></dd>
<dt><a name="-getTextColor"><strong>getTextColor</strong></a>(...)</dt>
<dd><code>getTextColor(["name"]) -> string</code>
@@ -92,7 +96,7 @@
<dt><a name="-insertText"><strong>insertText</strong></a>(...)</dt>
<dd><code>insertText("text", pos, ["name"])</code>
<p>Inserts the text "text" at the position "pos" into the text frame "name".
Text must be UTF encoded (see <a href="#-setText">setText</a>() as reference)
The first character has an index of 0. Inserting text at position -1 appends it
to the frame. If "name" is not given the currently selected item is used.</p>
-<p>For performance reason, this function does not update text layout in any
way. As a consequence, you may need to call <a
href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> at appropriate times after
calling this function and before calling functions such as <a
href="#-getText">getText()</a> or <a
href="#-getTextLines">getTextLines()</a>.</p>
+<p>For performance reason, this function does not update text layout in any
way. As a consequence, you may need to call <a
href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> at appropriate times after
calling this function and before calling functions such as <a
href="#-getFrameText">getFrameText()</a> or <a
href="#-getTextLines">getTextLines()</a>.</p>
<p>May throw IndexError for an insertion out of bounds.</p></dd>
<dt><a name="-isPDFBookmark"><strong>isPDFBookmark</strong>(...)</a></dt>
Modified: trunk/Scribus/doc/fr/scripterapi-textframes.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/doc/fr/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/fr/scripterapi-textframes.html (original)
+++ trunk/Scribus/doc/fr/scripterapi-textframes.html Fri Apr 24 17:20:39 2020
@@ -35,15 +35,19 @@
<p>Retourne la taille, en points, de la police du cadre de texte "nom". Si ce
cadre contient du texte sélectionné, la valeur assignée au premier
caractère de la sélection est retournée.
Si "nom" n'est pas fourni, l'élément sélectionné est utilisé. </p></dd>
+<dt><a name="-getFrameText"><strong>getFrameText</strong></a>(...)</dt>
+<dd><code>getFrameText(["nom"]) -> chaîne</code>
+<p>Retourne le texte visible dans le cadre de texte "nom". Si ce cadre de
texte contient du texte sélectionné, celui-ci est retourné. Si "nom" n'est
pas fourni, l'élément sélectionné est utilisé.</p>
+<p>Cette fonction retourne uniquement le texte visible dans le cadre
spécifié. Si vous souhaitez obtenir le texte contenu dans une chaîne de
texte, veuillez utiliser <a href="#-getAllText">getAllText()</a> en lieu et
place.</p>
+<p>Comme cette fonction nécessite que la mise en page du texte soit à jour,
il est possible que vous ayez besoin d'appeler <a
href="#-layoutText">layoutText()</a> ou <a
href="#-layoutTextChain">layoutTextChain()</a> au préalable afin d'obtenir le
résultat attendu.</p></dd>
+
<dt><a name="-getLineSpacing"><strong>getLineSpacing</strong></a>(...)</dt>
<dd><code>getLineSpacing(["nom"]) -> réel</code>
<p>Retourne l'espacement de ligne ("leading") du cadre de texte "nom",
exprimé en points. Si "nom" n'est pas fourni, l'élément sélectionné est
utilisé. </p></dd>
<dt><a name="-getText"><strong>getText</strong></a>(...)</dt>
<dd><code>getText(["nom"]) -> chaîne</code>
-<p>Retourne le texte visible dans le cadre de texte "nom". Si ce cadre de
texte contient du texte sélectionné, celui-ci est retourné. Si "nom" n'est
pas fourni, l'élément sélectionné est utilisé.</p>
-<p>Cette fonction retourne uniquement le texte visible dans le cadre
spécifié. Si vous souhaitez obtenir le texte contenu dans une chaîne de
texte, veuillez utiliser <a href="#-getAllText">getAllText()</a> en lieu et
place.</p>
-<p>Comme cette fonction nécessite que la mise en page du texte soit à jour,
il est possible que vous ayez besoin d'appeler <a
href="#-layoutText">layoutText()</a> ou <a
href="#-layoutTextChain">layoutTextChain()</a> au préalable afin d'obtenir le
résultat attendu.</p></dd>
+<p>Obsolète. Veuillez utiliser getFrameText() en lieu et place.</p></dd>
<dt><a name="-getTextColor"><strong>getTextColor</strong></a>(...)</dt>
<dd><code>getTextColor(["nom"]) -> chaîne</code>
@@ -74,7 +78,7 @@
texte doit être encodé en UTF (voir <a href="#-setText">setText</a>()
comme référence). Le premier caractère a un index de 0.
Insérer du texte à la position -1 l'ajoute à la fin du cadre.
Si "nom" n'est pas fourni, l'élément sélectionné est utilisé. </p>
-<p>Pour des raisons de performance, cette fonction ne réalise aucune mise Ã
jour de la mise en page du texte. En conséquence il est possible que vous
deviez appeler <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> après avoir appelé cette
fonction et lorsque vous le jugez nécessaire préalablement à l'appel de
fonctions telles que <a href="#-getText">getText()</a> ou <a
href="#-getTextLines">getTextLines()</a>.</p>
+<p>Pour des raisons de performance, cette fonction ne réalise aucune mise Ã
jour de la mise en page du texte. En conséquence il est possible que vous
deviez appeler <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> après avoir appelé cette
fonction et lorsque vous le jugez nécessaire préalablement à l'appel de
fonctions telles que <a href="#-getFrameText">getFrameText()</a> ou <a
href="#-getTextLines">getTextLines()</a>.</p>
<p>Peut générer IndexError dans le cas d'une insertion hors limites.</p></dd>
<dt><a name="-layoutText"><strong>layoutText</strong></a>(...)</dt>
Modified: trunk/Scribus/doc/it/scripterapi-textframes.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/doc/it/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/it/scripterapi-textframes.html (original)
+++ trunk/Scribus/doc/it/scripterapi-textframes.html Fri Apr 24 17:20:39 2020
@@ -40,15 +40,19 @@
<dd><code>getFontSize(["name"]) -> float</code>
<p>Returns the font size in points for the text frame "name". If this text
frame has some text selected the value assigned to the first character of the
selection is returned. If "name" is not given the currently selected item is
used.</p></dd>
+<dt><a name="-getFrameText"><strong>getFrameText</strong></a>(...)</dt>
+<dd><code>getFrameText(["name"]) -> string</code>
+<p>Returns the text visible in text frame "name". If this text frame has some
text selected, the selected text is returned. If "name" is not given the
currently selected item is used.</p>
+<p>This function returns only the text visible in specified frame. If you need
to retrieve the text contained in a text chain, use <a
href="#-getAllText">getAllText()</a> instead.</p>
+<p>As this function depends on text layout being up-to-date, you may need to
call <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> before calling this function in
order to get expected result.</p></dd>
+
<dt><a name="-getLineSpacing"><strong>getLineSpacing</strong></a>(...)</dt>
<dd><code>getLineSpacing(["name"]) -> float</code>
<p>Returns the line spacing ("leading") of the text frame "name" expressed in
points. If "name" is not given the currently selected item is used.</p></dd>
<dt><a name="-getText"><strong>getText</strong></a>(...)</dt>
<dd><code>getText(["name"]) -> string</code>
-<p>Returns the text visible in text frame "name". If this text frame has some
text selected, the selected text is returned. If "name" is not given the
currently selected item is used.</p>
-<p>This function returns only the text visible in specified frame. If you need
to retrieve the text contained in a text chain, use <a
href="#-getAllText">getAllText()</a> instead.</p>
-<p>As this function depends on text layout being up-to-date, you may need to
call <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> before calling this function in
order to get expected result.</p></dd>
+<p>Deprecated. Use getFrameText() instead.</p></dd>
<dt><a name="-getTextColor"><strong>getTextColor</strong></a>(...)</dt>
<dd><code>getTextColor(["name"]) -> string</code>
@@ -92,7 +96,7 @@
<dt><a name="-insertText"><strong>insertText</strong></a>(...)</dt>
<dd><code>insertText("text", pos, ["name"])</code>
<p>Inserts the text "text" at the position "pos" into the text frame "name".
Text must be UTF encoded (see <a href="#-setText">setText</a>() as reference)
The first character has an index of 0. Inserting text at position -1 appends it
to the frame. If "name" is not given the currently selected item is used.</p>
-<p>For performance reason, this function does not update text layout in any
way. As a consequence, you may need to call <a
href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> at appropriate times after
calling this function and before calling functions such as <a
href="#-getText">getText()</a> or <a
href="#-getTextLines">getTextLines()</a>.</p>
+<p>For performance reason, this function does not update text layout in any
way. As a consequence, you may need to call <a
href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> at appropriate times after
calling this function and before calling functions such as <a
href="#-getFrameText">getFrameText()</a> or <a
href="#-getTextLines">getTextLines()</a>.</p>
<p>May throw IndexError for an insertion out of bounds.</p></dd>
<dt><a name="-isPDFBookmark"><strong>isPDFBookmark</strong>(...)</a></dt>
Modified: trunk/Scribus/doc/ru/scripterapi-textframes.html
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/doc/ru/scripterapi-textframes.html
==============================================================================
--- trunk/Scribus/doc/ru/scripterapi-textframes.html (original)
+++ trunk/Scribus/doc/ru/scripterapi-textframes.html Fri Apr 24 17:20:39 2020
@@ -40,15 +40,19 @@
<dd><code>getFontSize(["name"]) -> float</code>
<p>Returns the font size in points for the text frame "name". If this text
frame has some text selected the value assigned to the first character of the
selection is returned. If "name" is not given the currently selected item is
used.</p></dd>
+<dt><a name="-getFrameText"><strong>getFrameText</strong></a>(...)</dt>
+<dd><code>getFrameText(["name"]) -> string</code>
+<p>Returns the text visible in text frame "name". If this text frame has some
text selected, the selected text is returned. If "name" is not given the
currently selected item is used.</p>
+<p>This function returns only the text visible in specified frame. If you need
to retrieve the text contained in a text chain, use <a
href="#-getAllText">getAllText()</a> instead.</p>
+<p>As this function depends on text layout being up-to-date, you may need to
call <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> before calling this function in
order to get expected result.</p></dd>
+
<dt><a name="-getLineSpacing"><strong>getLineSpacing</strong></a>(...)</dt>
<dd><code>getLineSpacing(["name"]) -> float</code>
<p>Returns the line spacing ("leading") of the text frame "name" expressed in
points. If "name" is not given the currently selected item is used.</p></dd>
<dt><a name="-getText"><strong>getText</strong></a>(...)</dt>
<dd><code>getText(["name"]) -> string</code>
-<p>Returns the text visible in text frame "name". If this text frame has some
text selected, the selected text is returned. If "name" is not given the
currently selected item is used.</p>
-<p>This function returns only the text visible in specified frame. If you need
to retrieve the text contained in a text chain, use <a
href="#-getAllText">getAllText()</a> instead.</p>
-<p>As this function depends on text layout being up-to-date, you may need to
call <a href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> before calling this function in
order to get expected result.</p></dd>
+<p>Deprecated. Use getFrameText() instead.</p></dd>
<dt><a name="-getTextColor"><strong>getTextColor</strong></a>(...)</dt>
<dd><code>getTextColor(["name"]) -> string</code>
@@ -92,7 +96,7 @@
<dt><a name="-insertText"><strong>insertText</strong></a>(...)</dt>
<dd><code>insertText("text", pos, ["name"])</code>
<p>Inserts the text "text" at the position "pos" into the text frame "name".
Text must be UTF encoded (see <a href="#-setText">setText</a>() as reference)
The first character has an index of 0. Inserting text at position -1 appends it
to the frame. If "name" is not given the currently selected item is used.</p>
-<p>For performance reason, this function does not update text layout in any
way. As a consequence, you may need to call <a
href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> at appropriate times after
calling this function and before calling functions such as <a
href="#-getText">getText()</a> or <a
href="#-getTextLines">getTextLines()</a>.</p>
+<p>For performance reason, this function does not update text layout in any
way. As a consequence, you may need to call <a
href="#-layoutText">layoutText()</a> or <a
href="#-layoutTextChain">layoutTextChain()</a> at appropriate times after
calling this function and before calling functions such as <a
href="#-getFrameText">getFrameText()</a> or <a
href="#-getTextLines">getTextLines()</a>.</p>
<p>May throw IndexError for an insertion out of bounds.</p></dd>
<dt><a name="-isPDFBookmark"><strong>isPDFBookmark</strong>(...)</a></dt>
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp Fri Apr 24
17:20:39 2020
@@ -307,7 +307,7 @@
PointToValue(item->textToFrameDistBottom()));
}
-PyObject *scribus_gettext(PyObject* /* self */, PyObject* args)
+PyObject *scribus_getframetext(PyObject* /* self */, PyObject* args)
{
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "|es", "utf-8", &Name))
@@ -1368,8 +1368,9 @@
<< scribus_getfont__doc__
<< scribus_getfontfeatures__doc__
<< scribus_getfontsize__doc__
+ << scribus_getframetext__doc__
<< scribus_getlinespace__doc__
- << scribus_gettext__doc__
+ << scribus_gettext__doc__ // Deprecated
<< scribus_gettextcolor__doc__
<< scribus_gettextdistances__doc__
<< scribus_gettextlength__doc__
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.h Fri Apr 24
17:20:39 2020
@@ -97,8 +97,8 @@
PyObject *scribus_gettextlines(PyObject * /*self*/, PyObject* args);
/*! docstring */
-PyDoc_STRVAR(scribus_gettext__doc__,
-QT_TR_NOOP("getText([\"name\"]) -> string\n\
+PyDoc_STRVAR(scribus_getframetext__doc__,
+QT_TR_NOOP("getFrameText([\"name\"]) -> string\n\
\n\
Returns the text visible in text frame \"name\". If this text frame has some
text\n\
selected, the selected text is returned. If \"name\" is not given the
currently\n\
@@ -111,8 +111,13 @@
layoutText() or layoutTextChain() before calling this function in order to get
\n\
expected result.\n\
"));
+PyDoc_STRVAR(scribus_gettext__doc__,
+QT_TR_NOOP("getText([\"name\"]) -> string\n\
+\n\
+Deprecated. Use getFrameText() instead.\n\
+"));
/*! Get frame text */
-PyObject *scribus_gettext(PyObject * /*self*/, PyObject* args);
+PyObject *scribus_getframetext(PyObject * /*self*/, PyObject* args);
/*! docstring */
PyDoc_STRVAR(scribus_getalltext__doc__,
@@ -200,7 +205,7 @@
\n\
For performance reason, this function does not update text layout in any way.
\n\
As a consequence, you may need to call layoutText() or layoutTextChain() at
appropriate \n\
-times after calling this function and before calling functions such as
getText() \n\
+times after calling this function and before calling functions such as
getFrameText() \n\
or getTextLines().\n\
\n\
May throw IndexError for an insertion out of bounds.\n\
Modified: trunk/Scribus/scribus/plugins/scriptplugin/samples/quote.py
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/scribus/plugins/scriptplugin/samples/quote.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/samples/quote.py (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/samples/quote.py Fri Apr 24
17:20:39 2020
@@ -23,7 +23,7 @@
def quote(textobj):
quoted_re = re.compile('"[^"]*"')
try:
- text = getText(textobj)
+ text = getFrameText(textobj)
except WrongFrameTypeError:
messageBox("quote.py", "Cannot quote text in a non-text frame",
ICON_INFORMATION);
sys.exit(1)
Modified: trunk/Scribus/scribus/plugins/scriptplugin/samples/wordcount.py
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/scribus/plugins/scriptplugin/samples/wordcount.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/samples/wordcount.py
(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/samples/wordcount.py Fri Apr
24 17:20:39 2020
@@ -32,7 +32,7 @@
if sel_count > 1: source += "s" #plural
for i in range(sel_count):
try:
- text = getText(getSelectedObject(i))
+ text = getFrameText(getSelectedObject(i))
words += len(wordsplit(text))
except WrongFrameTypeError:
if sel_count == 1:
@@ -48,7 +48,7 @@
gotoPage(page)
for obj in getAllObjects():
try:
- text = getText(obj)
+ text = getFrameText(obj)
words += len(wordsplit(text))
except WrongFrameTypeError:
pass # ignore the error, it just wasn't a frame we can
count
Modified: trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp Fri Apr 24
17:20:39 2020
@@ -346,7 +346,6 @@
{const_cast<char*>("getColorAsRGB"), scribus_getcolorasrgb,
METH_VARARGS, tr(scribus_getcolorasrgb__doc__)},
{const_cast<char*>("getColorAsRGBFloat"), scribus_getcolorasrgbfloat,
METH_VARARGS, tr(scribus_getcolorasrgbfloat__doc__)},
{const_cast<char*>("isSpotColor"), scribus_isspotcolor, METH_VARARGS,
tr(scribus_isspotcolor__doc__)},
- {const_cast<char*>("getTextDistances"), scribus_gettextdistances,
METH_VARARGS, tr(scribus_gettextdistances__doc__)},
{const_cast<char*>("getColumnGap"), scribus_getcolumngap, METH_VARARGS,
tr(scribus_getcolumngap__doc__)},
{const_cast<char*>("getColumns"), scribus_getcolumns, METH_VARARGS,
tr(scribus_getcolumns__doc__)},
{const_cast<char*>("getCornerRadius"), scribus_getcornerrad,
METH_VARARGS, tr(scribus_getcornerrad__doc__)},
@@ -360,6 +359,7 @@
{const_cast<char*>("getFontFeatures"), scribus_getfontfeatures,
METH_VARARGS, tr(scribus_getfontfeatures__doc__)},
{const_cast<char*>("getFontNames"), (PyCFunction)scribus_fontnames,
METH_NOARGS, tr(scribus_fontnames__doc__)},
{const_cast<char*>("getFontSize"), scribus_getfontsize, METH_VARARGS,
tr(scribus_getfontsize__doc__)},
+ {const_cast<char*>("getFrameText"), scribus_getframetext, METH_VARARGS,
tr(scribus_getframetext__doc__)},
{const_cast<char*>("getGuiLanguage"), (PyCFunction)scribus_getlanguage,
METH_NOARGS, tr(scribus_getlanguage__doc__)},
{const_cast<char*>("getHGuides"), (PyCFunction)scribus_getHguides,
METH_NOARGS, tr(scribus_getHguides__doc__)},
{const_cast<char*>("getImageColorSpace"), scribus_getimagecolorspace,
METH_VARARGS, tr(scribus_getimagecolorspace__doc__) },
@@ -398,8 +398,9 @@
{const_cast<char*>("getTableColumnWidth"), scribus_gettablecolumnwidth,
METH_VARARGS, tr(scribus_gettablecolumnwidth__doc__)},
{const_cast<char*>("getTableStyle"), scribus_gettablestyle,
METH_VARARGS, tr(scribus_gettablestyle__doc__)},
{const_cast<char*>("getTableFillColor"), scribus_gettablefillcolor,
METH_VARARGS, tr(scribus_gettablefillcolor__doc__)},
- {const_cast<char*>("getText"), scribus_gettext, METH_VARARGS,
tr(scribus_gettext__doc__)},
+ {const_cast<char*>("getText"), scribus_getframetext, METH_VARARGS,
tr(scribus_gettext__doc__)}, // Deprecated
{const_cast<char*>("getTextColor"), scribus_gettextcolor, METH_VARARGS,
tr(scribus_gettextcolor__doc__)},
+ {const_cast<char*>("getTextDistances"), scribus_gettextdistances,
METH_VARARGS, tr(scribus_gettextdistances__doc__)},
{const_cast<char*>("getTextLength"), scribus_gettextlength,
METH_VARARGS, tr(scribus_gettextlength__doc__)},
{const_cast<char*>("getTextLines"), scribus_gettextlines, METH_VARARGS,
tr(scribus_gettextlines__doc__)},
{const_cast<char*>("getTextShade"), scribus_gettextshade, METH_VARARGS,
tr(scribus_gettextshade__doc__)},
Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py
(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote.py Fri Apr
24 17:20:39 2020
@@ -115,15 +115,16 @@
if (item[1] != 4):
scribus.messageBox('Scribus - Usage Error', "This is not a
textframe. Try again.", scribus.ICON_WARNING, scribus.BUTTON_OK)
sys.exit(2)
+
contents = scribus.getTextLength(textbox)
while c <= (contents -1):
if ((c + 1) > contents - 1):
nextchar = ' '
else:
scribus.selectText(c+1, 1, textbox)
- nextchar = scribus.getText(textbox)
+ nextchar = scribus.getAllText(textbox)
scribus.selectText(c, 1, textbox)
- char = scribus.getText(textbox)
+ char = scribus.getAllText(textbox)
if (len(char) != 1):
c += 1
continue
Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote2.py
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23647&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote2.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote2.py
(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/Autoquote2.py Fri Apr
24 17:20:39 2020
@@ -224,10 +224,10 @@
else:
alafin = 0
scribus.selectText(c+1, 1, textbox)
- nextchar = scribus.getText(textbox)
+ nextchar = scribus.getAllText(textbox)
scribus.selectText(c, 1, textbox)
- char = scribus.getText(textbox)
+ char = scribus.getAllText(textbox)
# scribus.messageBox("ce qui est", "position:"+str(c)
+'\nchar'+char+'\nPrec:'+prevchar+'\nsuiv:'+nextchar,
# scribus.ICON_WARNING, scribus.BUTTON_OK)
_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit