Changes

From Gramps

Addon:Lxml Gramplet

994 bytes added, 21:15, 2 April 2025
m
no edit summary
}}
{{man label|[[Addon:Lxml Gramplet#lxml_Gramplet|lxml Gramplet]]}} is an experimental [[Gramplets_development|gramplet]] working under compatible with [[Gramps_Glossary#posix|POSIX]] platform(s)platforms. It performs as an XML reader, transformer and Gramps format validator. JSON dumps also. which reads, writes (''not to a clone; the original one; orginal is safe in a read -only state''), transforms content of our [[Gramps XML]] file on the fly without an import into our database (Gramps session).
Includes the {{man label|[[Addon:Lxml Gramplet#etree_Gramplet|etree Gramplet]]}} for testing the ''Python ElementTree module''(etree) with Gramps XML.
==Usage==
 
<gallery>File:etree_Gramplet_cli.png|etree print (CLI)
File:Etree-Gramplet-detached-addon-51.png|etree Gramplet addon detached from Dashboard
File:etree_Gramplet_Text_View.png|etree Text View
File:Lxml-Gramplet-detached-addon-51.png|lxml Gramplet addon detached from Dashboard
File:Lxml_Gramplet_Text_View.png|lxml Text View
</gallery>
Add these addons to the Gramps Dashboard.
===lxml Gramplet===
 
<gallery>
File:Lxml-Gramplet-detached-addon-51.png|lxml Gramplet addon detached from Dashboard
File:Lxml-Gramplet-detached-addon-60.png|lxml Gramplet addon detached from Dashboard, Gramps 6.0 branch
File:Lxml_Gramplet_Text_View.png|lxml Text View
</gallery>
 
* lxml Gramplet - Gramplet for testing lxml and XSLT
====Goals====
[[File:Lxml-Gramplet-is-it-a-gramps-51.png|thumb|lxml Gramplet addon - "Is it a .gramps?" - warning message on validation process]]
[[File:Lxml-Gramplet-XSD-validation-lxml-warning-51.png|rightleft|thumb|lxml Gramplet addon - "XSD validation (lxml)" - warning message]]
The idea of this experimental '''lxml gramplet''' is to provide a way for using basic lxml features with Gramps XML files.
===etree Gramplet===
<gallery>File:etree_Gramplet_cli_.png|etree print (CLI)
File:Etree-Gramplet-detached-addon-51.png|etree Gramplet addon detached from Dashboard
File:etree_Gramplet_Text_View.png|etree Text View
</gallery>
 
* etree Gramplet - Gramplet for testing etree with Gramps XML
== Installation ==
Manual installation is required, you You can get a copy of this Addon from the repository:
https://github.com/gramps-project/addons-source/tree/mastermaintenance/gramps60/lxml
=== Prerequisites ===
==Example Screenshot results==
Basic usage case has been experimented on lxml gramplet: a global decentralized '[[#Collaborative indexes|Tiny Tafel]]'-like database.# read a Gramps XML in memory# transform the content via a XSLT template# write back the data into new files and format (html, xml)#ability to go futher (dump, match textual data, etc.), ''disabled by default, on current code''  *Titles, labels and footer are translated (written on python code).#Full separation of presentation and content for the generation.
*Full separation of presentation and content for the generation.
* Local output with custom XML data in buffer and XSLT transformation
[[File:lxml_output.png|600px|thumb|left|Dynamic output]]
=Issues=
* <s>Help buttons for both Gramplets do not go to this page</s>.See PR [https://github.com/gramps-project/addons-source/pull/690 690 and 691] on gramps-addons repository* <s>Warning and Error dialogs could be more friendly (eg, by using Gramps' dialogs)</s> ; ''see the next XMLSyntaxError or ParseError''
==lxml Gramplet==
* With the "lxml Gramplet" if you don't load a valid file or just press run without selecting a file you get an error message popup that states "Is it a .gramps ?" and "Cannot copy "D:\filepath\...\test.gramps" then the "Error Report wizard is shown with the error message "110858: ERROR:lxmlGramplet.py line 284:Cannot copy the file"
</pre>
The version for * A Try/Except section has been added (''gramps 6.0 branch'') and many logging.error() moved to logging.debug(). To will avoid these extra Error dialogs.  * Versions prior 5.2 has branch, may have a module location issue (''see bug n°{{bug|13687}}''):
<pre>
- from gramps.gui.thumbnails import get_thumbnail_path
5,414
edits

Navigation menu