forked from amazingfate/help
tdf#152323 drop name attribute from <link> elements
Replacement done with
find . -name \*.xhp -print0 |xargs -0 -P 0 perl -CS -pi -e \
's#(<link[^>]*?) +name *="[^"]*" *( [^>]+|) *>#$1$2>#g'
(note some inconsistencies with space between name and = and also having
empty value, and some more complicated expression to also clear up
double space before/after the attribute)
translation files will be prepped with:
find */helpcontent2 -name \*.po -print0 |xargs -0 -P 0 perl -CS -pi -e \
$'s#(<link[^>]*?) +name=(?:\\\\"[^"]*\\\\"|\'[^\']*\') *( [^>]+|) *(/?>)#$1$2$3#g unless /^#/'
(note that not all languages use the " as quote character for the
attributes, but that also single quotes appera in the po file. Hence
the use of the shell $'string' syntax to be able to quote ' as \'
It also requires to quote the backslash, so that it needs to be escaped
once for the shell, then another time for perl. Also don't work on
obsolete strings (those are prefixed with #~ in the po files)
Also note that <link..></link> gets turned into <link ../> during
translation extraction (along with removal of the space between the
attribute name and the value), so the pattern needs to be slightly
different here)
Change-Id: I95e53a08e6b0095cd894109ea0de154cc4859d8f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143713
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
committed by
Christian Lohmaier
parent
490d42493e
commit
7e42394ecb
@ -22,9 +22,9 @@
|
||||
<bookmark_value>API;script.provider.MasterScriptProvider: Screen Input/Output</bookmark_value>
|
||||
<bookmark_value>API;script.provider.XScript: Screen Input/Output</bookmark_value>
|
||||
</bookmark>
|
||||
<h1 id="N0434"><variable id="ioscreen"><link href="text/sbasic/python/python_screen.xhp" name="IO to screen">Input/Output to Screen</link></variable></h1>
|
||||
<h1 id="N0434"><variable id="ioscreen"><link href="text/sbasic/python/python_screen.xhp">Input/Output to Screen</link></variable></h1>
|
||||
<paragraph role="paragraph" id="N0435">Python standard output file is not available when running Python macros from <menuitem>Tools – Macros - Run Macro</menuitem>... menu. Presenting the output of a module requires the Python interactive console. Features such as <literal>input()</literal>, <literal>print()</literal>, <literal>repr()</literal> and <literal>str()</literal> are available from the Python shell.</paragraph>
|
||||
<tip id="msgbox_tip">%PRODUCTNAME <literal>msgbox</literal> Python module proposes a <literal>msgbox()</literal> method that is illustrated in <link href="text/sbasic/python/python_handler.xhp" name="msgbox example">Creating Event Listeners</link> and <link href="text/sbasic/python/python_handler.xhp" name="msgbox_example">Creating a dialog handler</link> example pages.</tip>
|
||||
<tip id="msgbox_tip">%PRODUCTNAME <literal>msgbox</literal> Python module proposes a <literal>msgbox()</literal> method that is illustrated in <link href="text/sbasic/python/python_handler.xhp">Creating Event Listeners</link> and <link href="text/sbasic/python/python_handler.xhp">Creating a dialog handler</link> example pages.</tip>
|
||||
<paragraph role="paragraph" id="N0437">%PRODUCTNAME Basic proposes <literal>InputBox()</literal>, <literal>Msgbox()</literal> and <literal>Print()</literal> screen I/O functions. Python alternatives exist relying either on %PRODUCTNAME API Abstract Windowing Toolkit, either on Python to Basic function calls. The latter proposes a syntax that is intentionally close to that of Basic, and uses a Python module next to a Basic module. The API Scripting Framework is used to perform Basic, BeanShell, JavaScript and Python inter-languages function calls.</paragraph>
|
||||
<h2 id="N0438">Python syntax:</h2>
|
||||
<paragraph role="code" id="N0439" localize="false">MsgBox(txt, buttons=0, title=None)<br/></paragraph>
|
||||
@ -39,10 +39,10 @@
|
||||
<h2 id="N0449">Installation:</h2>
|
||||
<list type="unordered">
|
||||
<listitem>
|
||||
<paragraph role="listitem" id="N0450">Copy <literal>screen_io</literal> Python module in <link href="text/sbasic/python/python_locations.xhp" name="User macros">My macros</link> within <UserProfile>/Scripts/python/pythonpath,</paragraph>
|
||||
<paragraph role="listitem" id="N0450">Copy <literal>screen_io</literal> Python module in <link href="text/sbasic/python/python_locations.xhp">My macros</link> within <UserProfile>/Scripts/python/pythonpath,</paragraph>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<paragraph role="listitem" id="N0451">Copy <literal>uiScripts</literal> Basic module in <link href="text/sbasic/python/python_locations.xhp" name="User macros">My macros</link> Standard Basic library,</paragraph>
|
||||
<paragraph role="listitem" id="N0451">Copy <literal>uiScripts</literal> Basic module in <link href="text/sbasic/python/python_locations.xhp">My macros</link> Standard Basic library,</paragraph>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<paragraph role="listitem" id="N0452">Restart %PRODUCTNAME.</paragraph>
|
||||
@ -80,7 +80,7 @@
|
||||
<paragraph role="pycode" localize="false" id="N0490"> xScript = scriptPro.getScript(scriptName)</paragraph>
|
||||
<paragraph role="pycode" localize="false" id="N0491"> return xScript</paragraph>
|
||||
</pycode>
|
||||
<note id="par_id161655364816553"><literal>MsgBox</literal> and <literal>InputBox</literal> methods from the <link href="text/sbasic/shared/03/sf_basic.xhp" name="Basic service">Basic service</link> included in <link href="text/sbasic/shared/03/lib_ScriptForge.xhp" name="scriptforge module"> the ScriptForge libraries</link> call directly their native Basic counterparts.</note>
|
||||
<note id="par_id161655364816553"><literal>MsgBox</literal> and <literal>InputBox</literal> methods from the <link href="text/sbasic/shared/03/sf_basic.xhp">Basic service</link> included in <link href="text/sbasic/shared/03/lib_ScriptForge.xhp"> the ScriptForge libraries</link> call directly their native Basic counterparts.</note>
|
||||
<h3 id="N0492"><literal>uiScripts</literal> Basic module</h3>
|
||||
<bascode>
|
||||
<paragraph role="bascode" localize="false" id="N0493">Option Explicit</paragraph>
|
||||
@ -96,7 +96,7 @@
|
||||
<paragraph role="bascode" localize="false" id="N0503"> Print msg</paragraph>
|
||||
<paragraph role="bascode" localize="false" id="N0504">End Sub</paragraph>
|
||||
</bascode>
|
||||
<tip id="tip_APSO">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python" name="apso">Alternative Python Script Organizer</link> (APSO) extension offers a msgbox() function out of its <literal>apso_utils</literal> module.</tip>
|
||||
<tip id="tip_APSO">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python">Alternative Python Script Organizer</link> (APSO) extension offers a msgbox() function out of its <literal>apso_utils</literal> module.</tip>
|
||||
<section id="relatedtopics">
|
||||
<embed href="text/sbasic/shared/03010000.xhp#BasicScreenIO"/>
|
||||
<embed href="text/sbasic/python/python_examples.xhp#pythonexamples2"/>
|
||||
|
||||
Reference in New Issue
Block a user