5875df7c48
svn: r1140
180 lines
2.9 KiB
HTML
180 lines
2.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Writing Export Filters</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
|
"><LINK
|
|
REL="HOME"
|
|
TITLE="Writing Extentions for gramps"
|
|
HREF="t1.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Writing Import Filters"
|
|
HREF="x162.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Writing Extentions for gramps</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x162.html"
|
|
ACCESSKEY="P"
|
|
><<< Previous</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
> </TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="writingexportfilters">Writing Export Filters</H1
|
|
>
|
|
<P
|
|
> Export filters are similar to report generators. They are not
|
|
allowed to modify the database. An export filter accepts three
|
|
arguments a database, the filename of the file that is to
|
|
be written, and a callback function.
|
|
</P
|
|
>
|
|
<P
|
|
> The callback function is indentical from the callback function
|
|
used for import filters. The export filter's callback function is
|
|
used to indicate progress and update the status bar during the
|
|
export process. The function takes a value between 0.0 and 1.0,
|
|
where 0.0 represents the start of the export and 1.0 represents
|
|
the completion of the export.
|
|
</P
|
|
>
|
|
<P
|
|
> As with the other plugin types, an export filter must be
|
|
registered with <TT
|
|
CLASS="APPLICATION"
|
|
>gramps</TT
|
|
>. This is
|
|
accomplished by calling the
|
|
<TT
|
|
CLASS="FUNCTION"
|
|
>Plugins.register_export</TT
|
|
> task. The
|
|
<TT
|
|
CLASS="FUNCTION"
|
|
>Plugins.register_export</TT
|
|
> accepts two arguments
|
|
the function the performs the import and a string
|
|
providing a brief description. This description is used as the
|
|
menu entry under the
|
|
+ + + + + +<B
|
|
CLASS="GUIMENU"
|
|
>File</B
|
|
>+
|
|
+ + + + + + -><B
|
|
CLASS="GUISUBMENU"
|
|
>Export</B
|
|
>+
|
|
+ + + +
|
|
menu.
|
|
</P
|
|
>
|
|
<DIV
|
|
CLASS="FIGURE"
|
|
><A
|
|
NAME="exportexample"> <P
|
|
><B
|
|
>Figure 5. </B
|
|
></P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x162.html"
|
|
ACCESSKEY="P"
|
|
><<< Previous</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="t1.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
> </TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Writing Import Filters</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
> </TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |