-
Notifications
You must be signed in to change notification settings - Fork 18
config.xml File Import Extension
Daniel Flassig edited this page May 8, 2025
·
20 revisions
A Function extension supplies a button in the PYTHA user interface. The user can invoke the function by pressing that button.
Declaration of a function extension in the config.xml:
<extension type="file-import">
<entry-point>import</entry-point>
<caption>Text of the Button</caption>
<file-filter>*.txt</file-filter>
<help-file>help.html</help-file>
</extension>The following information can be supplied:
-
entry-point- (Mandatory) Name of the lua function that is invoked when the user invokes the import. Note that the name can be chosen freely.import, above, is just an example. -
caption- (Mandatory) The text that is displayed in the Import menu. This text is translatable in the .xlif file. -
file-filter- The file type (or file types) that the extension will handle. The extension must be written with a leading asterisk, e.g. as*.txtfor a file with the extension "txt". -
help-file- The name of a help file (should be .html or .pdf or .txt). This file is opened when the user right-clicks on the button and invokes help. This name of the file is translatable in the .xlif file if separate help files are supplied for different languages.
When the user invokes the import and has selected a file, the entry-point is invoked with the corresponding file handle as its argument
import(file)| Parameter | Type | Description |
|---|---|---|
file |
file_handle |
Handle of the file that the user has selected for import |
Minimum PYTHA Version: V26
config.xml, Edit Extension, Attribute Extension, Anatomy of a Lua Api Plugin, Localization and Translation