summaryrefslogtreecommitdiff
path: root/support/gtex-letter
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/gtex-letter
Initial commit
Diffstat (limited to 'support/gtex-letter')
-rw-r--r--support/gtex-letter/.gtex-letterrc62
-rw-r--r--support/gtex-letter/.gtex-letterrc.english62
-rw-r--r--support/gtex-letter/.gtex-letterrc.german.g-brief65
-rw-r--r--support/gtex-letter/.gtex-letterrc.spanish61
-rw-r--r--support/gtex-letter/AUTHORS5
-rw-r--r--support/gtex-letter/BUGS16
-rw-r--r--support/gtex-letter/COPYING339
-rw-r--r--support/gtex-letter/ChangeLog116
-rw-r--r--support/gtex-letter/INSTALL40
-rw-r--r--support/gtex-letter/README2
-rw-r--r--support/gtex-letter/REQUIREMENTS14
-rw-r--r--support/gtex-letter/THANKS22
-rw-r--r--support/gtex-letter/TODO21
-rw-r--r--support/gtex-letter/addressbook_vcard.py428
-rw-r--r--support/gtex-letter/config.py170
-rw-r--r--support/gtex-letter/error.py13
-rw-r--r--support/gtex-letter/gtex-letter282
-rw-r--r--support/gtex-letter/gui.py829
-rw-r--r--support/gtex-letter/install48
-rw-r--r--support/gtex-letter/letterheader.dinbrief.tex21
-rw-r--r--support/gtex-letter/letterheader.g-brief.tex43
-rw-r--r--support/gtex-letter/letterheader.spanish.tex17
-rw-r--r--support/gtex-letter/letterheader.standard_latex.tex17
-rw-r--r--support/gtex-letter/logo.xpm184
-rw-r--r--support/gtex-letter/main.py282
-rw-r--r--support/gtex-letter/manual/html/advanced-features.html162
-rw-r--r--support/gtex-letter/manual/html/advanced-guis.html94
-rw-r--r--support/gtex-letter/manual/html/copyright.html95
-rw-r--r--support/gtex-letter/manual/html/gui.html158
-rw-r--r--support/gtex-letter/manual/html/ideen30
-rw-r--r--support/gtex-letter/manual/html/images/address.jpegbin0 -> 29677 bytes
-rw-r--r--support/gtex-letter/manual/html/images/advanced-opening.jpegbin0 -> 10246 bytes
-rw-r--r--support/gtex-letter/manual/html/images/contents.jpegbin0 -> 37577 bytes
-rw-r--r--support/gtex-letter/manual/html/images/filename.jpegbin0 -> 35008 bytes
-rw-r--r--support/gtex-letter/manual/html/images/makeup.jpegbin0 -> 28900 bytes
-rw-r--r--support/gtex-letter/manual/html/images/opening.jpegbin0 -> 30693 bytes
-rw-r--r--support/gtex-letter/manual/html/images/sample-letter.jpegbin0 -> 20355 bytes
-rw-r--r--support/gtex-letter/manual/html/index.html200
-rw-r--r--support/gtex-letter/manual/html/rc-files.html610
-rw-r--r--support/gtex-letter/manual/html/template.html77
-rw-r--r--support/gtex-letter/manual/html/users-manual-ideas27
-rw-r--r--support/gtex-letter/mk_letter.py182
-rw-r--r--support/gtex-letter/print.xpm292
-rw-r--r--support/gtex-letter/translations/gtex-letter.de.mobin0 -> 6584 bytes
-rw-r--r--support/gtex-letter/translations/gtex-letter.de.po349
-rw-r--r--support/gtex-letter/uninstall36
-rw-r--r--support/gtex-letter/utils.py309
-rw-r--r--support/gtex-letter/wmark.jpgbin0 -> 6250 bytes
48 files changed, 5780 insertions, 0 deletions
diff --git a/support/gtex-letter/.gtex-letterrc b/support/gtex-letter/.gtex-letterrc
new file mode 100644
index 0000000000..1c93d90222
--- /dev/null
+++ b/support/gtex-letter/.gtex-letterrc
@@ -0,0 +1,62 @@
+# rc-file for gtex-letter
+[DEFAULT]
+
+[MAIN]
+addressbook='~/.gnome/GnomeCard.gcrd'
+
+mydvipdf=dvipdf __short_filename__
+mydvips=dvips __short_filename__
+myeditor=xterm -e vi __filename__
+mylatex=latex __short_filename__
+myprintcommand=lpr __short_filename__.ps
+myxdvi=xdvi __short_filename__
+
+dateformat=%x
+
+advertise=yes
+
+quite_latex=no
+
+guilevel=novice
+
+filename_guess_format=__id__[-__subject__].tex
+filename_guess_path=~/
+
+mycountry=D
+
+
+opening_defaults="Dear __name_prefix__ __lastname__,"; "Dear __firstname__,"; "To whom it may concern,"
+
+closing_defaults="Yours sincerely,"; "Regards,"; "With the best regards,"; "With the very best regards,"
+
+addressbook_columns=Name_Prefix, Firstname, Lastname, Street, ZIP, City, Country, Telephone
+addressbook_column_widths=50, 80, 100, 120, 50, 100, 20, 90
+
+header_defaults='letterheader.standard_latex'
+
+lettertype=letter
+
+[ADDRESSFORMAT]
+addressformat.0=__name_prefix__
+addressformat.1=[__firstname__ ][__middlename__ ]__lastname__[, __name_suffix__]
+addressformat.2=__post_office__
+addressformat.3=__extended__
+addressformat.4=__street__
+addressformat.5=[__country__--][__zip__ ]__city__[, __region__]
+
+[COMMANDS]
+texcommands.0=\documentclass[12pt]{__lettertype__}
+texcommands.1=\usepackage[T1]{fontenc}
+texcommands.2=\usepackage[latin1]{inputenc}
+texcommands.3=\name{Charles Mustermann}
+texcommands.4=\usepackage{graphicx}
+texcommands.5=\input{__letter_header__}
+texcommands.6=\begin{document}
+texcommands.7=\begin{letter}{__letter_address__}
+texcommands.8=\textbf{\Large\raggedleft __letter_subject__}
+texcommands.9=\opening{__letter_opening__}
+texcommands.10=__letter_contents__
+texcommands.11=
+texcommands.12=\closing{__letter_closing__}
+texcommands.13=\end{letter}
+texcommands.14=\end{document}
diff --git a/support/gtex-letter/.gtex-letterrc.english b/support/gtex-letter/.gtex-letterrc.english
new file mode 100644
index 0000000000..1089e3635e
--- /dev/null
+++ b/support/gtex-letter/.gtex-letterrc.english
@@ -0,0 +1,62 @@
+# rc-file for gtex-letter
+[DEFAULT]
+
+[MAIN]
+addressbook='~/.gnome/GnomeCard.gcrd'
+
+mydvipdf=dvipdf __short_filename__
+mydvips=dvips __short_filename__
+myeditor=xterm -e vi __filename__
+mylatex=latex __short_filename__
+myprintcommand=lpr __short_filename__.ps
+myxdvi=xdvi __short_filename__
+
+dateformat=%x
+
+advertise=yes
+
+quite_latex=no
+
+guilevel=novice
+
+filename_guess_format=__id__[-__subject__].tex
+filename_guess_path=~/
+
+mycountry=D
+
+opening_defaults="Dear __name_prefix__ __lastname__,"; "Dear __firstname__,"; "To whom it may concern,"
+
+closing_defaults="Yours sincerely,"; "Regards,"; "With the best regards,"; "With the very best regards,"
+
+addressbook_columns=Name_Prefix, Firstname, Lastname, Street, ZIP, City, Country, Telephone
+addressbook_column_widths=50, 80, 100, 120, 50, 100, 20, 90
+
+header_defaults='letterheader.standard_latex'
+
+lettertype=letter
+
+[ADDRESSFORMAT]
+addressformat.0=__name_prefix__
+addressformat.1=[__firstname__ ][__middlename__ ]__lastname__[, __name_suffix__]
+addressformat.2=__post_office__
+addressformat.3=__extended__
+addressformat.4=__street__
+addressformat.5=__city__[, __region__][, __zip__ ]
+addressformat.6=[__country__]
+
+[COMMANDS]
+texcommands.0=\documentclass[12pt]{__lettertype__}
+texcommands.1=\usepackage[T1]{fontenc}
+texcommands.2=\usepackage[latin1]{inputenc}
+texcommands.3=\name{Charles Mustermann}
+texcommands.4=\usepackage{graphicx}
+texcommands.5=\input{__letter_header__}
+texcommands.6=\begin{document}
+texcommands.7=\begin{letter}{__letter_address__}
+texcommands.8=\textbf{\Large\raggedleft __letter_subject__}
+texcommands.9=\opening{__letter_opening__}
+texcommands.10=__letter_contents__
+texcommands.11=
+texcommands.12=\closing{__letter_closing__}
+texcommands.13=\end{letter}
+texcommands.14=\end{document}
diff --git a/support/gtex-letter/.gtex-letterrc.german.g-brief b/support/gtex-letter/.gtex-letterrc.german.g-brief
new file mode 100644
index 0000000000..b147328c8f
--- /dev/null
+++ b/support/gtex-letter/.gtex-letterrc.german.g-brief
@@ -0,0 +1,65 @@
+# rc-file for gtex-letter
+[DEFAULT]
+
+[MAIN]
+addressbook=~/.gnome/GnomeCard.gcrd
+
+mydvipdf=dvipdf __short_filename__
+mydvips=dvips __short_filename__
+myeditor=xterm -e vi __filename__
+mylatex=latex __short_filename__
+myprintcommand=lpr __short_filename__.ps
+myxdvi=xdvi __short_filename__
+
+dateformat=%d.%m.%y
+
+advertise=yes
+
+quite_latex=no
+
+guilevel=novice
+
+filename_guess_format=__id__[-__subject__].tex
+filename_guess_path=~/
+
+mycountry=D
+
+opening_defaults="Sehr geehrte[__name_prefix__='Herr':'r'] __name_prefix__ __lastname__,"; "Liebe[__name_prefix__='Herr':'r'] __firstname__,"; "Sehr geehrte Damen und Herren,"
+
+closing_defaults="Mit freundlichen Grüßen,"; "Mit herzlichen Grüßen,"; "Es grüßt Sie freundlich,"; "Es grüßt Sie herzlich,"
+
+addressbook_columns=Name_Prefix, Firstname, Lastname, Street, ZIP, City, Country, Telephone
+addressbook_column_widths=50, 80, 100, 120, 50, 100, 20, 90
+
+header_defaults='letterheader.g-brief'
+
+lettertype=g-brief
+
+[ADDRESSFORMAT]
+addressformat.0=__name_prefix__
+addressformat.1=[__firstname__ ][__middlename__ ]__lastname__[, __name_suffix__]
+addressformat.2=__post_office__
+addressformat.3=__extended__
+addressformat.4=__street__
+addressformat.5=[__country__--][__zip__ ]__city__[, __region__]
+
+[COMMANDS]
+texcommands.0=\documentclass[11pt,german]{__lettertype__}
+texcommands.1=\usepackage[T1]{fontenc}
+texcommands.2=\usepackage[latin1]{inputenc}
+texcommands.3=\usepackage{babel}
+texcommands.4=\usepackage{graphicx}
+texcommands.5=\usepackage{pslatex}
+texcommands.6=\input{__letter_header__}
+texcommands.7=\Anrede{__letter_opening__}
+texcommands.8=\Gruss{__letter_closing__}{1cm}
+texcommands.9=\Betreff{__letter_subject__}
+texcommands.10=\Adresse{__letter_address__}
+texcommands.11=\begin{document}
+texcommands.12=\begin{g-brief}
+texcommands.13=
+texcommands.14=__letter_contents__
+texcommands.15=
+texcommands.16=\end{g-brief}
+texcommands.17=\end{document}
+
diff --git a/support/gtex-letter/.gtex-letterrc.spanish b/support/gtex-letter/.gtex-letterrc.spanish
new file mode 100644
index 0000000000..f422be0cb4
--- /dev/null
+++ b/support/gtex-letter/.gtex-letterrc.spanish
@@ -0,0 +1,61 @@
+# rc-file for gtex-letter
+[DEFAULT]
+
+[MAIN]
+addressbook='~/.gnome/GnomeCard.gcrd'
+
+mydvipdf=dvipdf __short_filename__
+mydvips=dvips __short_filename__
+myeditor=xterm -e vi __filename__
+mylatex=latex __short_filename__
+myprintcommand=lpr __short_filename__.ps
+myxdvi=xdvi __short_filename__
+
+dateformat=%d.%m.%y
+
+advertise=yes
+
+quite_latex=no
+
+guilevel=novice
+
+filename_guess_format=__id__[-__subject__].tex
+filename_guess_path=~/
+
+mycountry=D
+
+opening_defaults="Respetad[__name_prefix__='Sr.':'o'][__name_prefix__='D.':'o'][__name_prefix__='Sra.':'a'][__name_prefix__='Sta.':'a'][__name_prefix__='Dña.':'a'] __name_prefix__ __lastname__,"; "Estimad[__name_prefix__='Sr.':'o'][__name_prefix__='D.':'o'][__name_prefix__='Sra.':'a'][__name_prefix__='Sta.':'a'][__name_prefix__='Dña.':'a'] __name_prefix__ __lastname__,"; "__name_prefix__ __lastname__,"; "Querid[__name_prefix__='Sr.':'o'][__name_prefix__='D.':'o'][__name_prefix__='Sra.':'a'][__name_prefix__='Sta.':'a'][__name_prefix__='Dña.':'a'] __firstname__,"
+
+closing_defaults="Atentamente,"; "Con un cordial saludo,"; "Con mis mejores deseos,"
+
+addressbook_columns=Name_Prefix, Firstname, Lastname, Street, ZIP, City, Country, Telephone
+addressbook_column_widths=50, 80, 100, 120, 50, 100, 20, 90
+
+header_defaults='letterheader.spanish.tex'
+
+lettertype=letter
+
+[ADDRESSFORMAT]
+addressformat.0=__name_prefix__
+addressformat.1=[__firstname__ ][__middlename__ ]__lastname__[, __name_suffix__]
+addressformat.2=__post_office__
+addressformat.3=__extended__
+addressformat.4=__street__
+addressformat.5=[__country__--][__zip__ ]__city__[, __region__]
+
+[COMMANDS]
+texcommands.0=\documentclass[12pt]{__lettertype__}
+texcommands.1=\usepackage[T1]{fontenc}
+texcommands.2=\usepackage[latin1]{inputenc}
+texcommands.3=\usepackage[spanish]{babel}
+texcommands.4=\usepackage{graphicx}
+texcommands.5=\input{__letter_header__}
+texcommands.6=\begin{document}
+texcommands.7=\begin{letter}{__letter_address__}
+texcommands.8=\textbf{\Large\raggedleft __letter_subject__}
+texcommands.9=\opening{__letter_opening__}
+texcommands.10=__letter_contents__
+texcommands.11=
+texcommands.12=\closing{__letter_closing__}
+texcommands.13=\end{letter}
+texcommands.14=\end{document}
diff --git a/support/gtex-letter/AUTHORS b/support/gtex-letter/AUTHORS
new file mode 100644
index 0000000000..3a3757490c
--- /dev/null
+++ b/support/gtex-letter/AUTHORS
@@ -0,0 +1,5 @@
+Authors of gtex-letter
+
+See also the files THANKS and ChangeLog.
+
+Christian Folini designed and implemented gtex-letter.
diff --git a/support/gtex-letter/BUGS b/support/gtex-letter/BUGS
new file mode 100644
index 0000000000..052f32e1a3
--- /dev/null
+++ b/support/gtex-letter/BUGS
@@ -0,0 +1,16 @@
+Please report any bugs to christian.folini@unifr.ch.
+
+
+Known Bugs:
+-----------
+- in the expert-gui. When you click previous on the first page,
+ a nonfatal error occurs.
+- depending on the filename_guess_format, the filename is guessed
+ and set at the beginning, even if i.e. no address is chosen.
+ As soon as a filename is set, it will not be reguessed, because
+ otherwise, filenames entered by the user would be overwritten.
+- I was told gtex-letter depends on ImageMagick for conversion
+ of the image-files. This is due to gdk. That comes as quite a
+ surprise.
+- If you do not set a filename and move ahead, an error
+ occurs. That should be caught.
diff --git a/support/gtex-letter/COPYING b/support/gtex-letter/COPYING
new file mode 100644
index 0000000000..a43ea2126f
--- /dev/null
+++ b/support/gtex-letter/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/support/gtex-letter/ChangeLog b/support/gtex-letter/ChangeLog
new file mode 100644
index 0000000000..ddd1808ca8
--- /dev/null
+++ b/support/gtex-letter/ChangeLog
@@ -0,0 +1,116 @@
+Version 0.30. 9. June 2001
+ - A date-option for filename guesses has been
+ added. It can be accessed with __date__.
+ The format of the date is set via the
+ new rc-file-option: dateformat. The format
+ is entered via the ANSI C decription. Default
+ is %x for the English rc-files and %d.%m.%y for
+ the German and Spanish ones.
+ ATTENTION: This means that you should update
+ your config-file!
+ - I adopted the names of my user-levels to gnome's settings.
+ The old names persist. You can call them beginner, novice,
+ intermediate, normal, advanced, expert and 0,1,2 now.
+ - A standard-function for yes, no, true, false etc. in the
+ rc-file and options has been defined.
+ - I made the annoying clauses disappear from the buttons.
+ They are replaced by '...'. When you select them, the
+ clause is copied to the entry. I think that is a must.
+ - Split up of the file TODO. The bugs are now in
+ the file BUGS.
+ - A documentation has been written. But the topic
+ is not really exhausted.
+ - If you browse for a filename, the browsing starts in the
+ filename_guess_path
+ - The expertlevel-gui has been resized.
+ It should fit on a normal screen now.
+ - Restructured install- and uninstall-file.
+ - The rc-fields mydvipdf, mydvips, myeditor, mylatex,
+ myprintcommand and myxdvi have support for the
+ variables __filename__ and __short_filename__.
+ The latter means the filename without the suffix.
+ ATTENTION: The rc-file has to be updated to match these new features.
+ - 'Estimado/a'-opening added to Spanish rc-file.
+ - Addressformat in .gtex-letterrc.english updated.
+ The zip moved to a place at the end of the line and
+ other minor changes in the addressformat.
+ - A bug in the handling of the addressbook reported
+ by Kenneth N. Flaxman was solved.
+
+
+Version 0.21. 25. Mar. 2001
+ - gtex-letter is ready for translation. So far, a German
+ translation is included in the distribution.
+ - A Spanish rc-file has been included in the distribution.
+ - The code has been enhanced with Exceptions and error handling.
+ - opening-entry was limited to 64 chars. It's 1024 now.
+ - the splash screen was enhanced with the version and the
+ gui-level.
+
+
+Version 0.20. 4. Mar. 2001
+ - Support for serial letters.
+ - Simpler examples of letter-headers.
+ - German letter-header 'g-brief' added.
+
+Version 0.14. 15. Feb. 2001
+ - the programm can now 'guess' filenames. The format
+ of the filename to be choosen can be configured.
+ - usage-message (gtex-letter -u) restructured
+ - configuration of addressformats in the config-file.
+ (the .gtex-letterrc has a new block of options
+ called addressformat.0 etc. please update you rc-file)
+ - There is an enhancement of the format for the
+ defaultvalues for openings and closings. This is
+ for writers, that compose letters in a language, where
+ the opening/closing depends on the sex of the addressee.
+ Check README for more infos. (This code is quite
+ experimental. Please check it out and get back to
+ me.)
+ - Only addresscards with a postal address are displayed.
+ Telephone goes as an address too in this matter.
+ - Startup-option quitelatex.
+ - An import and a save-button for the Contents-field.
+ - Advertise line for the LaTeX-File. (It can be suppressed)
+ - Renamed the main-module
+ - Handful of bugs. In special 'files/dirs not found'
+ and similar things.
+
+Version 0.13. 6. Feb. 2001
+ - piping of text/address into gtex-letter
+ - no-splash-screen - option
+ - multiple addressbook-files
+ - The addressbook ist no sortable; ascending and descending
+ by clicking on the column title.
+ - Select an address by double-clicking.
+
+Version 0.12: 3. Feb. 2001
+ - You can now choose from three different complexity levels
+ of the gui: novice, intermediate, expert. Novice is easy
+ to understand, expert is all in one big page.
+ (Attention: This affects the .gtex-letterrc-file as
+ well. There is a new option called 'guilevel'. You should
+ adopt your old rc-file.
+ - i moved some code around
+ - autoletters (non-interactive letter generation):
+ this is done via 'nogui'-option. You just supply enough
+ info on the command-line and gtex-letter gets it all
+ done for you. Optionally, letters can be printed without
+ showing them first.
+
+Version 0.11: 31. Jan. 2001
+ - support for subject implemented (in the standard letter-class,
+ there is no subject. I implemented in in the LaTeX-Code in
+ .gtex-letterrc. It looks very ugly.
+ - proper searching for the rc-file (cwd, home, install-dir)
+ and other files as well
+ - new logo-pix
+ - support for following addressbook-fields: middlename,
+ suffix, post_office, region
+ - a lot more startup options
+ - Cleanup of code.
+
+Version 0.1: 29. Jan. 2001
+ - This is an unstable first release. It works
+ for me but this might be luck... I hope to
+ get feedback after the initial release.
diff --git a/support/gtex-letter/INSTALL b/support/gtex-letter/INSTALL
new file mode 100644
index 0000000000..e406e3dd8d
--- /dev/null
+++ b/support/gtex-letter/INSTALL
@@ -0,0 +1,40 @@
+Installation
+============
+To run the gtex-letter, just cd to the directory it resides
+and run it with gtex-letter. To permanently install the
+application, run the install-script, that comes with this
+programm to install. You must be root to install:
+$:su
+$:./install
+
+Install will create a directory with the programm files and
+a link to the directory. If you want to install the program
+to a different location than proposed in the install-script,
+please edit the install-script. However, do not forget
+to edit the following files as well: uninstall, gtex-letter,
+gui.py.
+
+ATTENTION: If you do not want to install, you have to reside in the
+gtex-letter-directory when calling the programm. Otherwise
+it will not find its files...
+
+Dependencies
+============
+I do not really know so far which packages gtex-letter depends
+on. Well, it is gnome, python, python-gnome (= pygtk + pygnome),
+but which versions?
+gtex-letter is reported to run with:
+gnome-libs 1.2.7
+python 1.5.2-89 and with python 2.0
+python-gnome-1.0.53 (get it from ftp://ftp.daa.com.au/pub/james/python/)
+
+If it does not run with your configuration, please let me
+know, so i can check out.
+
+Uninstallation
+==============
+To uninstall gtex-letter, run the script uninstall. You must
+be root to uninstall:
+$:su
+$:./uninstall
+
diff --git a/support/gtex-letter/README b/support/gtex-letter/README
new file mode 100644
index 0000000000..ce701773b9
--- /dev/null
+++ b/support/gtex-letter/README
@@ -0,0 +1,2 @@
+This file is no longer maintained. Please refer to the
+help-file index.html in the user's manual.
diff --git a/support/gtex-letter/REQUIREMENTS b/support/gtex-letter/REQUIREMENTS
new file mode 100644
index 0000000000..598a6df7e3
--- /dev/null
+++ b/support/gtex-letter/REQUIREMENTS
@@ -0,0 +1,14 @@
+gtex-letter is developed on Linux and is known to work
+with these components.
+
+ * Gnome. Version 1.2 and above.
+
+ * Python. Version 1.5.2 and above.
+
+ * LaTeX. Any standard Distribution.
+
+ * Python-Gnome. Version 1.0.53 and above.
+
+ * ImageMagick. Any Version should do. ImageMagick is installed on
+ most standard Linux systems except Debian ones. This dependency
+ is due to gtk/gdk (that comes with Gnome).
diff --git a/support/gtex-letter/THANKS b/support/gtex-letter/THANKS
new file mode 100644
index 0000000000..0fc30d4c92
--- /dev/null
+++ b/support/gtex-letter/THANKS
@@ -0,0 +1,22 @@
+gtex-letter THANKS file
+
+gtex-letter has been written by Christian Folini.
+
+The idea for the application is from an article in
+German 'Linux-Magazin'. I do not remember neither
+volume nor author of the article on 'gnome-druids'.
+
+The thank goes to the gtk, gnome and python communities
+who provide us with such powerful tools.
+
+- Philipp Grau helped me finding out, what packages
+ gtex-letter depends on.
+- Yamabe Kazuharu, gave me a lot of hints in the same area.
+- So did Olivier Berger.
+- Christoph Appel provided the g-brief support.
+- Diego Restrepo submitted the Spanish rc-file.
+- Dimitri Pogosyan informed me of a few shortcomings
+ of the application.
+- Kenneth N. Flaxman reported a serious bug in
+ handling of the addressbook. I would have been able
+ to fix it without his helpful hints.
diff --git a/support/gtex-letter/TODO b/support/gtex-letter/TODO
new file mode 100644
index 0000000000..43be7ee306
--- /dev/null
+++ b/support/gtex-letter/TODO
@@ -0,0 +1,21 @@
+The following things wait to be implemented:
+--------------------------------------------
+
+- Commandline option: addressbook-files
+- I was told it is not so easy to find out, that
+ a filename must be set. That should be made
+ clear. Maybe i block the 'next'-button.
+- LaTeX is not very fond of slashes, backslashes and the
+ like. I should convert them before latexing a document.
+- Now that the app is ready for translations,
+ i want to have it translated to as many
+ languages as possible. Please volunteer
+ to translate it to your language.
+ There are about 50 strings to be translated.
+- The distro should be simplified. I should
+ give rpm a try.
+- fields as 'yourref' are not yet supported
+- Support for Evolution addressbooks
+- GnomeCard-Addresses can come with multiple
+ addresses on one card. So far gtex-letter just
+ takes the last one. Nobody complained so far, however.
diff --git a/support/gtex-letter/addressbook_vcard.py b/support/gtex-letter/addressbook_vcard.py
new file mode 100644
index 0000000000..b5853c1ab2
--- /dev/null
+++ b/support/gtex-letter/addressbook_vcard.py
@@ -0,0 +1,428 @@
+#!/usr/bin/env python
+from gtk import *
+from gnome.ui import *
+import sys
+import string
+import os, os.path
+import ConfigParser, gettext
+
+import utils, config
+
+gettext.bindtextdomain('gtex-letter', '/usr/share/locale')
+gettext.textdomain('gtex-letter')
+_ = gettext.gettext
+
+debug = 0
+
+VCARD_ARG_ID = 0
+VCARD_ARG_ADR_POST_OFFICE = 0
+VCARD_ARG_ADR_EXTENDED = 1
+VCARD_ARG_ADR_STREET = 2
+VCARD_ARG_ADR_CITY = 3
+VCARD_ARG_ADR_REGION = 4
+VCARD_ARG_ADR_ZIP = 5
+VCARD_ARG_ADR_COUNTRY = 6
+VCARD_ARG_NAME_LASTNAME = 0
+VCARD_ARG_NAME_FIRSTNAME = 1
+VCARD_ARG_NAME_MIDDLENAME = 2
+VCARD_ARG_NAME_NAME_PREFIX = 3
+VCARD_ARG_NAME_NAME_SUFFIX = 4
+VCARD_ARG_TEL = 0
+
+VCARD_LINE_IDENT_ID = 'FN'
+VCARD_LINE_IDENT_NAME = 'N'
+VCARD_LINE_IDENT_ADDRESS = 'ADR'
+VCARD_LINE_IDENT_TELEPHONE = 'TEL'
+
+WINDOW_TITLE = 'Addressbook'
+
+PRG_DIR='' # is set by calling programm (so do i hope... :)
+
+
+def get_vcard_argument(entry, num_arg):
+ # get the argument nr. 'num_arg' in a vcard-line
+ # ex: ADR:;Postfach;Leberngasse 17;Olten;;4601
+ # here, num_arg 3 means Olten. (num_arg 0 is empty)
+
+ start = string.find(entry, ':')+1
+ arg = ""
+ for i in range(0, num_arg+1):
+ end = string.find(entry, ';', start)
+ if end == -1:
+ end = len(entry)
+ arg = string.rstrip(entry[start: end])
+ start = end+1
+ return arg
+
+class addresscard:
+ def __init__ (self):
+ self.id = ""
+ self.name_prefix = ""
+ self.firstname = ""
+ self.middlename = ""
+ self.lastname = ""
+ self.name_suffix = ""
+ self.post_office = ""
+ self.extended = ""
+ self.street = ""
+ self.zip = ""
+ self.city = ""
+ self.region = ""
+ self.country = ""
+ self.telephone = ""
+ def set_id(self, entry):
+ self.id=get_vcard_argument(entry, VCARD_ARG_ID)
+ if debug:
+ print _("Set id to:"), self.id
+ def set_name(self, entry):
+ get = get_vcard_argument
+ self.name_prefix = get(entry, VCARD_ARG_NAME_NAME_PREFIX)
+ self.lastname = get(entry, VCARD_ARG_NAME_LASTNAME)
+ self.middlename = get(entry, VCARD_ARG_NAME_MIDDLENAME)
+ self.firstname = get(entry, VCARD_ARG_NAME_FIRSTNAME)
+ self.name_suffix = get(entry, VCARD_ARG_NAME_NAME_SUFFIX)
+ if debug:
+ print _("Set prefix firstname middlename lastname suffix to:"), self.name_prefix, self.firstname, self.middlename, self.lastname, self.name_suffix
+
+ def set_address (self, entry):
+ get = get_vcard_argument
+ self.post_office = get(entry, VCARD_ARG_ADR_POST_OFFICE)
+ self.extension = get(entry, VCARD_ARG_ADR_EXTENDED)
+ self.street= get(entry, VCARD_ARG_ADR_STREET)
+ self.zip= get(entry, VCARD_ARG_ADR_ZIP)
+ self.city= get(entry, VCARD_ARG_ADR_CITY)
+ self.region= get(entry, VCARD_ARG_ADR_REGION)
+ self.country= get(entry, VCARD_ARG_ADR_COUNTRY)
+ if debug:
+ print _("Set address to:") , self.post_office, self.extended, self.street , self.zip , self.city, self.region, self.country
+ def set_telephone(self, entry):
+ if not self.telephone: # we take the first phone number and skip the remaining ones
+ self.telephone=get_vcard_argument(entry, VCARD_ARG_TEL)
+ if debug:
+ print _("Set telephone to:"), self.telephone
+
+ def check_for_address(self):
+ return self.get_extended() or self.get_post_office() or \
+ self.get_region() or self.get_street() or \
+ self.get_zip() or self.get_city() or \
+ self.get_country() or self.get_telephone()
+ def get_by_name(self, name):
+ if name == 'id': return self.get_id()
+ elif name == 'name_prefix': return self.get_name_prefix()
+ elif name == 'firstname': return self.get_firstname()
+ elif name == 'middlename': return self.get_middlename()
+ elif name == 'lastname': return self.get_lastname()
+ elif name == 'name_suffix': return self.get_name_suffix()
+ elif name == 'extended': return self.get_extended()
+ elif name == 'post_office': return self.get_post_office()
+ elif name == 'street': return self.get_street()
+ elif name == 'zip': return self.get_zip()
+ elif name == 'city': return self.get_city()
+ elif name == 'region': return self.get_region()
+ elif name == 'country': return self.get_country()
+ else:
+ print _('Error: Could not get address-card-attribute:'), name
+ def get_id(self):
+ return self.id
+ def get_name_prefix(self):
+ return self.name_prefix
+ def get_name_suffix(self):
+ return self.name_suffix
+ def get_firstname(self):
+ return self.firstname
+ def get_middlename(self):
+ return self.middlename
+ def get_lastname(self):
+ return self.lastname
+ def get_extended(self):
+ return self.extended
+ def get_post_office(self):
+ return self.post_office
+ def get_region(self):
+ return self.region
+ def get_street(self):
+ return self.street
+ def get_zip(self):
+ return self.zip
+ def get_city(self):
+ return self.city
+ def get_country(self):
+ return self.country
+ def get_telephone(self):
+ return self.telephone
+
+ def print_card(self, addressformats):
+ print _('ID:'), self.get_id()
+ print utils.mk_adr(self, addressformats),
+ print _('Phone:') + self.get_telephone()
+
+def key_match(line, key):
+ return line[0:len(key)] == key
+def value(line, key):
+ return line[len(key):-1]
+
+class addressbook:
+
+ def __init__ (self, addressbooks=[], column_widths='', columns=''):
+ self.addressbooks = addressbooks
+
+ self.addressbook_column_widths = column_widths
+ self.addressbook_columns = columns
+
+ self.address_cards = []
+
+ def print_ab (self, addressformats):
+ for i in self.address_cards:
+ i.print_card(addressformats)
+
+ def get_card(self, id):
+ for i in self.address_cards:
+ if i.get_id() == id:
+ return i
+
+ def read_file (self):
+ def read_card(self, file):
+ ac = addresscard()
+ while 1:
+ line = file.readline()
+ if not line or key_match(line, "END:VCARD"):
+ break
+ if key_match(line, VCARD_LINE_IDENT_ID):
+ ac.set_id(line)
+ if key_match(line, VCARD_LINE_IDENT_NAME):
+ ac.set_name(line)
+ if key_match(line, VCARD_LINE_IDENT_ADDRESS):
+ ac.set_address(line)
+ if key_match(line, VCARD_LINE_IDENT_TELEPHONE):
+ ac.set_telephone(line)
+ return ac
+ for file in self.addressbooks:
+ old = file
+ file = utils.get_path(file)
+ if file:
+ file = open (file, 'r+')
+ while 1:
+ line = file.readline()
+ if not line:
+ break
+ if key_match(line, "BEGIN:VCARD"):
+ card = read_card(self, file)
+ if card.check_for_address(): # we just take the ones with a real postal address
+ self.address_cards.append(card)
+ else:
+ print _("Error: Could not find addressbook:"), old
+
+
+ def show(self):
+ s = []
+ def delete_event(win, event=None, s=s):
+ win.destroy()
+ mainquit()
+ def win_close(win):
+ win.destroy()
+ win = GtkWindow()
+ win.set_title(WINDOW_TITLE)
+
+ box1 = GtkVBox()
+ win.add(box1)
+ box1.show()
+
+ column_widths = ['0'] + string.split(self.addressbook_column_widths, ',')
+ column_names = ['id'] + string.split(self.addressbook_columns, ',')
+
+ # The number of columns is determinded by the number of widths for columns in the rc file
+ count = len(column_widths)
+
+ if count <> len(column_names):
+ print _("Error: Not the same number of column_widths and column_names provided in the rc-file")
+ for i in range(count):
+ column_widths[i]=string.atoi(string.strip(column_widths[i]))
+ for i in range(count):
+ column_names[i] = ' ' + string.strip(column_names[i])
+
+ clist = GtkCList(count, column_names)
+ clist.set_column_visibility(0, FALSE) # hide id
+ clist.sorting=[]
+ for i in range(count):
+ clist.sorting.append(SORT_ASCENDING)
+
+ clist.set_column_width(0, 20)
+ for i in range(1, count):
+ clist.set_column_width(i, column_widths[i])
+ column_names[0]='id'
+ for i in range(1, count):
+ column_names[i]=string.lower(string.strip(column_names[i]))
+
+ def fill_list(cards, columns=column_names, clist=clist):
+ for i in cards:
+ values=[]
+ for column in columns:
+
+ if column == 'id':
+ values.append(i.get_id())
+ elif column == 'name_prefix':
+ values.append(i.get_name_prefix())
+ elif column == 'firstname':
+ values.append(i.get_firstname())
+ elif column == 'lastname':
+ values.append(i.get_lastname())
+ elif column == 'extended':
+ values.append(i.get_extended())
+ elif column == 'street':
+ values.append(i.get_street())
+ elif column == 'zip':
+ values.append(i.get_zip())
+ elif column == 'city':
+ values.append(i.get_city())
+ elif column == 'country':
+ values.append(i.get_country())
+ elif column == 'telephone':
+ values.append(i.get_telephone())
+ clist.append(values)
+
+
+ def select_clist(_clist, r, c, event, cards=self.address_cards, selected=s):
+ if c >= 0 and r >= 0:
+ selected.append( _clist.get_text(r, 0))
+ def unselect_clist(_clist, r, c, event, cards=self.address_cards, selected=s):
+ if c >= 0 and r >= 0:
+ key = _clist.get_text(r, 0)
+ if key in selected:
+ selected.remove( key )
+
+ def click_title(_clist, c, sorting = clist.sorting, cards=self.address_cards, fill_list=fill_list):
+
+ sorting[c]= not sorting[c]
+ if debug:
+ print _('Sorting:'), sorting
+
+ _clist.set_sort_type(sorting[c])
+
+ _clist.set_sort_column(c)
+ _clist.sort()
+
+ def doubleclick(_clist, _button, win_close=win_close, win=win):
+ if _button.type==5:
+ win_close(win)
+ mainquit()
+
+ def click_ok(_button, cards=self.address_cards, s=s, win_close=win_close, win=win, clist=clist):
+ win_close(win)
+ mainquit()
+ def click_cancel(_button, cards=self.address_cards, win_close=win_close, win=win, s=s):
+ for i in range(len(s)):
+ s.remove(s[0])
+ win_close(win)
+ mainquit()
+
+ box2 = GtkVBox(spacing=10)
+ box2.set_border_width(10)
+ box1.pack_start(box2)
+ box2.show()
+
+ clist.connect("select_row", select_clist)
+ clist.connect("unselect_row", unselect_clist)
+ clist.connect("click_column", click_title)
+ clist.connect("button_press_event", doubleclick)
+ clist.set_selection_mode(SELECTION_MULTIPLE)
+
+
+
+ fill_list(self.address_cards)
+
+ clist.set_border_width(5)
+
+ swin = GtkScrolledWindow()
+ swin.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
+ box2.pack_start(swin)
+ swin.show()
+
+ swin.add(clist)
+ total_column_width=0
+ for i in column_widths:
+ total_column_width = total_column_width + i
+ swin.set_usize(total_column_width, 400)
+ clist.show()
+
+ separator = GtkHSeparator()
+ box1.pack_start(separator, expand=FALSE)
+ separator.show()
+
+ box2 = GtkVBox(spacing=10)
+ box2.set_border_width(10)
+ box1.pack_start(box2, expand=FALSE)
+ box2.show()
+
+ box1 = GtkHBox(spacing=10)
+ button = GtkButton("ok")
+ button.connect("clicked", click_ok)
+ box1.pack_start(button)
+ button.set_flags(CAN_DEFAULT)
+ button.grab_default()
+ button.show()
+
+ button = GtkButton("cancel")
+ button.connect("clicked", click_cancel)
+ box1.pack_start(button)
+ button.set_flags(CAN_DEFAULT)
+ button.grab_default()
+ button.show()
+
+ box2.pack_start(box1, expand=FALSE)
+ box1.show()
+
+ win.connect("destroy", win_close)
+ win.connect("delete_event", delete_event)
+ win.set_usize(total_column_width + count*8 + 50, 500)
+ win.show()
+
+ mainloop()
+
+ if s:
+ return s
+ else:
+ return None
+
+def init_addressbooks(rc, rc_key, texts):
+ def_str = utils.rc_set('MAIN', rc_key, rc)
+ def stripmarks(str):
+ if str[0] == "'" or str[0] == "\"":
+ str = str [1:]
+ if str[-1] == "'" or str[-1] == "\"":
+ str = str [:-1]
+ return str
+ if def_str:
+ num = 1
+ while num >0:
+ num = string.find(def_str, ";")
+ if num >0:
+ tmpstr=stripmarks(string.strip(def_str[0:num]))
+ texts.append (tmpstr)
+ def_str= def_str[num+2:]
+ else:
+ tmpstr=stripmarks(string.strip(def_str))
+ texts.append(tmpstr)
+ if texts == []:
+ print error_txt
+
+
+def main():
+ file = utils.get_path('.gtex-letterrc', '')
+ rc = config.gtex_letter_config(file)
+
+ ab = addressbook(rc.addressbooks, rc.addressbook_column_widths, rc.addressbook_columns)
+ ab.read_file ()
+ s = ab.show()
+ if s:
+ for a in s:
+ if len(s) > 1:
+ print
+ print _("New address:")
+ ac = ab.get_card(a)
+ ac.print_card(rc.addressformats)
+ else:
+ print _("Nothing selected.")
+
+if __name__ == '__main__':
+ main ()
+
diff --git a/support/gtex-letter/config.py b/support/gtex-letter/config.py
new file mode 100644
index 0000000000..d5440992b1
--- /dev/null
+++ b/support/gtex-letter/config.py
@@ -0,0 +1,170 @@
+FALSE=0
+TRUE=-1
+
+
+import ConfigParser, os, string, sys, gettext
+
+import utils
+
+gettext.bindtextdomain('gtex-letter', '/usr/share/locale')
+gettext.textdomain('gtex-letter')
+_ = gettext.gettext
+
+from main import GTEX_LETTER_VERSION
+
+advertisestr = "%%" + _("This file was generated by gtex-letter version") + " " + GTEX_LETTER_VERSION + ".\n"
+
+class gtex_letter_config:
+ def __init__ (self, rc_file, nogui=FALSE, noshow=FALSE, \
+ splash=TRUE, printit=FALSE, guilevel=FALSE, \
+ guessformat='', guesspath='', quite_latex=None, prg_dir=''):
+
+ self.prg_dir = prg_dir
+ self.rc_filename = rc_file
+ self.init_config()
+
+ self.mycountry = utils.rc_set('MAIN', "mycountry", self.rc)
+ self.myeditor = utils.rc_set('MAIN', "myeditor", self.rc)
+ self.mylatex = utils.rc_set('MAIN', "mylatex", self.rc)
+ self.myxdvi = utils.rc_set('MAIN', "myxdvi", self.rc)
+ self.mydvips = utils.rc_set('MAIN', "mydvips", self.rc)
+ self.mydvipdf = utils.rc_set('MAIN', "mydvipdf", self.rc)
+ self.myprintcommand = utils.rc_set('MAIN', "myprintcommand", self.rc)
+ self.dateformat = utils.rc_set('MAIN', "dateformat", self.rc)
+
+ self.lettertype = utils.rc_set('MAIN', 'lettertype', self.rc)
+ self.init_advertise()
+
+ self.filename_guess_format = guessformat
+ if not self.filename_guess_format:
+ self.filename_guess_format = utils.rc_set('MAIN', 'filename_guess_format', self.rc)
+ self.filename_guess_path = guesspath
+ if not self.filename_guess_path:
+ self.filename_guess_path = utils.rc_set('MAIN', "filename_guess_path", self.rc)
+ if self.filename_guess_path[0] == '~':
+ self.filename_guess_path = os.environ['HOME'] + self.filename_guess_path[1:]
+
+
+ if quite_latex==None:
+ quite_latex = utils.rc_set('MAIN', "quite_latex", self.rc)
+ self.init_latex_output(quite_latex)
+
+ self.texcommands=[]
+ self.init_mult_liners(self.texcommands, 'texcommands', 'COMMANDS')
+
+ self.addressformats=[]
+ self.init_mult_liners(self.addressformats, 'addressformat', 'ADDRESSFORMAT')
+
+ self.addressbooks = []
+ self.init_addressbooks('addressbook', self.addressbooks)
+
+
+ self.addressbook_columns = utils.rc_set('MAIN', \
+ "addressbook_columns", self.rc)
+ self.addressbook_column_widths = utils.rc_set('MAIN', \
+ "addressbook_column_widths", self.rc)
+
+ self.headerdefaults = []
+ self.init_default_texts('header_defaults', self.headerdefaults)
+ self.check_headerdefaults()
+
+ self.openingdefaults = []
+ self.init_default_texts('opening_defaults', self.openingdefaults)
+
+ self.closingdefaults = []
+ self.init_default_texts('closing_defaults' ,self.closingdefaults)
+
+
+ self.init_guilevel(guilevel)
+
+ self.nogui = nogui
+ self.noshow = noshow
+ self.printit = printit
+ self.splash = splash
+
+
+ def init_config(self):
+ self.rc=ConfigParser.ConfigParser()
+ file = utils.get_path(self.rc_filename, os.environ['HOME'], self.prg_dir)
+ if not os.path.isfile(file):
+ print _("Error: Could not find rc-file:"), self.rc_filename
+ self.rc.read(file)
+
+ def init_addressbooks(self, rc_key, texts):
+ def_str = utils.rc_set('MAIN', rc_key, self.rc)
+ if def_str:
+ num = 1
+ while num >0:
+ num = string.find(def_str, ";")
+ if num >0:
+ tmpstr=utils.stripmarks(string.strip(def_str[0:num]))
+ texts.append (tmpstr)
+ def_str= def_str[num+2:]
+ else:
+ tmpstr=utils.stripmarks(string.strip(def_str))
+ texts.append(tmpstr)
+
+ def init_mult_liners(self, arg, key, section):
+ i=0
+ while 1:
+ nkey = key + "." + str(i)
+ if nkey in self.rc.options(section):
+ arg.append(utils.rc_set(section, nkey, self.rc))
+ i = i + 1
+ else:
+ break
+ if arg == []:
+ print _("Error: Could not retrieve '%s' from rc-file.") % key
+ sys.exit()
+
+ def init_advertise(self):
+ text = utils.rc_set('MAIN', 'advertise', self.rc)
+ text = utils.switch_yesno(text, default = TRUE)
+ if text:
+ self.advertisestr = advertisestr
+ else:
+ self.advertisestr = ""
+
+ def init_latex_output(self, quite_latex):
+ quite_latex = utils.switch_yesno(quite_latex, default = FALSE)
+ if quite_latex:
+ self.latex_output = '>/dev/null'
+ else:
+ self.latex_output = ''
+
+ def init_default_texts(self, rc_key, texts):
+ def_str = utils.rc_set('MAIN', rc_key, self.rc)
+ def stripmarks(str):
+ if str[0] == "'" or str[0] == "\"":
+ str = str [1:]
+ if str[-1] == "'" or str[-1] == "\"":
+ str = str [:-1]
+ return str
+ if def_str:
+ num = 1
+ while num >0:
+ num = string.find(def_str, ";")
+ if num >0:
+ tmpstr=stripmarks(string.strip(def_str[0:num]))
+ texts.append (tmpstr)
+ def_str= def_str[num+2:]
+ else:
+ tmpstr=stripmarks(string.strip(def_str))
+ texts.append(tmpstr)
+
+ def check_headerdefaults(self):
+ for file in self.headerdefaults:
+ if file[:4] <> '.tex':
+ file = file + '.tex'
+ file = utils.get_path(file, self.prg_dir)
+ if file:
+ if not os.path.isfile(file):
+ print _('Error: Could not find header defaultfile:'), file
+ sys.exit()
+
+ def init_guilevel(self, guilevel):
+ if not guilevel:
+ guilevel = utils.rc_set('MAIN', "guilevel", self.rc)
+ else:
+ guilevel = string.lower(guilevel)
+ self.guilevel = utils.set_guilevel(guilevel)
diff --git a/support/gtex-letter/error.py b/support/gtex-letter/error.py
new file mode 100644
index 0000000000..c438777718
--- /dev/null
+++ b/support/gtex-letter/error.py
@@ -0,0 +1,13 @@
+class Error:
+ def __init__(self, value):
+ self.value = value
+ def __str__(self):
+ return self.value
+
+class AddressCardNotFound(Error): pass
+class AddressFormatMalformed(Error): pass
+class FileExists(Error): pass
+class KeyNotSupported(Error): pass
+class LetterNotWritten(Error): pass
+class MalformedClause(Error): pass
+class PathNotFound(Error): pass
diff --git a/support/gtex-letter/gtex-letter b/support/gtex-letter/gtex-letter
new file mode 100644
index 0000000000..87b754abcd
--- /dev/null
+++ b/support/gtex-letter/gtex-letter
@@ -0,0 +1,282 @@
+#!/usr/bin/env python
+
+GTEX_LETTER_VERSION = '0.30'
+PRG_DIR="/opt/gnome/bin/gtex-letter-prg"
+RC_FILENAME='.gtex-letterrc'
+
+
+import sys
+import os.path
+import getopt
+import ConfigParser
+import string
+import gettext
+
+gettext.bindtextdomain('gtex-letter', '/usr/share/locale')
+gettext.textdomain('gtex-letter')
+_ = gettext.gettext
+
+def help():
+ print "usage: gtex-letter [OPTIONS] [file.tex]"
+ print " PIPE | gtex-letter [OPTIONS] [file.tex]"
+ print
+ print " -a --address str get address with given ID from GnomeCard-file "
+ print " as default address for the letter"
+ print " -s --subject str subject of the letter"
+ print " -o --opening str the letter's opening"
+ print " -f --file str get letter contents from file"
+ print " -c --closing str closing for the letter"
+ print
+ print " -r --rcfile str use a different rc-file (.gtex-letterrc)"
+ print " -e --header str headerfile of the letter"
+ print " --guessformat str the format of filename-guesses"
+ print " --guesspath str the path to prepend to guessed filenames"
+ print " --guilevel str choose the complexity of the gui used."
+ print " possible values are: beginner, normal"
+ print " and expert. While beginner-level is easy to"
+ print " understand, expert is very straight forward."
+ print " --nosplash no start-screen"
+ print
+ print " -n --nogui non-interactive letter production"
+ print " --noshow do not show the letter "
+ print " (only with -n/--nogui-option)"
+ print " --quitelatex hide latex output"
+ print
+ print " -p --print direct printing of the letter"
+ print " (only with -n/--nogui-option)"
+ print
+ print " -h --help print this file and exit"
+ print " -u --usage like help"
+ print " -v --version print version and exit"
+
+def version():
+ return "gtex-letter " + GTEX_LETTER_VERSION
+
+FALSE=0
+TRUE=-1
+
+rc_file = RC_FILENAME
+defaultaddresses = ''
+closing = ''
+contents= ''
+contentsfile = ''
+filename = ''
+header = ''
+opening = ''
+subject = ''
+guessformat = ''
+guesspath = ''
+quite_latex=None
+
+nogui = FALSE
+noshow = FALSE
+printit = FALSE
+guilevel = FALSE
+splash = TRUE
+
+opts, args = getopt.getopt(sys.argv[1:], 'a:c:e:f:hno:pr:s:uv', ['address=', 'closing=', 'file=', 'guessformat=', 'guesspath=', 'guilevel=', 'header=', 'help', 'nogui', 'noshow', 'nosplash', 'opening=', 'print', 'quitelatex', 'rcfile=', 'subject=', 'usage', 'version'])
+for opt in opts:
+ option = opt[0]
+ value = opt[1]
+ if option =='-a' or option =='--address':
+ defaultaddresses = value
+ elif option =='-c' or option =='--closing':
+ closing = value
+ elif option =='-f' or option =='--file':
+ contentsfile = value
+ if not os.path.isfile(contentsfile):
+ print _('Error: Provided file not found.')
+ sys.exit()
+ file = open(contentsfile, 'r')
+ contents= file.read()
+ file.close()
+ elif option =='--guilevel':
+ guilevel = value
+ elif option =='-e' or option =='--header':
+ header = value
+ elif option =='--guessformat':
+ guessformat = value
+ elif option =='--guesspath':
+ guesspath = value
+ elif option =='-h' or option =='--help':
+ help()
+ sys.exit()
+ elif option =='-n' or option =='--nogui':
+ nogui = TRUE
+ elif option =='--noshow':
+ noshow = TRUE
+ elif option =='--nosplash':
+ splash = FALSE
+ elif option =='-o' or option =='--opening':
+ opening = value
+ elif option =='-p' or option =='--print':
+ printit = TRUE
+ elif option =='--quitelatex':
+ quite_latex = TRUE
+ elif option =='-r' or option =='--rcfile':
+ rc_file = value
+ if not os.path.isfile(rc_file):
+ print _('Error: Provided rc-file not found.')
+ sys.exit()
+ elif option =='-s' or option =='--subject':
+ subject = value
+ elif option =='-u' or option =='--usage':
+ help()
+ sys.exit()
+ elif option =='-v' or option =='--version':
+ print version()
+ sys.exit()
+
+if (noshow or printit) and not nogui:
+ print _("Error: You may not set the noshow or the print option without setting nogui.")
+ sys.exit()
+
+
+
+
+# fetch the STDIN if it is set.
+if not sys.stdin.isatty(): # redirected from file or pipe
+ if not contents:
+ contents = sys.stdin.read()
+ elif contents and not defaultaddress:
+ defaultaddress = sys.stdin.read()[:-1] # remove CR-char
+ else:
+ print _("Error: I do not know what to do with STDIN (pipe). You set both, -f/--file and -a/--address, in the options, so there is no place to put the pipe.")
+ sys.exit()
+
+if args:
+ filename = args[0]
+
+
+
+
+
+
+
+sys.argv=[''] # i get an error from module gui, if there are options left in sys.argv
+
+import utils, addressbook_vcard, gui # if i put this before the opts-stuff,
+import mk_letter, config # the options are unknown...
+import error
+
+
+
+
+class gtex_letter:
+ def __init__ (self, rc, \
+ filename = '',\
+ addresskeys = '',\
+ closing = '',\
+ contents = '',\
+ header = '',\
+ opening = '',\
+ subject = ''):
+
+ self.init_address(addresskeys, rc)
+
+ self.init_header(header, rc)
+
+ self.subject = subject
+ self.opening = opening
+ self.contents = contents
+ self.closing = closing
+
+ self.filename = filename
+
+ if not self.filename:
+ file = utils.guess_filename(self, rc)
+ if file:
+ self.filename = file
+
+ self.path = utils.get_path_from_file(self.filename)
+ self.letter_written = FALSE
+
+
+ def init_address(self, addresskeys, rc):
+ self.address = ''
+
+ self.addresscards = []
+
+ if addresskeys:
+ list = []
+ while 1:
+ hit = string.find(addresskeys, ',')
+ if hit == -1:
+ list.append(string.strip(addresskeys))
+ addresskeys=''
+ break
+ list.append(string.strip(addresskeys[:hit]))
+ addresskeys = addresskeys[hit+1:]
+ ab = addressbook_vcard.addressbook(rc.addressbooks)
+ ab.read_file()
+ for name in list:
+ try:
+ card = ab.get_card(name)
+ if card:
+ self.addresscards.append(card)
+ else:
+ raise error.AddressCardNotFound, name
+ except error.AddressCardNotFound, cardname:
+ print _("The addresscard '%s' could not be found.") % cardname
+
+ for card in self.addresscards:
+ if self.address:
+ self.address = self.address + '\n'
+ self.address = self.address + utils.mk_adr(card, \
+ rc.addressformats, rc.mycountry)
+
+ if self.address:
+ self.address_slashes = utils.add_slashes(self.address)
+
+ if not self.address:
+ self.address_slashes = ''
+
+ def init_header(self, header, rc):
+ self.header = ''
+ if header:
+ self.header = header
+ else:
+ if rc.headerdefaults:
+ self.header = rc.headerdefaults[0]
+ try:
+ if self.header:
+ if self.header[-4:] <> '.tex':
+ self.header = self.header + '.tex'
+ self.header = utils.get_path(self.header, rc.prg_dir)
+ if self.header:
+ if not os.path.split(self.header)[0]: # if it is still local
+ self.header = os.path.join(os.getcwd(), \
+ self.header)
+ else:
+ raise IOError, header
+ except IOError, file:
+ print _("Submitted headerfile '%s' not found") % file
+
+
+
+def main ():
+ rc = config.gtex_letter_config(rc_file, nogui=nogui, \
+ noshow=noshow, splash=splash, \
+ printit=printit, guilevel=guilevel, \
+ guessformat=guessformat, guesspath=guesspath, quite_latex=quite_latex, prg_dir=PRG_DIR )
+
+ letter = gtex_letter(rc, filename, defaultaddresses, \
+ closing, contents, \
+ header, opening, subject)
+ if rc.nogui:
+ letter.letter_written = not mk_letter.write_file(letter, rc)
+ if not letter.letter_written:
+ print _("Aborting.")
+ sys.exit()
+ mk_letter.tex_latex(letter, rc)
+ if not rc.noshow:
+ mk_letter.tex_xdvi(letter, rc)
+ if printit:
+ mk_letter.tex_print(letter, rc)
+ mk_letter.rm_latex_files(letter)
+ else:
+ gp = gui.GUI (rc, letter)
+ gp.mainloop ()
+
+if __name__ == '__main__':
+ main ()
diff --git a/support/gtex-letter/gui.py b/support/gtex-letter/gui.py
new file mode 100644
index 0000000000..b5a52dfc05
--- /dev/null
+++ b/support/gtex-letter/gui.py
@@ -0,0 +1,829 @@
+from gtk import *
+from gnome.ui import *
+import GdkImlib
+import string
+import os, os.path, sys
+import ConfigParser, gettext
+
+import addressbook_vcard
+import utils
+import mk_letter
+import error
+
+from main import GTEX_LETTER_VERSION
+
+gettext.bindtextdomain('gtex-letter', '/usr/share/locale')
+gettext.textdomain('gtex-letter')
+_ = gettext.gettext
+
+VERTICAL = 1
+HORIZONTAL = 2
+
+class GUI:
+
+ def __init__ (self, rc, letter):
+ self.rc = rc
+ self.l = letter
+
+ self.app = GnomeApp ("gtex-letter", "gtex-letter")
+ self.app.connect ("destroy", self.quit)
+ self.app.connect ("delete_event", self.quit)
+
+ try:
+ file = utils.get_path("logo.xpm", self.rc.prg_dir)
+ if not file: # The problem is GnomeDruidPageStandard. it really wants to have a logo
+ raise IOError, 'logo.xpm'
+ self.logo = GdkImlib.Image (file)
+ except IOError, file:
+ print _("Could not find '%s'. Aborting.") % file
+ sys.exit()
+
+ try:
+ file = utils.get_path("wmark.jpg", self.rc.prg_dir)
+ if file:
+ self.wmark = GdkImlib.Image (file)
+ else:
+ self.wmark = None
+ raise IOError, 'wmark.jpg'
+ except IOError, file:
+ print _("Could not find '%s'.") % file
+
+ self.comboopening = GtkCombo()
+ self.entryopening = GtkEntry (1024)
+ self.openingbuttons = []
+ self.openinglabels = []
+
+ for i in self.rc.openingdefaults:
+ self.mk_button (i, self.openingbuttons,
+ self.openinglabels,
+ self.entryopening)
+
+ self.comboclosing = GtkCombo()
+ self.entryclosing = GtkEntry (64)
+ self.closingbuttons=[]
+ self.closinglabels = []
+
+ for i in self.rc.closingdefaults:
+ self.mk_button (i, self.closingbuttons,
+ self.closinglabels,
+ self.entryclosing)
+
+ self.druid = GnomeDruid ()
+ self.druid.connect ("cancel", self.quit)
+
+ if self.rc.guilevel == 'beginner':
+ self.mk_novice_druid()
+
+ elif self.rc.guilevel == 'normal':
+ self.mk_intermediate_druid()
+
+ elif self.rc.guilevel == 'advanced':
+ self.mk_expert_druid()
+
+
+ self.app.set_contents (self.druid)
+
+ self.app.show_all ()
+
+ def mk_novice_druid(self):
+ if self.rc.splash:
+ page = GnomeDruidPageStart ("gtex-letter", self.get_splash_text(),
+ self.logo, self.wmark)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Address") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.address_frame(), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip, FALSE, FALSE)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Subject and Opening") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.subject_frame(), FALSE, FALSE, 5)
+ page.vbox.pack_start (self.opening_frame_combo(), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip, FALSE, FALSE)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Contents and Closing") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.contents_frame(), FALSE, FALSE, 5)
+ page.vbox.pack_start (self.closing_frame_combo(), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Header and Filename") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.header_frame(), FALSE, FALSE, 5)
+ page.vbox.pack_start (self.filename_frame(), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip, TRUE)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Makeup"), self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.latex_frame(page), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageFinish (_("Finish gtex-letter"), \
+ _("Thankyou for using me."), \
+ self.logo, self.wmark)
+ page.connect ("finish", self.end_druid)
+ self.druid.add ( page )
+
+ def mk_intermediate_druid(self):
+ if self.rc.splash:
+ page = GnomeDruidPageStart (_("gtex-letter"), self.get_splash_text(),
+ self.logo, self.wmark)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Address, Subject and Opening") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.address_frame(), FALSE, FALSE, 5)
+ page.vbox.pack_start (self.subject_frame(), FALSE, FALSE, 5)
+ page.vbox.pack_start (self.opening_frame_buttons(), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Contents, Closing, Header and Filename") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.contents_frame(), FALSE, FALSE, 5)
+ page.vbox.pack_start (self.closing_frame_buttons(), FALSE, FALSE, 5)
+ page.vbox.pack_start (self.header_frame(), FALSE, FALSE, 5)
+ page.vbox.pack_start (self.filename_frame(), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip, TRUE)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Makeup") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.latex_frame(page), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageFinish ("Finish gtex-letter", \
+ "Thankyou for using me.", \
+ self.logo, self.wmark)
+ page.connect ("finish", self.end_druid)
+ self.druid.add ( page )
+
+ def mk_expert_druid(self):
+
+ page = GnomeDruidPageStandard (" " + _("All in one big page") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.set_spacing(10)
+ hbox = GtkHBox(spacing = 10)
+ hbox.pack_start (self.address_frame(), expand=TRUE, fill=TRUE)
+ hbox.pack_start (self.subject_frame(), expand=TRUE, fill=TRUE)
+ page.vbox.pack_start (hbox)
+ hbox.show()
+ hbox = GtkHBox(spacing = 10)
+ hbox.pack_start (self.opening_frame_buttons(), expand=TRUE, fill=TRUE)
+ hbox.pack_start (self.closing_frame_buttons(), expand=TRUE, fill=TRUE)
+ hbox.show()
+ page.vbox.pack_start (hbox)
+ page.vbox.pack_start (self.contents_frame(HORIZONTAL), expand=TRUE, fill=TRUE)
+ hbox = GtkHBox(spacing = 10)
+ hbox.pack_start (self.header_frame(HORIZONTAL), expand=TRUE, fill=TRUE)
+ hbox.pack_start (self.filename_frame(HORIZONTAL), expand=TRUE, fill=TRUE)
+ page.vbox.pack_start (hbox)
+ hbox.show()
+ page.connect ("next", self.pageflip, TRUE)
+
+
+
+ self.druid.add ( page )
+
+ page = GnomeDruidPageStandard (" " + _("Makeup") + " ", self.logo)
+ page.vbox.set_border_width (5)
+ page.vbox.pack_start (self.latex_frame(page), FALSE, FALSE, 5)
+ page.connect ("next", self.pageflip)
+ self.druid.add ( page )
+
+ page = GnomeDruidPageFinish (_("Finish gtex-letter"), \
+ _("Thankyou for using me."), \
+ self.logo, self.wmark)
+ page.connect ("finish", self.end_druid)
+ self.druid.add ( page )
+
+ def init_latex_output(self, quite_latex):
+ if quite_latex == 0 or not quite_latex \
+ or quite_latex == 'no' \
+ or quite_latex=='false':
+ self.latex_output = ''
+ else:
+ self.latex_output = '>/dev/null'
+
+ def mk_button(self, text, buttons, labels, entry):
+ def cp_text(_button, text, self=self, entry=entry):
+ if len(self.l.addresscards) <= 1:
+ text = utils.general_mkup_text(self.l, text, self.rc)
+ entry.set_text(text)
+
+ buttons.append(GtkButton())
+
+ simple_text = utils.simplify_txt(text)
+ labels.append(GtkLabel(simple_text))
+
+ box = GtkHBox()
+ box.add(labels[-1])
+ labels[-1].show()
+ buttons[-1].add(box)
+ buttons[-1].show()
+ buttons[-1].connect("clicked", cp_text, text)
+
+ def mk_entry_with_label(self, box, labeltext, defaulttext=''):
+ label = GtkLabel (labeltext)
+ entry = GtkEntry (255)
+ entry.set_text (defaulttext)
+
+ box.pack_start (label, FALSE, FALSE, 5)
+ box.pack_start (entry)
+ return entry
+
+ def mkup_text(self, text):
+ if len(self.l.addresscards) >1:
+ return text
+ while 1:
+ class clause:
+ def __init__ (self, clause):
+ self.clause=clause
+ def key(self):
+ if string.find(self.clause, '=') > -1:
+ return self.clause[0+2:string.find(self.clause, '=')-2]
+ def param(self):
+ if string.find(self.clause, '=') > -1:
+ return utils.stripmarks(self.clause[string.find(self.clause, '=')+1:string.find(self.clause, ':')])
+ def value(self):
+ if string.find(self.clause, ':') > -1:
+ return utils.stripmarks(self.clause[string.find(self.clause, ':')+1:])
+ def check(self, letter, rc):
+ try:
+ err=FALSE
+ if not self.key():
+ err=TRUE
+ if not self.param():
+ err=TRUE
+ if not self.value():
+ err=TRUE
+ if utils.get_attr_by_name(letter, self.key(), rc)==None:
+ err=TRUE
+ if err:
+ raise error.MalformedClause, self.clause
+ except error.Malformed.Clause, clause:
+ print _("The clause '%s' is malformed. Aborting.") % clause
+ sys.exit()
+ while 1:
+ br_start = string.find(text, "[")
+ br_end = string.find(text, "]")
+ try:
+ if (br_start>-1 and not br_end > -1) or \
+ (br_end >-1 and not br_start >-1) or \
+ br_start > br_end:
+ raise error.MalformedClause, text
+ except error.MalformedClause, clause:
+ print _("The clause '%s' is malformed. Aborting.") % clause
+ sys.exit()
+
+ if br_start > -1:
+ cl = clause(text[br_start+1:br_end])
+ cl.check(self.l, self.rc)
+ if utils.get_attr_by_name(self.l, cl.key(), rc) == cl.param():
+ text = text[0:br_start] + cl.value() + text[br_end+1:]
+ else:
+ text = text[0:br_start] + text[br_end+1:]
+ else:
+ break
+
+ start = string.find(text, "__")
+ end = string.find(text, "__", start + 1)
+ if start == -1:
+ break
+
+ key = text[start+2:end]
+
+ text = string.replace(text, '__' + key + '__', \
+ utils.get_attr_by_name(self.l, key), rc)
+
+ return text
+
+ def set_adr(self, entry, string):
+
+ entry.freeze()
+ num=entry.get_length()
+ entry.backward_delete(num)
+ entry.insert_defaults(string)
+ entry.thaw()
+
+ for i in range(0, len(self.openingbuttons)):
+ if len(self.l.addresscards) <= 1:
+ text = (utils.general_mkup_text(\
+ self.l, self.rc.openingdefaults[i], self.rc))
+ else:
+ text = utils.simplify_txt(self.rc.openingdefaults[i])
+ self.openinglabels[i].set_text(text)
+ if len(self.l.addresscards) <= 1:
+ self.comboopening.set_popdown_strings(map(\
+ lambda x, l=self.l, rc=self.rc : \
+ utils.general_mkup_text(l, x, rc), \
+ self.rc.openingdefaults))
+ self.comboclosing.set_popdown_strings(map(\
+ lambda x, l=self.l, rc=self.rc : \
+ utils.general_mkup_text(l, x, rc), \
+ self.rc.closingdefaults))
+ else:
+ self.comboopening.set_popdown_strings(self.rc.openingdefaults)
+ self.comboclosing.set_popdown_strings(self.rc.closingdefaults)
+
+
+ def quit (self, event = None, data = None):
+ mk_letter.rm_latex_files(self.l)
+ mainquit ()
+
+ def mainloop (self):
+ mainloop ()
+
+ def create_file_selection(_button, self, entry, path=''):
+ win = GtkFileSelection(" " + _("Search Files") + " ")
+ if path and os.path.isdir(path):
+ win.set_filename(path)
+ def delete_event(win, event=None):
+ win.destroy()
+ return TRUE
+ def file_selection_ok(_button, fs=win, entry=entry):
+ entry.set_text(fs.get_filename())
+ fs.destroy()
+ win.connect("delete_event", delete_event)
+ win.ok_button.connect("clicked", file_selection_ok)
+ win.cancel_button.connect("clicked", win.destroy)
+ win.show()
+
+ def dir_GtkBox(self, dir, spacing = 10):
+ if dir == VERTICAL: return GtkVBox(homogeneous=FALSE, spacing=spacing)
+ if dir == HORIZONTAL: return GtkHBox(homogeneous=FALSE, spacing=spacing)
+
+ def get_splash_text(self):
+ str = _("Welcome to gtex-letter.") + "\n\n"
+ str = str + _("Follow me to make a LaTeX-letter.")
+ str = str + "\n\n\n\n"
+ str = str + _("This is version") + " " + GTEX_LETTER_VERSION + " " + _("of gtex-letter.") + "\n"
+ str = str + _("The") + " '" + self.rc.guilevel + "'" + _("-user-interface is being used.")
+ return str
+
+
+ def address_frame(self, direction = HORIZONTAL):
+ frame = GtkFrame (" " + _("Destination-Address") + " ")
+ box = self.dir_GtkBox (direction)
+ box.set_border_width(10)
+
+ self.textadr = GtkText ()
+ self.textadr.set_editable (TRUE)
+ self.textadr.set_usize(120, -1)
+
+ box2 = GtkVBox (spacing = 2)
+
+ swin = GtkScrolledWindow()
+ swin.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
+
+ swin.show()
+
+ self.textadr.show()
+ swin.add(self.textadr)
+ box2.add(swin)
+
+ box2.show()
+ box.add(box2)
+
+ if self.l.address:
+ self.set_adr(self.textadr, self.l.address)
+
+ def search_addressbook(_button, self, text=self.textadr, ):
+ ab = addressbook_vcard.addressbook(self.rc.addressbooks, \
+ self.rc.addressbook_column_widths, \
+ self.rc.addressbook_columns)
+ ab.read_file()
+ s = ab.show()
+ if s:
+ str = ''
+ self.l.addresscards = []
+ for name in s:
+ card = ab.get_card(name)
+ self.l.addresscards.append(card)
+ if str:
+ str = str + '\n'
+ str = str + utils.mk_adr(card, \
+ self.rc.addressformats, \
+ self.rc.mycountry)
+
+ self.l.address = str
+
+ self.set_adr(text, self.l.address)
+
+ box3 = GtkVBox()
+ box3 = GtkVBox (spacing = 20)
+
+ box1 = GtkHButtonBox()
+ button = GtkButton(_("Browse Addresses"))
+ button.connect("clicked", search_addressbook, self)
+ box1.pack_start (button)
+ box1.show()
+ box3.pack_start(box1)
+
+ label = GtkLabel(_("Divide multiple\naddresses by\nempty lines."))
+ label.show()
+ box3.add(label)
+
+ box.pack_start(box3)
+ box3.show()
+
+ frame.add (box)
+ return frame
+
+ def header_frame(self, direction = HORIZONTAL):
+ frame = GtkFrame (" " + _("Header-File") + " ")
+ box = self.dir_GtkBox (direction)
+ box.set_border_width(10)
+ label = GtkLabel (_("Filename:"))
+ box.pack_start (label, FALSE, FALSE, 5)
+
+ combo = GtkCombo()
+ combo.entry.set_max_length(100)
+ self.entryheader = combo.entry
+ combo.set_popdown_strings(self.rc.headerdefaults)
+ if self.l.header:
+ combo.entry.set_text(self.l.header)
+ combo.set_use_arrows_always(1)
+ combo.show()
+ box.pack_start(combo)
+
+ button = GtkButton(_("Search"))
+ button.connect("clicked", self.create_file_selection, self.entryheader, self.rc.filename_guess_path)
+ box.pack_start (button)
+
+ frame.add (box)
+ return frame
+
+ def filename_frame(self, direction = HORIZONTAL):
+ frame = GtkFrame (" " + _("LaTeX-File (this is where the letter is saved)") + " ")
+ box = self.dir_GtkBox (direction)
+ box.set_border_width(10)
+ self.entryfilename = self.mk_entry_with_label(box, _('Filename:'), \
+ self.l.filename)
+ button = GtkButton(_("Search"))
+ button.connect("clicked", self.create_file_selection, self.entryfilename, self.rc.filename_guess_path)
+ box.pack_start (button)
+
+ frame.add (box)
+ return frame
+
+ def opening_frame_combo (self, direction = HORIZONTAL):
+ frame = GtkFrame (" " + _("Opening") + " ")
+ box = self.dir_GtkBox (direction)
+ box.set_border_width(10)
+ label = GtkLabel (_("Opening:"))
+ box.pack_start (label, FALSE, FALSE, 5)
+
+ self.comboopening = GtkCombo()
+ self.comboopening.entry.set_max_length(100)
+ self.entryopening = self.comboopening.entry
+ if len(self.l.addresscards) <= 1:
+ self.comboopening.set_popdown_strings(map(\
+ lambda x, l=self.l, rc=self.rc : \
+ utils.general_mkup_text(l, x, rc), \
+ self.rc.openingdefaults))
+ else:
+ self.comboopening.set_popdown_strings(self.rc.openingdefaults)
+
+ if self.l.opening:
+ self.comboopening.entry.set_text(self.l.opening)
+ self.comboopening.set_use_arrows_always(1)
+ self.comboopening.show()
+ box.pack_start(self.comboopening)
+
+ frame.add (box)
+ return frame
+
+ def closing_frame_combo (self, direction = HORIZONTAL):
+ frame = GtkFrame (" " + _("Closing") + " ")
+ box = self.dir_GtkBox (direction, spacing = 1)
+ box.set_border_width(10)
+ label = GtkLabel (_("Closing:"))
+ box.pack_start (label, FALSE, FALSE, 5)
+
+ self.comboclosing = GtkCombo()
+ self.comboclosing.entry.set_max_length(100)
+ self.entryclosing = self.comboclosing.entry
+ if len(self.l.addresscards) <= 1:
+ self.comboclosing.set_popdown_strings(map(\
+ lambda x, l=self.l, rc=self.rc : \
+ utils.general_mkup_text(l, x, rc), \
+ self.rc.closingdefaults))
+ else:
+ self.comboclosing.set_popdown_strings(self.rc.closingdefaults)
+
+ if self.l.closing:
+ self.comboclosing.entry.set_text(self.l.closing)
+ self.comboclosing.set_use_arrows_always(1)
+ self.comboclosing.show()
+ box.pack_start(self.comboclosing)
+
+ frame.add (box)
+ return frame
+
+ def opening_frame_buttons (self, direction = HORIZONTAL ):
+ frame = GtkFrame (" " + _("Opening") + " ")
+ box1 = self.dir_GtkBox (direction)
+ boxV1 = GtkVButtonBox ()
+ boxV1.set_spacing(1)
+ boxV1.set_layout(BUTTONBOX_SPREAD)
+ boxV1.queue_resize()
+ boxV1.set_border_width (5)
+ boxV2 = GtkVBox ()
+ boxV2.set_border_width (5)
+ for button in self.openingbuttons:
+ boxV1.pack_start(button)
+
+ label = GtkLabel (_("Opening"))
+ label.set_justify (JUSTIFY_LEFT)
+ boxV2.pack_start(label)
+
+ if self.l.opening:
+ self.entryopening.set_text(self.l.opening)
+ else:
+ default=self.rc.openingdefaults[0]
+ self.entryopening.set_text (utils.general_mkup_text(\
+ self.l, default, self.rc))
+ boxV2.pack_start(self.entryopening)
+
+ box1.add (boxV1)
+ box1.add (boxV2)
+
+ frame.add (box1)
+ return frame
+
+ def closing_frame_buttons(self, direction = HORIZONTAL):
+ frame = GtkFrame (" " + _("Closing") + " ")
+ box1 = self.dir_GtkBox (direction)
+ boxV1 = GtkVButtonBox ()
+ boxV1.set_spacing(1)
+ boxV1.set_layout(BUTTONBOX_SPREAD)
+ boxV1.queue_resize()
+ boxV1.set_border_width (5)
+ boxV2 = GtkVBox ()
+ boxV2.set_border_width (5)
+
+ for button in self.closingbuttons:
+ boxV1.pack_start(button)
+
+ label = GtkLabel (_("Closing"))
+ label.set_justify (JUSTIFY_LEFT)
+ boxV2.pack_start(label)
+
+ if self.l.closing:
+ self.entryclosing.set_text(self.l.closing)
+ else:
+ default=self.rc.closingdefaults[0]
+ self.entryclosing.set_text (default)
+ boxV2.pack_start(self.entryclosing)
+
+ box1.add (boxV1)
+ box1.add (boxV2)
+
+ frame.add (box1)
+ return frame
+
+ def subject_frame(self, direction = HORIZONTAL):
+ frame = GtkFrame (" " + _("Subject") + " ")
+ box = self.dir_GtkBox (direction)
+ box.set_border_width (5)
+
+ self.entrysubject = self.mk_entry_with_label(box, _('Subject') + ':')
+ if self.l.subject:
+ self.entrysubject.set_text(self.l.subject)
+
+ frame.add(box)
+ return frame
+
+ def contents_frame(self, direction = VERTICAL):
+ def import_textfile(_button, self):
+ win = GtkFileSelection(" " + _("Import File") + " ")
+ def delete_event(win, event=None):
+ win.destroy()
+ return TRUE
+ win.connect("delete_event", delete_event)
+ def file_selection_ok(_button, fs=win, self=self):
+ filename = fs.get_filename()
+ if not os.path.isfile(filename):
+ print _("error: file does not exist")
+ else:
+ file = open(filename, "r")
+ text = file.read()
+ self.contentsfield.insert_defaults(text)
+ file.close()
+ fs.destroy()
+
+ win.ok_button.connect("clicked", file_selection_ok)
+ win.cancel_button.connect("clicked", win.destroy)
+ win.show()
+
+ def save_textfile(_button, self):
+ win = GtkFileSelection(" " + _("Export File") + " ")
+ def delete_event(win, event=None):
+ win.destroy()
+ return TRUE
+ win.connect("delete_event", delete_event)
+
+ def file_selection_ok(_button, fs=win, self=self):
+ try:
+ filename = fs.get_filename()
+ if os.path.isfile(filename):
+ raise error.FileExists, filename
+ except error.FileExists, file:
+ print "File '%s' exists. It will be overwritten." % file
+
+ file = open(filename, "w")
+ l = self.contentsfield.get_length ()
+ text = self.contentsfield.get_chars (0, l)
+ file.write(text)
+ file.close()
+ fs.destroy()
+
+ win.ok_button.connect("clicked", file_selection_ok)
+ win.cancel_button.connect("clicked", win.destroy)
+ win.show()
+
+ frame = GtkFrame (" " + _("Contents") + " ")
+ box = self.dir_GtkBox (direction)
+ box.set_border_width (5)
+
+ self.contentsfield = GtkText ()
+ self.contentsfield.set_editable (TRUE)
+ self.contentsfield.insert_defaults(self.l.contents)
+ box.pack_start (self.contentsfield)
+
+ if direction == HORIZONTAL:
+ box1 = GtkVButtonBox()
+ else:
+ box1 = GtkHButtonBox()
+
+ box1.set_usize(10, -1)
+ box1.set_layout(BUTTONBOX_SPREAD)
+ box1.queue_resize()
+
+ button = GtkButton(_("Import Textfile"))
+ button.connect("clicked", import_textfile, self)
+ box1.pack_start (button)
+ button = GtkButton(_("Save Contents"))
+ button.connect("clicked", save_textfile, self)
+ box1.pack_start (button)
+
+ box.pack_start(box1)
+ box1.show()
+
+ frame.add (box)
+ return frame
+
+ def latex_frame(self, page):
+ frame = GtkFrame (" " + _("LaTeX") + " ")
+ box = GtkHBox ()
+ box.set_usize(280, -1)
+
+ def mk_tex_xdvi(self, widget, event=None, data = None):
+ if widget.l.letter_written:
+ mk_letter.tex_latex(widget.l, widget.rc)
+ mk_letter.tex_xdvi(widget.l, widget.rc)
+ else:
+ print _("Error: No letter written so far. Can not show.")
+ def mk_tex_pdf(self, widget, event=None, data = None):
+ if widget.l.letter_written:
+ mk_letter.tex_latex(widget.l, widget.rc)
+ mk_letter.tex_pdf(widget.l, widget.rc)
+ else:
+ print _("error: no letter written so far. Can not convert.")
+ def mk_tex_print(self, widget, event=None, data = None):
+ if widget.l.letter_written:
+ mk_letter.tex_latex(widget.l, widget.rc)
+ mk_letter.tex_print(widget.l, widget.rc)
+ else:
+ print _("error: no letter written so far. Can not print.")
+ def mk_tex_postscript(self, widget, event=None, data = None):
+ if widget.l.letter_written:
+ mk_letter.tex_latex(widget.l, widget.rc)
+ mk_letter.tex_postscript(widget.l, widget.rc)
+ else:
+ print _("error: no letter written so far. Can not convert.")
+ def continue_editor(self, widget, event=None, data = None):
+ if widget.l.letter_written:
+ mk_letter.continue_editor(widget.l, widget.rc)
+ else:
+ print _("error: no letter written so far. Can not open file.")
+ bbox = GtkHButtonBox()
+
+ table = GtkTable(5, 5)
+ bbox.pack_start(table)
+ table.show()
+ bbox.show()
+ box.pack_start(bbox)
+
+ boxV = GtkVButtonBox()
+ boxV.show()
+ button = GtkButton(_("show letter"))
+ boxV.pack_start (button)
+ button.connect("clicked", mk_tex_xdvi, self)
+ table.attach(boxV, 1,2, 2,3, xoptions=FILL, yoptions=FILL, xpadding=5, ypadding=5)
+
+ boxV = GtkVButtonBox()
+ boxV.show()
+ button = GtkButton(_("save as\npostscript"))
+ boxV.pack_start (button)
+ button.connect("clicked", mk_tex_postscript, self)
+ table.attach(boxV, 2,3, 1,2, xoptions=FILL, yoptions=FILL, xpadding=5, ypadding=5)
+
+ boxV = GtkVButtonBox()
+ boxV.show()
+ button = GtkButton()
+
+ file = utils.get_path("print.xpm", self.rc.prg_dir)
+ try:
+ if file:
+ pix, mask = create_pixmap_from_xpm(page, None, file)
+ buttonpix = GtkPixmap(pix, mask)
+ buttonpix.show()
+ pixbox = GtkHBox()
+ pixbox.add(buttonpix)
+ button.add(pixbox)
+ pixbox.show()
+ else:
+ raise IOError, 'print.xpm'
+ except IOError, file:
+ print _("Could not find the file '%s'. Text substituted.") % file
+ label = GtkLabel(_("Print"))
+ label.show()
+ button.add(label)
+
+ boxV.pack_start (button)
+ button.connect("clicked", mk_tex_print, self)
+ table.attach(boxV, 2,3, 2,3, xoptions=FILL, yoptions=FILL, xpadding=5, ypadding=5)
+
+ boxV = GtkVButtonBox()
+ boxV.show()
+ button = GtkButton(_("save as\npdf"))
+ boxV.pack_start (button)
+ button.connect("clicked", mk_tex_pdf, self)
+ table.attach(boxV, 2,3, 3,4, xoptions=FILL, yoptions=FILL, xpadding=5, ypadding=5)
+
+ boxV = GtkVButtonBox()
+ boxV.show()
+ editorbutton = GtkButton(_("Continue\nwith editor"))
+ boxV.pack_start (editorbutton)
+ editorbutton.connect("clicked", continue_editor, self)
+ table.attach(boxV, 3,4, 2,3, xoptions=FILL, yoptions=FILL, xpadding=5, ypadding=5)
+
+ frame.add (box)
+ return frame
+
+ def get_letter (self, event = None, data = None):
+ l = self.textadr.get_length ()
+ self.l.address = self.textadr.get_chars (0, l)
+ self.l.address_slashes = utils.add_slashes (self.l.address)
+ self.l.opening = self.entryopening.get_chars (0, 256)
+ self.l.closing = self.entryclosing.get_chars (0, 256)
+ self.l.filename = self.entryfilename.get_chars (0, 256)
+ self.l.path = utils.get_path_from_file(self.l.filename)
+
+ self.l.header = self.entryheader.get_chars (0, 256)
+ save = self.l.header
+ try:
+ if self.l.header[-4:] <> '.tex':
+ self.l.header = self.l.header + '.tex'
+ self.l.header = utils.get_path(self.l.header, self.rc.prg_dir)
+ if self.l.header:
+ if not os.path.split(self.l.header)[0]: # if header is still local, we make it absolute
+ self.l.header = os.path.join(os.getcwd(), \
+ self.l.header)
+ else:
+ raise IOError, save
+ except IOError, file:
+ print "Submitted headerfile '%s' not found. No header used." % file
+ self.l.header = ''
+
+ self.l.subject = self.entrysubject.get_chars (0, 256)
+
+ l = self.contentsfield.get_length ()
+ self.l.contents = self.contentsfield.get_chars (0, l)
+
+ def write_letter(self):
+ self.l.letter_written = not mk_letter.write_file(self.l, self.rc)
+
+
+ def pageflip (self, event = None, data = None, write_letter=FALSE, guess_filename=TRUE):
+ self.get_letter()
+ if guess_filename and not self.l.filename and not self.entryfilename.get_chars (0, 256):
+ self.l.filename = utils.guess_filename(self.l, self.rc)
+ if self.l.filename:
+ self.entryfilename.set_text(self.l.filename)
+ if write_letter:
+ self.write_letter()
+
+ def end_druid (self, event = None, data = None):
+ mk_letter.rm_latex_files(self.l)
+ self.quit (event, data)
+
diff --git a/support/gtex-letter/install b/support/gtex-letter/install
new file mode 100644
index 0000000000..7e6cc4aa48
--- /dev/null
+++ b/support/gtex-letter/install
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# install script for gtex-letter
+# must be root to run
+
+PREFIX=/opt/gnome/bin/
+DIR=gtex-letter-prg
+PRG=gtex-letter
+RCFILE=.gtex-letterrc
+LC_PATH=/usr/share/locale/de/LC_MESSAGES
+DOC_PATH=/opt/gnome/doc/gtex-letter
+
+if [ -d $PREFIX$DIR ]
+then
+ echo "Directory $PREFIX$DIR exists, not created."
+else
+ mkdir $PREFIX$DIR
+ echo "Directory $PREFIX$DIR created."
+fi
+
+cp [a-z]* $PREFIX$DIR
+cp .[a-z]* $PREFIX$DIR
+echo "Programm-files copied to $PREFIX$DIR."
+
+cp translations/gtex-letter.de.mo $LC_PATH/gtex-letter.mo && echo "Translation-File copied."
+
+if [ -d $DOC_PATH ]
+then
+ echo "Directory $DOC_PATH exists, not created."
+else
+ mkdir $DOC_PATH
+ echo "Directory $DOC_PATH created."
+fi
+
+cp -r manual/html $DOC_PATH
+cp AUTHORS BUGS COPYING ChangeLog INSTALL README THANKS TODO $DOC_PATH
+echo "Documentation copied to $DOC_PATH."
+
+
+if [ -h $PREFIX$PRG ]
+then
+ echo "Link $PREFIX$PRG exists, not created."
+else
+ ln -s $PREFIX$DIR/$PRG $PREFIX$PRG
+ echo "Link $PREFIX$PRG created."
+fi
+
+
diff --git a/support/gtex-letter/letterheader.dinbrief.tex b/support/gtex-letter/letterheader.dinbrief.tex
new file mode 100644
index 0000000000..a0c7661a9c
--- /dev/null
+++ b/support/gtex-letter/letterheader.dinbrief.tex
@@ -0,0 +1,21 @@
+%% Einfacher Beispiel-Briefkopf des Paketes g-tex-letter
+%% Zur Verwendung mit der LaTeX-Dokument-Klasse 'dinbrief'
+
+\nowindowrules %% Keine Markierung des Addressfeldes durch Linien
+\windowtics %% Faltmarkierungen
+
+\place{Testhausen}
+
+\address{
+ \hfill
+ \parbox[t]{10cm}{\raggedleft Charles Mustermann \\
+ Moosweg 14 \\
+ D--11023 Testhausen \\
+ Telefon: (0049) (0)44 297 74 24 \\
+ Email: charly@testcenter.de
+ }
+ }
+
+\signature{Charly Mustermann}
+
+\endinput
diff --git a/support/gtex-letter/letterheader.g-brief.tex b/support/gtex-letter/letterheader.g-brief.tex
new file mode 100644
index 0000000000..b72c2148a9
--- /dev/null
+++ b/support/gtex-letter/letterheader.g-brief.tex
@@ -0,0 +1,43 @@
+%% Einfacher Beispiel-Briefkopf des Paketes g-tex-letter
+%% Zur Verwendung mit der LaTeX-Dokument-Klasse 'g-brief'
+
+\lochermarke
+\faltmarken
+\fenstermarken
+\trennlinien
+%%\klassisch
+
+\Name {Charles Mustermann}
+\Strasse {Moosweg 14}
+\Zusatz {}
+\RetourAdresse {}
+\Ort {D--11023 Testhausen}
+
+\Telefon {(0049) (0)44 297 74 24}
+%%\Telefax {}
+%%\Telex {}
+%%\HTTP {}
+\EMail {charly@testcenter.de}
+
+%%\Bank {}
+%%\BLZ {000.000.00}
+%%\Konto {000.000.000}
+
+\Unterschrift {Charly Mustermann}
+
+
+\endinput
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/support/gtex-letter/letterheader.spanish.tex b/support/gtex-letter/letterheader.spanish.tex
new file mode 100644
index 0000000000..eeb80986b5
--- /dev/null
+++ b/support/gtex-letter/letterheader.spanish.tex
@@ -0,0 +1,17 @@
+%% This is a simple example of a letter-header from
+%% the package g-tex-letter. It is to be used with
+%% the LaTeX-document-class 'letter'.
+
+\address{
+ \hfill
+ \parbox[t]{10cm}{\raggedleft Diego Restrepo \\
+ Edificio Institutos de Paterna \\
+ Apartado 2085 \\
+ 46071 Valencia \\
+ Email: diego@testcenter.es
+ }
+ }
+
+\signature{Diego Restrepo}
+
+\endinput
diff --git a/support/gtex-letter/letterheader.standard_latex.tex b/support/gtex-letter/letterheader.standard_latex.tex
new file mode 100644
index 0000000000..fb17949de3
--- /dev/null
+++ b/support/gtex-letter/letterheader.standard_latex.tex
@@ -0,0 +1,17 @@
+%% This is a simple example of a letter-header from
+%% the package g-tex-letter. It is to be used with
+%% the LaTeX-document-class 'letter'.
+
+\address{
+ \hfill
+ \parbox[t]{10cm}{\raggedleft Charles Mustermann \\
+ Moosweg 14 \\
+ D--11023 Testhausen \\
+ Telefon: (0049) (0)44 297 74 24 \\
+ Email: charly@testcenter.de
+ }
+ }
+
+\signature{Charly Mustermann}
+
+\endinput
diff --git a/support/gtex-letter/logo.xpm b/support/gtex-letter/logo.xpm
new file mode 100644
index 0000000000..38ba177f21
--- /dev/null
+++ b/support/gtex-letter/logo.xpm
@@ -0,0 +1,184 @@
+/* XPM */
+static char * logo_xpm[] = {
+"48 48 133 2",
+" c None",
+". c #CBBBAB",
+"+ c #CDC1B7",
+"@ c #BCB3AA",
+"# c #AA8E74",
+"$ c #AC9076",
+"% c #B39B85",
+"& c #D9CCC0",
+"* c #A89F98",
+"= c #A18264",
+"- c #907357",
+"; c #9A7B5D",
+"> c #C4B19F",
+", c #C6B4A2",
+"' c #C7B8AB",
+") c #A78A6E",
+"! c #96785B",
+"~ c #655F58",
+"{ c #B4B4B4",
+"] c #ABABAA",
+"^ c #B1A79E",
+"/ c #B0977E",
+"( c #C0AB97",
+"_ c #7A6149",
+": c #A08770",
+"< c #C0C0BF",
+"[ c #BBBBBB",
+"} c #B4A393",
+"| c #B5A08D",
+"1 c #937659",
+"2 c #896D53",
+"3 c #C4C4C4",
+"4 c #B8B8B7",
+"5 c #B2AEAB",
+"6 c #A6917D",
+"7 c #BAA795",
+"8 c #A48C74",
+"9 c #A1866C",
+"0 c #9F8266",
+"a c #8B7661",
+"b c #D4D4D3",
+"c c #B0B0AF",
+"d c #A8A8A7",
+"e c #B29E8B",
+"f c #9C836B",
+"g c #A38E7A",
+"h c #A4A4A3",
+"i c #989897",
+"j c #9B9B9B",
+"k c #9C8672",
+"l c #9E8974",
+"m c #A49282",
+"n c #6A6056",
+"o c #D8D8D7",
+"p c #8B8B8B",
+"q c #949493",
+"r c #BCAC9C",
+"s c #BDA995",
+"t c #9D8B7A",
+"u c #96897C",
+"v c #DCDCDB",
+"w c #888887",
+"x c #B6AAA0",
+"y c #B9A28C",
+"z c #947C65",
+"A c #46403B",
+"B c #E3E3E3",
+"C c #7C7C7C",
+"D c #848484",
+"E c #AB9B8B",
+"F c #AD9884",
+"G c #C9B7A7",
+"H c #8D8176",
+"I c #958473",
+"J c #AA937D",
+"K c #AA9682",
+"L c #484541",
+"M c #131313",
+"N c #8C7C6C",
+"O c #7C6B5B",
+"P c #7A6755",
+"Q c #9B7F65",
+"R c #7F7266",
+"S c #1D1D1D",
+"T c #242424",
+"U c #968C81",
+"V c #85725E",
+"W c #8B745F",
+"X c #95806C",
+"Y c #2B2B2B",
+"Z c #9D938A",
+"` c #74614F",
+" . c #5C564F",
+".. c #3B3B3B",
+"+. c #A3A29F",
+"@. c #D1C3B5",
+"#. c #B2987F",
+"$. c #735E4B",
+"%. c #847566",
+"&. c #4C4C4C",
+"*. c #545453",
+"=. c #846A52",
+"-. c #333333",
+";. c #5B5B5B",
+">. c #737373",
+",. c #9E9082",
+"'. c #CBCBCB",
+"). c #8B8279",
+"!. c #444444",
+"~. c #6D5844",
+"{. c #94877C",
+"]. c #CDC3B9",
+"^. c #66513D",
+"/. c #8E7964",
+"(. c #423F3C",
+"_. c #6B6B6B",
+":. c #B09F90",
+"<. c #84694F",
+"[. c #AEA194",
+"}. c #646464",
+"|. c #81674E",
+"1. c #AB9E91",
+"2. c #867E76",
+"3. c #D0D0CF",
+"4. c #867E78",
+"5. c #725B45",
+"6. c #31271D",
+"7. c #3A3129",
+"8. c #6A5541",
+"9. c #4A3B2C",
+"0. c #5C4937",
+"a. c #433528",
+"b. c #1B1510",
+" ",
+" ",
+" ",
+" ",
+" ",
+" . + @ @ @ ",
+" # $ % . & * ",
+" = - ; > , ' ",
+" % ) ! # # ; % ~ ",
+" { ] ^ % / ( = _ - : ",
+" < [ { { { ] } | | . # 1 2 1 ",
+" 3 3 [ [ 4 4 4 { { 5 6 6 7 . 8 9 9 0 a ",
+" b ] ] ] c { 4 4 { { { d 8 8 e ( 8 0 f 8 g ",
+" b h i j ] { { { { { 5 % 8 % 8 f k l l m n ",
+" o o ] p q j ] ] c { @ r | s 9 ! f l t u u ",
+" v v v { w w i h ] ] x r r ' y z 0 k t t u A ",
+" B B v v b C D q j h E F e ' G 8 6 8 g t t H ",
+" B B [ h D C C p i I a z e . f J K K 6 l I L M ",
+" b w C C C C w p N O P z , Q 9 8 F E m I R S T ",
+" h p w w w w w U V V 1 % ; W X 9 6 6 t I Y S T S ",
+" C h i q p p Z k f f s - ` a f k k k I .S T Y .. ",
+" { d +.+.+.E F K @.#.$.a f 8 6 k X %.T T Y ..&.*. ",
+" 4 4 { c E e } . s =.f 9 J K 6 t I A T Y -.&.;.>. ",
+" h < < E 8 J r . =.J 6 J K E ,.,. .T Y -.&.;.>.w p ",
+" c '.@ 8 k ) > 1 0 J F F m ,.,.).T Y -.!.;.>.w i h >. ",
+" j b } F 9 #.- ~.X 8 m K m 6 {.-.Y -.!.;.>.w i h ] 4 ",
+" ].s } s 0 ^.O /.f k l t u (.Y -.!.;.>.w q h { 4 [ j ",
+" , , G > 2 a X X z /.N X n Y -.!.;.>.D j ] { 4 < 3 3 ",
+" %.r G @.= X | K l z %.V O Y -.!.*._.w j d { [ 3 3 3 3 [ ",
+" X J > # P | } :.6 I a O Y -...*._.D j ] { < 3 '.'.'.3 '.h ",
+" <.# / <./ } } [.E 6 R Y -...*._.D q d { < 3 '.'.'.'.'.4 }. ",
+" <.# |.V E [.[.1.E 2.Y Y ..&.}.D i d 4 3 3 '.3.b b 3.w ",
+" 0 2 ^.k m E 1.1.4.T Y ..&.}.C i d { 3 '.b b o b w ",
+" |.1 ^.$.k 6 E Z *.Y -...&.}.C q d 4 3 '.o o v p ",
+" =.5.6.7.2.)._.Y Y ..!.&.}.C q d [ 3 3.o '.C ",
+" 8.~.9. -.!.....!.&.;._.D q d [ 3 b { }. ",
+" 9.0.9. T ;.*.;.;._.>.w j ] [ '.p ",
+" a.9. >.>.>.C w q h { +._. ",
+" b. _.p q i h +.>. ",
+" &. -.d j >.&. ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
diff --git a/support/gtex-letter/main.py b/support/gtex-letter/main.py
new file mode 100644
index 0000000000..87b754abcd
--- /dev/null
+++ b/support/gtex-letter/main.py
@@ -0,0 +1,282 @@
+#!/usr/bin/env python
+
+GTEX_LETTER_VERSION = '0.30'
+PRG_DIR="/opt/gnome/bin/gtex-letter-prg"
+RC_FILENAME='.gtex-letterrc'
+
+
+import sys
+import os.path
+import getopt
+import ConfigParser
+import string
+import gettext
+
+gettext.bindtextdomain('gtex-letter', '/usr/share/locale')
+gettext.textdomain('gtex-letter')
+_ = gettext.gettext
+
+def help():
+ print "usage: gtex-letter [OPTIONS] [file.tex]"
+ print " PIPE | gtex-letter [OPTIONS] [file.tex]"
+ print
+ print " -a --address str get address with given ID from GnomeCard-file "
+ print " as default address for the letter"
+ print " -s --subject str subject of the letter"
+ print " -o --opening str the letter's opening"
+ print " -f --file str get letter contents from file"
+ print " -c --closing str closing for the letter"
+ print
+ print " -r --rcfile str use a different rc-file (.gtex-letterrc)"
+ print " -e --header str headerfile of the letter"
+ print " --guessformat str the format of filename-guesses"
+ print " --guesspath str the path to prepend to guessed filenames"
+ print " --guilevel str choose the complexity of the gui used."
+ print " possible values are: beginner, normal"
+ print " and expert. While beginner-level is easy to"
+ print " understand, expert is very straight forward."
+ print " --nosplash no start-screen"
+ print
+ print " -n --nogui non-interactive letter production"
+ print " --noshow do not show the letter "
+ print " (only with -n/--nogui-option)"
+ print " --quitelatex hide latex output"
+ print
+ print " -p --print direct printing of the letter"
+ print " (only with -n/--nogui-option)"
+ print
+ print " -h --help print this file and exit"
+ print " -u --usage like help"
+ print " -v --version print version and exit"
+
+def version():
+ return "gtex-letter " + GTEX_LETTER_VERSION
+
+FALSE=0
+TRUE=-1
+
+rc_file = RC_FILENAME
+defaultaddresses = ''
+closing = ''
+contents= ''
+contentsfile = ''
+filename = ''
+header = ''
+opening = ''
+subject = ''
+guessformat = ''
+guesspath = ''
+quite_latex=None
+
+nogui = FALSE
+noshow = FALSE
+printit = FALSE
+guilevel = FALSE
+splash = TRUE
+
+opts, args = getopt.getopt(sys.argv[1:], 'a:c:e:f:hno:pr:s:uv', ['address=', 'closing=', 'file=', 'guessformat=', 'guesspath=', 'guilevel=', 'header=', 'help', 'nogui', 'noshow', 'nosplash', 'opening=', 'print', 'quitelatex', 'rcfile=', 'subject=', 'usage', 'version'])
+for opt in opts:
+ option = opt[0]
+ value = opt[1]
+ if option =='-a' or option =='--address':
+ defaultaddresses = value
+ elif option =='-c' or option =='--closing':
+ closing = value
+ elif option =='-f' or option =='--file':
+ contentsfile = value
+ if not os.path.isfile(contentsfile):
+ print _('Error: Provided file not found.')
+ sys.exit()
+ file = open(contentsfile, 'r')
+ contents= file.read()
+ file.close()
+ elif option =='--guilevel':
+ guilevel = value
+ elif option =='-e' or option =='--header':
+ header = value
+ elif option =='--guessformat':
+ guessformat = value
+ elif option =='--guesspath':
+ guesspath = value
+ elif option =='-h' or option =='--help':
+ help()
+ sys.exit()
+ elif option =='-n' or option =='--nogui':
+ nogui = TRUE
+ elif option =='--noshow':
+ noshow = TRUE
+ elif option =='--nosplash':
+ splash = FALSE
+ elif option =='-o' or option =='--opening':
+ opening = value
+ elif option =='-p' or option =='--print':
+ printit = TRUE
+ elif option =='--quitelatex':
+ quite_latex = TRUE
+ elif option =='-r' or option =='--rcfile':
+ rc_file = value
+ if not os.path.isfile(rc_file):
+ print _('Error: Provided rc-file not found.')
+ sys.exit()
+ elif option =='-s' or option =='--subject':
+ subject = value
+ elif option =='-u' or option =='--usage':
+ help()
+ sys.exit()
+ elif option =='-v' or option =='--version':
+ print version()
+ sys.exit()
+
+if (noshow or printit) and not nogui:
+ print _("Error: You may not set the noshow or the print option without setting nogui.")
+ sys.exit()
+
+
+
+
+# fetch the STDIN if it is set.
+if not sys.stdin.isatty(): # redirected from file or pipe
+ if not contents:
+ contents = sys.stdin.read()
+ elif contents and not defaultaddress:
+ defaultaddress = sys.stdin.read()[:-1] # remove CR-char
+ else:
+ print _("Error: I do not know what to do with STDIN (pipe). You set both, -f/--file and -a/--address, in the options, so there is no place to put the pipe.")
+ sys.exit()
+
+if args:
+ filename = args[0]
+
+
+
+
+
+
+
+sys.argv=[''] # i get an error from module gui, if there are options left in sys.argv
+
+import utils, addressbook_vcard, gui # if i put this before the opts-stuff,
+import mk_letter, config # the options are unknown...
+import error
+
+
+
+
+class gtex_letter:
+ def __init__ (self, rc, \
+ filename = '',\
+ addresskeys = '',\
+ closing = '',\
+ contents = '',\
+ header = '',\
+ opening = '',\
+ subject = ''):
+
+ self.init_address(addresskeys, rc)
+
+ self.init_header(header, rc)
+
+ self.subject = subject
+ self.opening = opening
+ self.contents = contents
+ self.closing = closing
+
+ self.filename = filename
+
+ if not self.filename:
+ file = utils.guess_filename(self, rc)
+ if file:
+ self.filename = file
+
+ self.path = utils.get_path_from_file(self.filename)
+ self.letter_written = FALSE
+
+
+ def init_address(self, addresskeys, rc):
+ self.address = ''
+
+ self.addresscards = []
+
+ if addresskeys:
+ list = []
+ while 1:
+ hit = string.find(addresskeys, ',')
+ if hit == -1:
+ list.append(string.strip(addresskeys))
+ addresskeys=''
+ break
+ list.append(string.strip(addresskeys[:hit]))
+ addresskeys = addresskeys[hit+1:]
+ ab = addressbook_vcard.addressbook(rc.addressbooks)
+ ab.read_file()
+ for name in list:
+ try:
+ card = ab.get_card(name)
+ if card:
+ self.addresscards.append(card)
+ else:
+ raise error.AddressCardNotFound, name
+ except error.AddressCardNotFound, cardname:
+ print _("The addresscard '%s' could not be found.") % cardname
+
+ for card in self.addresscards:
+ if self.address:
+ self.address = self.address + '\n'
+ self.address = self.address + utils.mk_adr(card, \
+ rc.addressformats, rc.mycountry)
+
+ if self.address:
+ self.address_slashes = utils.add_slashes(self.address)
+
+ if not self.address:
+ self.address_slashes = ''
+
+ def init_header(self, header, rc):
+ self.header = ''
+ if header:
+ self.header = header
+ else:
+ if rc.headerdefaults:
+ self.header = rc.headerdefaults[0]
+ try:
+ if self.header:
+ if self.header[-4:] <> '.tex':
+ self.header = self.header + '.tex'
+ self.header = utils.get_path(self.header, rc.prg_dir)
+ if self.header:
+ if not os.path.split(self.header)[0]: # if it is still local
+ self.header = os.path.join(os.getcwd(), \
+ self.header)
+ else:
+ raise IOError, header
+ except IOError, file:
+ print _("Submitted headerfile '%s' not found") % file
+
+
+
+def main ():
+ rc = config.gtex_letter_config(rc_file, nogui=nogui, \
+ noshow=noshow, splash=splash, \
+ printit=printit, guilevel=guilevel, \
+ guessformat=guessformat, guesspath=guesspath, quite_latex=quite_latex, prg_dir=PRG_DIR )
+
+ letter = gtex_letter(rc, filename, defaultaddresses, \
+ closing, contents, \
+ header, opening, subject)
+ if rc.nogui:
+ letter.letter_written = not mk_letter.write_file(letter, rc)
+ if not letter.letter_written:
+ print _("Aborting.")
+ sys.exit()
+ mk_letter.tex_latex(letter, rc)
+ if not rc.noshow:
+ mk_letter.tex_xdvi(letter, rc)
+ if printit:
+ mk_letter.tex_print(letter, rc)
+ mk_letter.rm_latex_files(letter)
+ else:
+ gp = gui.GUI (rc, letter)
+ gp.mainloop ()
+
+if __name__ == '__main__':
+ main ()
diff --git a/support/gtex-letter/manual/html/advanced-features.html b/support/gtex-letter/manual/html/advanced-features.html
new file mode 100644
index 0000000000..01b7d86a65
--- /dev/null
+++ b/support/gtex-letter/manual/html/advanced-features.html
@@ -0,0 +1,162 @@
+<HTML><HEAD><TITLE>Gtex-Letter User Manual</TITLE>
+
+<LINK REL="HOME" TITLE="Gtex-Letter User Manual" HREF="index.html">
+<LINK REL="PREVIOUS" TITLE="" HREF="rc-files.html">
+<LINK REL="NEXT" TITLE="" HREF="">
+
+</HEAD><BODY>
+
+<DIV CLASS="NAVHEADER">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR> <TH COLSPAN="3" ALIGN="center">Gtex-Letter User Manual</TH></TR>
+
+<TR><TD WIDTH="10%" ALIGN="left" VALIGN="bottom"><A HREF="rc-files.html">Prev</A></TD>
+
+ <TD WIDTH="80%" ALIGN="center" VALIGN="bottom"></TD>
+ <TD WIDTH="10%" ALIGN="right" VALIGN="bottom"><A HREF=""></A></TD>
+
+</TR></TABLE>
+
+<HR ALIGN="LEFT" WIDTH="100%"></DIV><DIV CLASS="CHAPTER"><H1><A NAME="advanced-featrues">The Advanced Features</A></H1>
+
+<DIV CLASS="TOC"><DL>
+
+<DT><B>Table of Contents</B></DT>
+<DT><A HREF="advanced-features.html#sex-adoption">Automatic Adoption to the Sex of the Addressee</A></DT>
+<DT><A HREF="advanced-features.html#filenames">Paths and Filenames</A></DT>
+<DT><A HREF="advanced-features.html#noninteractive">The Non-Interactive Mode</A></DT>
+
+</DL></DIV>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="sex-adoption">Automatic Adoption to the Sex of the Addressee</A></H1>
+
+<P>
+ One of the prime features of gtex-letter is its configurable adoption
+ to the sex of the addressee of you letter. This is helpful in most
+ languages. For example in German, where the ending of adjectives depends
+ on the person's sex the adjective is connected to.</P>
+
+<P>
+ Therefore you write <i class="EMPHASIS">"Sehr geehrte Frau Schneider"</i> and <i class="EMPHASIS">"Sehr geehrter Herr Schulze"</i>. Accordingly it is <i class="EMPHASIS">"Estimada Sra. Gonzalez"</i> and <i class="EMPHASIS">"Estimado Sr. Ortega"</i> in Spanish. Of course, you do not want to make this adoption yourself; especially not in serial letters.</P>
+
+<P>
+ Gtex-letter will take care of it automatically, if you configure it in a proper way and if you use the addressbook for the selection of an addressee. Use one of the language-specific <A HREF="rc-files.html#various-files">rc-files</A> for a start. However, you can easily enhance the setting.</P>
+
+<P>
+ There is a kind of pattern matching included in the programm. Such a clause looks like this:</P>
+
+<P><i class="EMPHASIS">"Sehr geehrte[__name_prefix__='Herr':'r'] __name_prefix__ __lastname__,"</i></P>
+
+<P>
+ The part in braces is optional. It reads: If the prefix is equal to 'Herr', add an 'r'. Therefore, if the person is a female ('Frau'), nothing is added. This depends on the entries in your addressbook. It adopts only if you select one of the addressbook entries. If you enter an address directly into the <A HREF="gui.html#address-page">addressfield</A>, you have to take care of the sec yourself.</P>
+
+<p>
+ Also more complex clauses are possible. This is the default Spanish one:</P>
+
+<P><i class="EMPHASIS">"Estimad[__name_prefix__='Sr.':'o'][__name_prefix__='D.':'o'][__name_prefix__='Sra.':'a']<br>[__name_prefix__='Sta.':'a'][__name_prefix__='Dña.':'a'] __name_prefix__ __lastname__,"</i></P>
+
+<P>
+ It takes care of the multiple forms of common prefixes.</P>
+
+
+</DIV>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="filenames">Paths and Filenames</A></H1>
+
+
+<p>
+ In the standard setup, gtex-letter will use your home directory as the stanard
+ save your letter. Using the
+ <a href="rc-files.html#filename_guess_path">filename-guess-path-option</a>,
+ you set a different default path. (XXX: So far this only works for filename
+ guessing. It is planned to update that behavior to manually choosen filenames
+ too.)</P>
+
+<p>
+ Most of the time it is annoying to choose a filename by yourself. With gtex-letter,
+ you can let the application choose one. If you think it does not fit, you
+ can set a different one. Gtex-letter will just guess a filename, therefore
+ this feature is called filename-guessing. It depends on the
+ <a href="rc-files.html#filename_guess_path">filename-guess-path-option</a> and
+ the <a href="rc-files.html#filename_guess_format">filename-guess-format-option</a>.
+ With the latter you can define the way gtex-letter guesses the filename.
+ Let me present a few useful formats to you:</P>
+
+<p><i class="EMPHASIS">__subject__-__date__.tex</i></p>
+
+<p>
+ This one will set filename equal to the subject and the date, connected by
+ a hyphen. The suffix of the files should always be tex. Please remember,
+ that empty spaces, colons and slashes will all be converted to underscores.</p>
+
+
+<p><i class="EMPHASIS">__id____date__.tex</i></p>
+
+<p>
+ Using this clause, you command gtex-letter to make a filename out of the addressbook-id and the date.</p>
+
+
+<p><i class="EMPHASIS">[__id__-][__subject__-]__date__.tex</i></p>
+
+<p>
+ This format uses optional clauses. If you did not choose an address from the
+ addressbook, the id and the hyphen will be omitted. The id would be omitted anyways
+ of course, but using the braces, you make clear to set the hyphen just in
+ case an id is set. The same holds for the subject. If it is empty, no subject and
+ no hyphen will be used.</p>
+
+</DIV>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="noninteractive">The Non-Interactive Mode</A></H1>
+
+<p>
+ Gtex-letter comes with a non-interactive mode, that can be called from the
+ console. Use the <i class="EMPHASIS">-n/--nogui-option</i> to call it. Of course
+ you have submit enough information to produce a successful letter. We will let
+ it up to you to find out what fancy things you can do with this feature.
+ Just a hint about its power:</p>
+
+
+<p><i class="EMPHASIS">gtex-letter --address ted_baker --opening 'Dear Mr. Baker' --closing 'Yours sincerely' --file ~/letters/we_have_moved --nogui --noshow --print</i></p>
+
+<p>
+ This will create a letter for Ted Baker, with supplied opening and closing.
+ The text of the letter will be taken from the file 'we_have_moved'. The letter
+ will be assembles non-interactively and will be sent to the printer directly,
+ without showing it first.</p>
+
+
+
+
+</DIV>
+
+<DIV CLASS="NAVFOOTER">
+
+<HR ALIGN="LEFT" WIDTH="100%">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top"><A HREF="rc-files.html">Prev</A></TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top"><A HREF="index.html">Home</A></TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top"><A HREF=""></A></TD>
+</TR>
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top">The Configuration Files</TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top">&nbsp;</TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top"></TD>
+</TR>
+
+</TABLE>
+</DIV>
+</BODY>
+</HTML>
diff --git a/support/gtex-letter/manual/html/advanced-guis.html b/support/gtex-letter/manual/html/advanced-guis.html
new file mode 100644
index 0000000000..dd9509152f
--- /dev/null
+++ b/support/gtex-letter/manual/html/advanced-guis.html
@@ -0,0 +1,94 @@
+<HTML><HEAD><TITLE>Gtex-Letter User Manual</TITLE>
+
+<LINK REL="HOME" TITLE="Gtex-Letter User Manual" HREF="index.html">
+<LINK REL="PREVIOUS" TITLE="" HREF="gui.html">
+<LINK REL="NEXT" TITLE="" HREF="rc-files.html">
+
+</HEAD><BODY>
+
+<DIV CLASS="NAVHEADER">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR> <TH COLSPAN="3" ALIGN="center">Gtex-Letter User Manual</TH></TR>
+
+<TR><TD WIDTH="10%" ALIGN="left" VALIGN="bottom"><A HREF="gui.html">Prev</A></TD>
+
+ <TD WIDTH="80%" ALIGN="center" VALIGN="bottom"></TD>
+ <TD WIDTH="10%" ALIGN="right" VALIGN="bottom"><A HREF="rc-files.html">Next</A></TD>
+
+</TR></TABLE>
+
+<HR ALIGN="LEFT" WIDTH="100%"></DIV><DIV CLASS="CHAPTER"><H1><A NAME="advanced-guis">The Advanced User Levels</A></H1>
+
+<DIV CLASS="TOC"><DL>
+
+<DT><B>Table of Contents</B></DT>
+<DT><A HREF="advanced-guis.html#intermediate">The Intermediate Userlevel</A></DT>
+<DT><A HREF="advanced-guis.html#expert">The Expert Userlevel</A></DT>
+
+</DL></DIV>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="intermediate">The Intermediate Userlevel</A></H1>
+
+<P>
+ Gtex-Letter comes with three userlevels. Out of box, it starts with the <A HREF="gui.html">novice</A> guilevel (Graphical User Interface Level). The novice is very strict in bringing only little information on the screen. This means more pages are necessary to make up a letter. Once you get used to how it works (a few runs should do). You can upgrade to the intermediate guilevel. You can give it a try by using the option 'guilevel' at <A HREF="XXX.html">startup</A>:</P>
+
+<P>
+ <i class="EMPHASIS">gtex-letter --guilevel intermediate</i></P>
+
+<p>
+ The difference is not that big. There are just more fields on one page. You will certainly get used to it. A subtle difference consists for the standard openings and closings. In the novice userlevel you select them via a drop down list. In the intermediate and <A HREF=advanced-guis.html#expert>expert</A> level a list of buttons is presented to you:
+
+
+<DIV CLASS="FIGURE">
+<P><B>Figure 7. Standard Openings with Buttons</B></P>
+<P><IMG SRC="images/advanced-opening.jpeg"></P>
+</DIV>
+
+<p>
+ Simply click the buttons and the text is copied to the textfield next to them.</P>
+
+</DIV>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="expert">The Expert Userlevel</A></H1>
+
+<P>
+ The expert user level presents you the whole letter generation process on one big page. Call this gui (Graphical User Interface) with:</P>
+
+<P>
+ <i class="EMPHASIS">gtex-letter --guilevel expert</i></P>
+
+<P>
+ Fill in the fields you know from the less advanced guilevels and click on the 'next'-button to get to the <A HREF=gui.html#makeup>makeup-page</A>.</P>
+
+</DIV>
+
+
+
+<DIV CLASS="NAVFOOTER">
+
+<HR ALIGN="LEFT" WIDTH="100%">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top"><A HREF="gui.html">Prev</A></TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top"><A HREF="index.html">Home</A></TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top"><A HREF="rc-files.html">Next</A></TD>
+</TR>
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top">Using Gtex-Letter</TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top">&nbsp;</TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top">The Configuration Files</TD>
+</TR>
+
+</TABLE>
+</DIV>
+</BODY>
+</HTML>
diff --git a/support/gtex-letter/manual/html/copyright.html b/support/gtex-letter/manual/html/copyright.html
new file mode 100644
index 0000000000..35eb16e757
--- /dev/null
+++ b/support/gtex-letter/manual/html/copyright.html
@@ -0,0 +1,95 @@
+<HTML
+><HEAD
+>
+<LINK REL="PREVIOUS" TITLE="Introduction" HREF="index.html">
+
+<LINK REL="HOME" TITLE="Gtex-Letter User Manual" HREF="index.html">
+
+<LINK REL="NEXT" TITLE="Using Gtex-Letter (The User Interface)" HREF="gui.html">
+
+</HEAD
+><BODY
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>Gtex-Letter User Manual</TH
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="LEGALNOTICE"
+><P
+></P
+>
+</DIV>
+<DIV CLASS="SECT1"><H1 CLASS="SECT1">Copyright</H1>
+
+
+<P
+>This documentation is free software; you can redistribute
+ it and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.</P
+><P
+>This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.</P
+><P
+>You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307 USA</P
+><P
+>For more details see the file COPYING in the source
+ distribution of GNOME.</P
+><P
+></P
+></DIV
+>
+
+<DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>&nbsp;</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
diff --git a/support/gtex-letter/manual/html/gui.html b/support/gtex-letter/manual/html/gui.html
new file mode 100644
index 0000000000..01fde718e4
--- /dev/null
+++ b/support/gtex-letter/manual/html/gui.html
@@ -0,0 +1,158 @@
+<HTML><HEAD><TITLE>Gtex-Letter User Manual</TITLE>
+
+<LINK REL="HOME" TITLE="Gtex-Letter User Manual" HREF="index.html">
+<LINK REL="PREVIOUS" TITLE="" HREF="copyright.html">
+<LINK REL="NEXT" TITLE="" HREF="advanced-guis.html">
+
+</HEAD><BODY>
+
+<DIV CLASS="NAVHEADER">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR> <TH COLSPAN="3" ALIGN="center">Gtex-Letter User Manual</TH></TR>
+
+<TR><TD WIDTH="10%" ALIGN="left" VALIGN="bottom"><A HREF="copyright.html">Prev</A></TD>
+
+ <TD WIDTH="80%" ALIGN="center" VALIGN="bottom"></TD>
+ <TD WIDTH="10%" ALIGN="right" VALIGN="bottom"><A HREF="advanced-guis.html">Next</A></TD>
+
+</TR></TABLE>
+
+<HR ALIGN="LEFT" WIDTH="100%"></DIV><DIV CLASS="CHAPTER"><H1><A NAME="gui">Using Gtex-Letter (The User Interface)</A></H1>
+
+<DIV CLASS="TOC"><DL>
+
+<DT><B>Table of Contents</B></DT>
+<DT><A HREF="gui.html#address-page">The Address Page</A></DT>
+<DT><A HREF="gui.html#opening-page">The Opening Page</A></DT>
+<DT><A HREF="gui.html#contents-page">The Contents Page</A></DT>
+<DT><A HREF="gui.html#filename-page">The Filename Page</A></DT>
+<DT><A HREF="gui.html#makeup-page">The Makeup Page</A></DT>
+
+</DL></DIV>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="address-page">The Address Page</A></H1>
+
+<P>
+ When you first start gtex-letter, the programms opens with a welcome screen. Clicking the 'Next'-button, you get to the address-page:</P>
+
+<DIV CLASS="FIGURE">
+<P><B>Figure 2. The address page</B></P>
+<P><IMG SRC="images/address.jpeg"></P>
+</DIV>
+
+<P>
+ You can enter the address in the textfield on the left. Divide multiple addresses with an empty line to make a serial letter. (There is <A HREF="XXX.html">more info</A> available on that). You can browse your gnome-card addressbook by clicking on the button 'Browse Addresses'. </P>
+
+<P>
+ The addressbook-dialog will only show the people that have either a postal address or a phone number. Email-only contacts will be hidden. Doubleclick to select an address and close the dialog. Otherwise click the 'okay'-button. Multiple addresses can be selected to make a serial letter. You can click on the head of every column to sort the list.</P>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="opening-page">The Opening Page</A></H1>
+
+<P>
+ By clicking the 'Next'-Button on the <A HREF="gui.html#address-page">address page</A> you access the opening page:</P>
+
+<DIV CLASS="FIGURE">
+<P><B>Figure 3. The opening page</B></P>
+<P><IMG SRC="images/opening.jpeg"></P>
+</DIV>
+
+<P>
+ Here, you can set a subject for the letter. Notice, that this subject is optional. Then, a list of values provides you with standard-openings. If you have choosen an address from the address browser on the previous page, the standard-openings are adopted to the address choosen. However, this does not apply to serial letters, where a special format of the opening is displayed. (There is <A HREF="XXX.html">more info</A> on this). You do not need to choose one of the standard openings. You can enter one by yourself. Please note, that entering an address by hand will not update the opening-buttons. Only selecting one from the addressbook will.
+
+
+
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="contents-page">The Contents Page</A></H1>
+
+<DIV CLASS="FIGURE">
+<P><B>Figure 4. The contents page</B></P>
+<P><IMG SRC="images/contents.jpeg"></P>
+</DIV>
+
+<P>
+ Enter your letter in the top textfield.</P>
+
+<P>
+ You can import an already written text by clicking the 'Import Textfile'-Button. If you want to save your contents for further use, click the 'Save Contents'. (Note that Gtex-letter saves your letter in the LaTeX-format. For future import of the text, it is easier to save it here.)</P>
+
+<P>
+ Choose an appropriate closing for your letter in the 'closing'-textfield. You do not have to choose one from the list. It is possible to enter your own closing.</P>
+
+
+
+
+
+
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="filename-page">The Filename Page</A></H1>
+
+<DIV CLASS="FIGURE">
+<P><B>Figure 5. The filename page</B></P>
+<P><IMG SRC="images/filename.jpeg"></P>
+</DIV>
+
+<P>
+ On this page you can choose a header for your letter and set a filename.</P>
+
+<P>
+ There is a list of predefined headers available. You can look for another header using the 'search'-button, that opens a file browser.
+ </P>
+
+<P>
+ Gtex-letter will try and guess an appropriate filename for your letter. You can stick with that one or enter a different one. Click on the 'search'-button to open a file browser.</P>
+
+
+
+
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="makeup-page">The Makeup Page</A></H1>
+
+<DIV CLASS="FIGURE">
+<P><B>Figure 6. The Makeup page</B></P>
+<P><IMG SRC="images/makeup.jpeg"></P>
+</DIV>
+
+<P>
+ This page lets you preview, print and export your letter.</P>
+
+<P>
+ Click 'show letter' to get a preview. If you like the preview, you can print it by clicking on the printer icon. If you want to print it later, save it as a postscript. You can export the letter in the widely used Acrobat Format by clicking on 'save as pdf'.</P>
+
+<P>
+ At this point, gtex-letter has already saved your letter. The letter is saved in the the LaTeX-format. If you are used to LaTeX, you can edit the raw file using the button called 'continue with editor'.</P>
+
+<P>
+ The next and final screen of the programm is just a goodbye screen.
+
+
+</DIV>
+
+
+</DIV>
+
+
+
+<DIV CLASS="NAVFOOTER">
+
+<HR ALIGN="LEFT" WIDTH="100%">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top"><A HREF="copyright.html">Prev</A></TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top"><A HREF="index.html">Home</A></TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top"><A HREF="advanced-guis.html">Next</A></TD>
+</TR>
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top">Copyright</TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top">&nbsp;</TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top">Advanced User-Levels</TD>
+</TR>
+
+</TABLE>
+</DIV>
+</BODY>
+</HTML>
diff --git a/support/gtex-letter/manual/html/ideen b/support/gtex-letter/manual/html/ideen
new file mode 100644
index 0000000000..078fce0b41
--- /dev/null
+++ b/support/gtex-letter/manual/html/ideen
@@ -0,0 +1,30 @@
+About
+
+Introduction
+Features
+Dependencies
+
+Quick-Start
+ the address frame
+
+The guis:
+ novice
+ intermediate
+ expert
+
+the rc-files
+the rc-options
+advanced features
+ sex-adoption
+ default directory
+ filename-guesses/path
+ different addressformats
+ different letterformats
+ letter headers
+
+office automation
+ noninteractive mode
+
+
+
+
diff --git a/support/gtex-letter/manual/html/images/address.jpeg b/support/gtex-letter/manual/html/images/address.jpeg
new file mode 100644
index 0000000000..fd8b348723
--- /dev/null
+++ b/support/gtex-letter/manual/html/images/address.jpeg
Binary files differ
diff --git a/support/gtex-letter/manual/html/images/advanced-opening.jpeg b/support/gtex-letter/manual/html/images/advanced-opening.jpeg
new file mode 100644
index 0000000000..bc6ce63541
--- /dev/null
+++ b/support/gtex-letter/manual/html/images/advanced-opening.jpeg
Binary files differ
diff --git a/support/gtex-letter/manual/html/images/contents.jpeg b/support/gtex-letter/manual/html/images/contents.jpeg
new file mode 100644
index 0000000000..79ec93c27c
--- /dev/null
+++ b/support/gtex-letter/manual/html/images/contents.jpeg
Binary files differ
diff --git a/support/gtex-letter/manual/html/images/filename.jpeg b/support/gtex-letter/manual/html/images/filename.jpeg
new file mode 100644
index 0000000000..af7e621cb6
--- /dev/null
+++ b/support/gtex-letter/manual/html/images/filename.jpeg
Binary files differ
diff --git a/support/gtex-letter/manual/html/images/makeup.jpeg b/support/gtex-letter/manual/html/images/makeup.jpeg
new file mode 100644
index 0000000000..9cedc19916
--- /dev/null
+++ b/support/gtex-letter/manual/html/images/makeup.jpeg
Binary files differ
diff --git a/support/gtex-letter/manual/html/images/opening.jpeg b/support/gtex-letter/manual/html/images/opening.jpeg
new file mode 100644
index 0000000000..e2c4480a61
--- /dev/null
+++ b/support/gtex-letter/manual/html/images/opening.jpeg
Binary files differ
diff --git a/support/gtex-letter/manual/html/images/sample-letter.jpeg b/support/gtex-letter/manual/html/images/sample-letter.jpeg
new file mode 100644
index 0000000000..371363ada4
--- /dev/null
+++ b/support/gtex-letter/manual/html/images/sample-letter.jpeg
Binary files differ
diff --git a/support/gtex-letter/manual/html/index.html b/support/gtex-letter/manual/html/index.html
new file mode 100644
index 0000000000..c3c55c623b
--- /dev/null
+++ b/support/gtex-letter/manual/html/index.html
@@ -0,0 +1,200 @@
+<HTML><HEAD><TITLE>Gtex-Letter User Manual</TITLE>
+
+<LINK REL="HOME" TITLE="Gtex-Letter User Manual" HREF="index.html">
+<LINK REL="PREVIOUS" TITLE="Introduction" HREF="index.html">
+<LINK REL="NEXT" TITLE="Copyright" HREF="copyright.html">
+
+</HEAD><BODY>
+
+<DIV CLASS="NAVHEADER">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR> <TH COLSPAN="3" ALIGN="center">Gtex-Letter User Manual</TH></TR>
+
+<TR><TD WIDTH="10%" ALIGN="left" VALIGN="bottom"><A HREF="index.html">Prev</A></TD>
+
+ <TD WIDTH="80%" ALIGN="center" VALIGN="bottom"></TD>
+ <TD WIDTH="10%" ALIGN="right" VALIGN="bottom"><A HREF="copyright.html">Next</A></TD>
+
+</TR></TABLE>
+
+<HR ALIGN="LEFT" WIDTH="100%"></DIV><DIV CLASS="CHAPTER"><H1><A NAME="Introduction">Introduction</A></H1>
+
+<DIV CLASS="TOC"><DL>
+
+<DT><B>Table of Contents</B></DT>
+<DT><A HREF="introduction.html#introduction">Introduction</A></DT>
+<DT><A HREF="introduction.html#dependencies">Dependencies</A></DT>
+
+<DT><A HREF="copyright.html">Copyright</A></DT>
+
+<DT><A HREF="gui.html">Using Gtex-Letter (The User Interface)</A></DT></DL></DD>
+<DD><DL><DT><A HREF="gui.html#address-page">The Address Page</A></DT></DL></DD>
+<DD><DL><DT><A HREF="gui.html#opening-page">The Opening Page</A></DT></DL></DD>
+<DD><DL><DT><A HREF="gui.html#contents-page">The Contents Page</A></DT></DL></DD>
+<DD><DL><DT><A HREF="gui.html#filename-page">The Filename Page</A></DT></DL></DD>
+<DD><DL><DT><A HREF="gui.html#makeup-page">The Makeup Page</A></DT></DL></DD>
+
+<DT><A HREF="advanced-guis.html">The Advanced User-Levels</A></DT>
+<DD><DL><DT><A HREF="advanced-guis.html#intermediate">The Intermediate Userlevel</A></DT></DL></DD>
+<DD><DL><DT><A HREF="advanced-guis.html#expert">The Expert Userlevel</A></DT></DL></DD>
+
+
+<DT><A HREF="rc-files.html">The Configuration File(s)</A></DT>
+
+<DD><DL><DT><A HREF="rc-files.html#various-files">The Different Files</A></DT></DL></DD>
+
+<DT><A HREF="rc-files.html#options">The Options</A></DT>
+
+
+<DD><DL><DT><A HREF="rc-files.html#addressbook">Addressbook</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#mydvips">Mydvips</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#mydvipdf">Mydvipdf</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#mylatex">Mylatex</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#myeditor">Myeditor</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#myprintcommand">Myprintcommand</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#myxdvi">Myxdvi</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#dateformat">Dateformat</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#advertise">Advertise</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#quite_latex">Quite_latex</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#filename_guess_format">Filename_guess_format</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#filename_guess_path">Filename_guess_path</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#mycountry">Mycountry</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#guilevel">Guilevel</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#opening_defaults">Opening_defaults</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#closing_defaults">Closing_defaults</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#addressbook_columns">Addressbook_columns</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#addressbook_column_widths">Addressbook_column_widths</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#header_defaults">Header_defaults</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#lettertype">Lettertype</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#addressformat">Addressformat</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#texcommands">Texcommands</A></DT></DL></DD>
+
+<DT><A HREF="rc-files.html#variable">The gtex-letter variables</A></DT>
+<DD><DL><DT><A HREF="rc-files.html#address-variables">Address-variables</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#letter-based-variables">Letter-based variables</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#other-variables">Other variables</A></DT></DL></DD>
+
+<DT><A HREF="advanced-features.html">Advanced Features</A></DT>
+<DD><DL><DT><A HREF="advanced-features.html#sex-adoption">Automatic Adoption to the Sex of the Addressee</A></DT></DL></DD>
+<DD><DL><DT><A HREF="advanced-features.html#filenames">Paths and Filenames</A></DT></DL></DD>
+<DD><DL><DT><A HREF="advanced-features.html#noninteractive">The Non-Interactive Mode</A></DT></DL></DD>
+
+
+</DL></DIV>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="introduction">Introduction</A></H1>
+
+<P>
+ Gtex-Letter is a programm that helps you writing letters. It features include:
+
+The application can swallow text you pipe into it, being it the address or the text of the letter.
+
+
+
+
+</p><p></p>
+<p><ul>
+
+ <li><p>
+ Configuration of <i class="EMPHASIS">standard openings</i> and default closings.
+ </p></li>
+
+ <li><p>
+ Multiple predefined <i class="EMPHASIS">letter headers</i> can be accessed from within the application.
+ </p></li>
+
+ <li><p>
+ Support for <i class="EMPHASIS">serial letters</i> are.
+ </p></li>
+
+ <li><p>
+ Different user levels according to your skills.
+ </p></li>
+
+ <li><p>
+ Gtex-Letter connects to the <i class="EMPHASIS">gnome-address-book</i> from the gnome-pim package.
+ </p></li>
+
+ <li><p>
+ The openings can be configured to adopt to the sex of the addressee automatically. (This is very useful for most non-English languages).
+ </p></li>
+
+ <li><p>
+ The <i class="EMPHASIS">non-interactive mode</i> allows you produce standard-letters in an extremely efficient way.
+ </p></li>
+
+ <li><p>
+ The application can swallow text you <i class="EMPHASIS">pipe</i> into it, being it the address or the text of the letter.
+ </p></li>
+
+</ul>
+
+<DIV CLASS="FIGURE">
+<P><B>Figure 1. Beginning of a sample letter</B></P>
+<P><IMG SRC="images/sample-letter.jpeg"></P>
+</DIV>
+
+</DIV>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="dependencies">Dependencies</A></H1>
+
+
+<P>
+ Gtex-Letter depends on the following packages:
+</p><p></p>
+<p><ul>
+ <li><p>
+ <i class="EMPHASIS">Gnome</i>. Version 1.2 and above.
+ </p></li>
+
+ <li><p>
+ <i class="EMPHASIS">Python</i>. Version 1.5.2 and above.
+ </p></li>
+
+ <li><p>
+ <i class="EMPHASIS">LaTeX</i>. Any standard Distribution.
+ </p></li>
+
+ <li><p>
+ <i class="EMPHASIS">Python-Gnome</i>. Version 1.0.53 and above.
+ </p></li>
+
+ <li><p>
+ <i class="EMPHASIS">ImageMagick</i>. Any Version should do. ImageMagick is installed on most standard Linux systems except Debian ones. This dependency is due to gtk/gdk (that comes with Gnome).
+ </p></li>
+
+
+</ul>
+
+
+</DIV>
+
+
+</DIV>
+
+
+
+<DIV CLASS="NAVFOOTER">
+
+<HR ALIGN="LEFT" WIDTH="100%">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top"><A HREF="index.html">Prev</A></TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top"><A HREF="index.html">Home</A></TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top"><A HREF="copyright.html">Next</A></TD>
+</TR>
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top">Index</TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top">&nbsp;</TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top">Copyright</TD>
+</TR>
+
+</TABLE>
+</DIV>
+</BODY>
+</HTML>
diff --git a/support/gtex-letter/manual/html/rc-files.html b/support/gtex-letter/manual/html/rc-files.html
new file mode 100644
index 0000000000..f6d24aff09
--- /dev/null
+++ b/support/gtex-letter/manual/html/rc-files.html
@@ -0,0 +1,610 @@
+<HTML><HEAD><TITLE>Gtex-Letter User Manual</TITLE>
+
+<LINK REL="HOME" TITLE="Gtex-Letter User Manual" HREF="index.html">
+<LINK REL="PREVIOUS" TITLE="" HREF="advanced-guis.html">
+<LINK REL="NEXT" TITLE="" HREF="advanced-features.html">
+
+</HEAD><BODY>
+
+<DIV CLASS="NAVHEADER">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR> <TH COLSPAN="3" ALIGN="center">Gtex-Letter User Manual</TH></TR>
+
+<TR><TD WIDTH="10%" ALIGN="left" VALIGN="bottom"><A HREF="advanced-guis.html">Prev</A></TD>
+
+ <TD WIDTH="80%" ALIGN="center" VALIGN="bottom"></TD>
+ <TD WIDTH="10%" ALIGN="right" VALIGN="bottom"><A HREF="advanced-features.html">Next</A></TD>
+
+</TR></TABLE>
+
+<HR ALIGN="LEFT" WIDTH="100%"></DIV><DIV CLASS="CHAPTER"><H1><A NAME="rc-files">The Configuration File(s)</A></H1>
+
+<DIV CLASS="TOC"><DL>
+
+<DT><B>Table of Contents</B></DT>
+<DT><A HREF="rc-files.html#various-files">The Different Files</A></DT>
+<DT><A HREF="rc-files.html#options">The Options</A></DT>
+
+<DD><DL><DT><A HREF="rc-files.html#addressbook">Addressbook</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#mydvips">Mydvips</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#mydvipdf">Mydvipdf</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#mylatex">Mylatex</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#myeditor">Myeditor</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#myprintcommand">Myprintcommand</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#myxdvi">Myxdvi</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#dateformat">Dateformat</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#advertise">Advertise</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#quite_latex">Quite_latex</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#filename_guess_format">Filename_guess_format</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#filename_guess_path">Filename_guess_path</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#mycountry">Mycountry</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#guilevel">Guilevel</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#opening_defaults">Opening_defaults</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#closing_defaults">Closing_defaults</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#addressbook_columns">Addressbook_columns</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#addressbook_column_widths">Addressbook_column_widths</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#header_defaults">Header_defaults</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#lettertype">Lettertype</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#addressformat">Addressformat</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#texcommands">Texcommands</A></DT></DL></DD>
+
+<DT><A HREF="rc-files.html#variable">The gtex-letter variables</A></DT>
+<DD><DL><DT><A HREF="rc-files.html#address-variables">Address-variables</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#letter-based-variables">Letter-based variables</A></DT></DL></DD>
+<DD><DL><DT><A HREF="rc-files.html#other-variables">Other variables</A></DT></DL></DD>
+
+</DL></DIV>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="various-files">The Different Files</A></H1>
+
+<P>
+ Gtex-Letter looks for a configuration file called <i class="EMPHASIS">.gtex-letterrc</i> when started. This file may reside in the current directory, in your home directory or in the place, where the application is installed. This is also the order of places where gtex-letter will look for the file.</P>
+
+<P>
+ The gtex-letter package comes with a set of different config files containing different variants configuration variants. Mainly these files cover different languages. So if the your language of choice is Spanish, then you should run gtex-letter with the Spanish config files called <i class="EMPHASIS">.gtex-letterrc.spanish</i>. This can be done accomplished with this call:</P>
+
+<P><i class="EMPHASIS">gtex-letter --rcfile .gtex-letterrc.spanish</i></P>
+
+<P>
+ The make the Spanish config file the standard one for the time being, copy it to your home directory under the name <i class="EMPHASIS">.gtex-letterrc</i>. Gtex-Letter will look for that file when started. You can do it with your filemanager or using the following call:
+ </P>
+
+<P><i class="EMPHASIS">cp /opt/gnome/bin/gtex-letter-prg/.gtex-letterrc.spanish ~</i></P>
+
+<P>
+ (This will work only if you used the standard directory for the install. If you changed it, then you have to change the path in the above command too, of course.)
+ </P>
+
+
+</DIV>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="options">The Options</A></H1>
+
+<P>
+ But now for the internals of the config file. This section will describe the different options, one by one.
+ </P>
+
+</DIV>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="addressbook">Addressbook</A></H2>
+
+<P>
+ This is the location of your gnome-card-addressbook.
+ You can define multiple addressbooks. Seperate them
+ with a semicolon (;). The default is: </P>
+
+<P><i class="EMPHASIS">addressbook='~/.gnome/GnomeCard.gcrd'</i></P>
+
+
+<P>&nbsp;</P>
+
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="mydvips">Mydvips</A></H2>
+
+<P>
+ The programm call to produce the ps-file out of the dvi-file.
+ Ps means postscript and dvi device independent. If you do not
+ know what this is all about, leave it the way it is. These
+ are LaTeX specific programms gtex-letter depends upon.</P>
+
+<P><i class="EMPHASIS">mydvips='dvips __short_filename__'</i></P>
+
+<P>
+ __short_filename__ describes the filename without the suffix.
+ The other possible variable is __filename__, meaning the
+ normal filename. (Actually all the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>
+ are supported, but most do not make sense.)</P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="mydvipdf">Mydvipdf</A></H2>
+
+<P>
+ The programm call to produce the
+ pdf-file from the dvi-file. Pdf is the popular Adobe Acrobat
+ format and dvi means device independent. If you do not
+ know what this is all about, leave it the way it is.
+ Default is:</P>
+
+<P><i class="EMPHASIS">mydvipdf='dvipdf __short_filename__'</i></P>
+
+<P>
+ __short_filename__ describes the filename without the suffix.
+ The other possible variable is __filename__, meaning the
+ normal filename. (Actually all the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>
+ are supported, but most do not make sense.)</P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="mylatex">Mylatex</A></H2>
+
+<P>
+ The LaTeX call to produce the dvi-file. Dvi stands for device
+ independent. You do not need to know, how gtex-letter makes use
+ of this stuff. It is best to leave it the way it is.
+
+<P><i class="EMPHASIS">Default is 'latex __short_filename__'</i></P>
+
+<P>
+ __short_filename__ describes the filename without the suffix.
+ The other possible variable is __filename__, meaning the
+ normal filename. (Actually all the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>
+ are supported, but most do not make sense.)</P>
+
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="myeditor">Myeditor</A></H2>
+
+<P>
+ The command to bring up the editor, that lets you proceed with
+ your letter manually.</P>
+
+<P><i class="EMPHASIS">myeditor='xterm -e vi __filename__'</i></P>
+
+<P>
+ This call opens a shell and vi therein with the current file.
+ __filename__ means the filename choosen by you or the programm.
+ (Actually all the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>
+ are supported, but most do not make sense.) If you are not
+ used to vi, a classical Unix editor, you should replace it
+ with you favorite editor. If your editor has a graphical
+ version, you do not have to call it via an xterm. I use:</P>
+
+<P><i class="EMPHASIS">myeditor='gvim __filename__'</i></P>
+
+<P>
+ Gvim (for Gtx-Vim) is vi on steroids. The best editor ever, hehe!</P>
+
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="myprintcommand">Myprintcommand</A></H2>
+
+<P>
+ The command used to print the file.
+
+<P><i class="EMPHASIS">myprintcommand=''lpr __short_filename__.ps'</i></P>
+
+<P>
+ __short_filename describes the filename without
+ the suffix. The other possible variable is
+ __filename__, meaning the normal filename. (Actually all the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>
+ are supported, but most do not make sense.) If you change
+ anything in this call, make sure the right file is being
+ printed (usually the postscript one).</P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="myxdvi">Myxdvi</A></H2>
+
+<P>
+ The command to call the dvi-viewer. Dvi means device independent.
+ This is the preview version. Default is:</P>
+
+<P><i class="EMPHASIS">myxdvi='xdvi __short_filename__'</i></P>
+
+<P>
+ __short_filename describes the filename without the suffix.
+ The other possible variable is __filename__,
+ meaning the normal filename. (Actually all the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>
+ are supported, but most do not make sense.)</P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="dateformat">Dateformat</A></H2>
+
+<P>
+ You can use this option to include a specially
+ formatted date in the filename. Please refer to
+ <A HREF="rc-files.html#filename_guess_format">filename_guess_format</A>
+ for further information on this issue.</P>
+
+<P><b>IMPORTANT NOTE</b>: This is _not_ the date
+ format that is displayed on the letter.</P>
+
+<P>
+ The date can be entered via the ANSI C date
+ description format. Default is:</P>
+
+<P><i class="EMPHASIS">filename_guess_format=%x</i></P>
+
+<P>
+ for the standard and English rc-files. For the other
+ ones, the default is:</P>
+
+<P><i class="EMPHASIS">filename_guess_format=%d.%m.%y</i></P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="advertise">Advertise</A></H2>
+
+<P>
+ This stands for an advertise-string in the
+ generated LaTeX-file. If you do not care about LaTeX
+ and just want to have your letter, then this is of no
+ importance to you. Put it to 'false' or 'no'
+ to suppress the advertise-string.
+ Default is:</P>
+
+<P><i class="EMPHASIS">advertise=yes</i></P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="quite_latex">Quite_latex</A></H2>
+
+<P>
+ Set this option to 1 or yes to suppress all
+ LaTeX output. It will also suppress the output of
+ xdvi, dvips and dvipdf. If you do not know what this
+ is all about, just leave it untouched. Default is:</P>
+
+<P><i class="EMPHASIS">quite_latex=no</i></P>
+
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="filename_guess_format">Filename_guess_format</A></H2>
+
+<P>
+ Gtex-letter will choose a filename for your letter
+ based upon your selections, the and this option. This
+ is called filename guessing.
+ Optional values and separators
+ are possible (please refer to section
+ <A HREF="rc-files.html#addressformat">addressformat</A>
+ for explanation).</P>
+
+<P>
+ If there is empty space in the format or in the
+ parameters you supply (subjects of letters tend to
+ have empty space), these spaces will be converted to
+ '_'. The same applies to ':' and '/'.</P>
+
+<P>
+ Please make sure that the end of the format is
+ '.tex'. The possible variables are explained in the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>-section.</A>
+
+<P><i class="EMPHASIS">filename_guess_format=__id__[-__subject__].tex</i></P>
+
+<P>
+ This means a guessed filename with the id of the addressee and
+ if a subject for the letter is choosen, a hyphen and the subject.
+ The sufix is .tex.</P>
+
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="filename_guess_path">Filename_guess_path</A></H2>
+
+<P>
+ Gtex-letter will choose a filename for your letter
+ based upon your selections, the
+ <A HREF="rc-files.html#filename_guess_format">filename guess format</A>
+ and this path, which is prepended to the guessed filename. Default is:</P>
+
+<P><i class="EMPHASIS">filename_guess_path=~/</i></P>
+
+<P>
+ This means your home directory.</P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="mycountry">Mycountry</A></H2>
+
+<P>
+ If you define mycountry, gtex-letter will
+ hide the country in the address if it is equal to mycountry.
+ This might not be true if you have changed the
+ <A HREF="rc-files.html#addressformat"></A>addressformat.</P>
+
+
+<P><i class="EMPHASIS">mycountry=D</i></P>
+
+<P>
+ Gtex-letter checks the country-field in the addresses of your
+ addressbook. So if you abbrevated the countrys there, you have
+ to abbrevate the mycountry-option too.</P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="guilevel">Guilevel</A></H2>
+
+<P>
+ This is the level of complexity of the graphical
+ user interface (gui). Default value is:</P>
+
+<P><i class="EMPHASIS">guilevel=novice</i></P>
+
+<P>
+ Guilevel '<A HREF="gui.html#gui">novice</A>',
+ means simple screens, that are easy to
+ understand. After a few runs you might consider
+ moving to '<A HREF="advanced-guis.html#intermediate">intermediate</A>'.
+ This is a bit more straight forward. You can give it a try with the
+ command-line option "--guilevel 'intermediate'".
+ At last, there is the guilevel '<A HREF="advanced-guis.html#expert">expert</A>'
+ that brings you everything in one big page.</P>
+<P>
+ Various aliases exist for the three guilevels. The following
+ values are possible: novice, beginner, normal, intermediate,
+ advanced, expert, 0, 1 and 2.
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="opening_defaults">Opening_defaults</A></H2>
+
+<P>
+ The different default values for the
+ combox or buttons for the opening. Please enter
+ the openings seperated by ';'.
+ But do not forget to set quotation marks in front and behind every opening.</P>
+
+<P>
+ It is possible to further enhance the buttons with
+ the name of the address chosen. This can be reached
+ via inclusion of a term like __lastname__. The possible
+ terms are explained in the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>-section.</A>
+ Most variables make little sense however.</P>
+
+<P>
+ Furthermore, the is a kind of 'if-then'-pattern matching
+ possible. This applies to people writing
+ in languages, where the opening depends on the
+ sex of the addressee. This is explained in the section of
+ <A HREF="advanced-features.html#sex-adoption">adoption to the sex</A>
+ of an addressee. The default in the standard-file is:</P>
+
+
+<P><i class="EMPHASIS">opening_defaults="Dear __name_prefix__ __lastname__,"; "Dear __firstname__,"; "To whom it may concern,"</i></P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="closing_defaults">Closing_defaults</A></H2>
+
+<P>
+ The different default buttons for the
+ closing. Please enter the openings seperated by a semicolon (;).
+ But do not forget to set quotation marks around every closing.
+ 'If-then'-pattern matching is possible. They are explained
+ in the section on <A HREF="rc-files.html#opening_defaults">opening_defaults</A>.
+ Default is:</P>
+
+<P><i class="EMPHASIS">closing_defaults="Yours sincerely,"; "Regards,"; "With the best regards,"; "With the very best regards,"</i></P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="addressbook_columns">Addressbook_columns</A></H2>
+
+<P>
+ The different columns of the gtex-letter
+ representation of your addressbook. You can choose from
+ the following columns: Name_Prefix, Firstname, Lastname,
+ Street, ZIP, City, Country, Telephone.
+ This list is the default value:</P>
+
+<P><i class="EMPHASIS">addressbook_columns=Name_Prefix, Firstname, Lastname, Street, ZIP, City, Country, Telephone</i></P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="addressbook_column_widths">Addressbook_column_widths</A></H2>
+
+<P>
+ The widths of the columns, seperated
+ by comma. Please make sure, that
+ the number of columns and the number of column widths
+ match. The width is counted in pixels. Default is:</P>
+
+<P><i class="EMPHASIS">addressbook_column_widths=50, 80, 100, 120, 50, 100, 20, 90</i></P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="header_defaults">Header_defaults</A></H2>
+
+<P>
+ You can enter a list of different LaTeX-header
+ filenames here. Please enter the header filenames
+ seperated by ';'. You may
+ choose to omit the '.tex' in the filename.</P>
+
+<P>
+ <b>A WORD OF WARNING</b>: LaTeX letter classes are very specific.
+ The letter-header defines some parameters that will be
+ passed to LaTeX while processing your letter of the
+ specified class. If you simply choose to use a
+ different of the letter-headers that come with gtex-letter,
+ without adopting the rc-file. LaTeX will complain.
+ However, it is secure to use the default headers that
+ are defined in every rc-file.</P>
+
+<P>
+ If you are not used to LaTeX, you should start to copy
+ one of the default headers and adopt it to your needs. It is
+ quite tricky to write a header from scratch. Default is:</P>
+
+<P><i class="EMPHASIS">header_defaults='letterheader.standard_latex'</i></P>
+
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="lettertype">Lettertype</A></H2>
+
+<P>
+ The type of your LaTeX-letter. There are many different LaTeX letter
+ classes available. Gtex-letter can be adopted to support them using
+ this option and different <A HREF="rc-files.html#texcommands">LaTeX-commands</A>.
+ The default is:</P>
+
+<P><i class="EMPHASIS">lettertype='letter'</i></P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="addressformat">Addressformat</A></H2>
+
+<P>
+ This option(s) defines the format of the addresses in your
+ letter. This option is a multiple liner. The lines are numbered
+ starting from 0, the number seperated from the name of the option by a dot.
+ Empty lines are possible.
+ The possible keywords are explained in the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>-section.</A></P>
+
+<P>
+ Optional values are possible. They are set within [...].
+ An example: Not every address person has a name_suffix.
+ However, if there is a name_suffix, it is seperated
+ from that name via a "," in the default setting.
+ If there is no name_suffix that
+ "," should be omitted, of course. Therefor the name_suffix
+ together with the "," is optional: [, __name_suffix__].
+ Do not worry about optional terms without a separator.
+ Like __post_office__ as an example. They will be omitted
+ anyways. The optional clause is only interesting together
+ with separators. The deault is:</P>
+
+<P>
+<i class="EMPHASIS">addressformat.0=__name_prefix__ </i><br>
+<i class="EMPHASIS">addressformat.1=[__firstname__ ][__middlename__ ]__lastname__[, __name_suffix__]</i><br>
+<i class="EMPHASIS">addressformat.2=__post_office__</i><br>
+<i class="EMPHASIS">addressformat.3=__extended__</i><br>
+<i class="EMPHASIS">addressformat.4=__street__</i><br>
+<i class="EMPHASIS">addressformat.5=[__country__--][__zip__ ]__city__[, __region__]</i></P>
+
+<P>&nbsp;</P>
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="texcommands">Texcommands</A></H2>
+
+<P>
+ These are the LaTeX-commands. More or less the template file
+ for your letters. If you are not used to LaTeX, just leave it untouched.
+ This option is a multiple liner. The lines are numbered
+ starting from 0, the number seperated from the name of the option by a dot.
+ Empty lines are possible.
+ The possible keywords are explained in the
+ <A HREF="rc-files.html#variables">gtex-letter-variables</A>-section.
+ Default is:</A></P>
+
+<P>
+<i class="EMPHASIS">texcommands.0=\documentclass[12pt]{__lettertype__}</i><br>
+<i class="EMPHASIS">texcommands.1=\usepackage[T1]{fontenc}</i><br>
+<i class="EMPHASIS">texcommands.2=\usepackage[latin1]{inputenc}</i><br>
+<i class="EMPHASIS">texcommands.3=\name{Charles Mustermann}</i><br>
+<i class="EMPHASIS">texcommands.4=\usepackage{graphicx}</i><br>
+<i class="EMPHASIS">texcommands.5=\input{__letter_header__}</i><br>
+<i class="EMPHASIS">texcommands.6=\begin{document}</i><br>
+<i class="EMPHASIS">texcommands.7=\begin{letter}{__letter_address__}</i><br>
+<i class="EMPHASIS">texcommands.8=\textbf{\Large\raggedleft __letter_subject__}</i><br>
+<i class="EMPHASIS">texcommands.9=\opening{__letter_opening__}</i><br>
+<i class="EMPHASIS">texcommands.10=__letter_contents__</i><br>
+<i class="EMPHASIS">texcommands.11=</i><br>
+<i class="EMPHASIS">texcommands.12=\closing{__letter_closing__}</i><br>
+<i class="EMPHASIS">texcommands.13=\end{letter}</i><br>
+<i class="EMPHASIS">texcommands.14=\end{document}</i></P>
+
+<P>&nbsp;</P>
+
+
+
+
+<DIV CLASS="SECT2"><H2 CLASS="SECT2"><A NAME="variables">Variables</A></H2>
+
+<P>
+ The following options can be used in the gtex-letter and its config-file.
+ They are all embraced by two underscores. This makes the rc-file
+ more readable.</P>
+
+<P>
+ <A NAME="address-variables">The address-variables:</A></P>
+
+<P>
+The Id (Identification) of the choosen address: <i class="EMPHASIS">__id__</i><br>
+The prefix of a name in an address: <i class="EMPHASIS">__name_prefix__</i><br>
+The firstname of an address: <i class="EMPHASIS">__firstname__</i><br>
+The middlename: <i class="EMPHASIS">__middlename__</i><br>
+The lastname: <i class="EMPHASIS">__lastname__</i><br>
+The suffix of a name in an address: <i class="EMPHASIS">__name_suffix__</i><br>
+The extended part of an address: <i class="EMPHASIS">__extended__</i><br>
+The post-office-part of an address: <i class="EMPHASIS">__post_office__</i><br>
+The street: <i class="EMPHASIS">__street__</i><br>
+The postal code (zip-code): <i class="EMPHASIS">__zip__</i><br>
+The city: <i class="EMPHASIS">__city__</i><br>
+The region: <i class="EMPHASIS">__region__</i><br>
+The country: <i class="EMPHASIS">__country__</i></P>
+
+<P>
+ <A NAME="letter-based-variables">The letter-based variables:</A></P>
+
+<P>
+The subject of your letter: <i class="EMPHASIS">__subject__</i><br>
+The opening choosen: <i class="EMPHASIS">__opening__</i><br>
+The closing: <i class="EMPHASIS">__closing__</i><br>
+The filename: <i class="EMPHASIS">__filename__</i><br>
+The filename without the suffix: <i class="EMPHASIS">__short_filename__</i></P>
+
+<P>
+ <A NAME="other-variables">Other variables:</A></P>
+<P>
+Todays date: <i class="EMPHASIS">__date__</i></P>
+
+</DIV>
+
+
+
+<DIV CLASS="NAVFOOTER">
+
+<HR ALIGN="LEFT" WIDTH="100%">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top"><A HREF="advanced-guis.html">Prev</A></TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top"><A HREF="index.html">Home</A></TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top"><A HREF="advanced-features.html">Next</A></TD>
+</TR>
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top">Advanced User-Levels</TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top">&nbsp;</TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top">Advanced Features</TD>
+</TR>
+
+</TABLE>
+</DIV>
+</BODY>
+</HTML>
diff --git a/support/gtex-letter/manual/html/template.html b/support/gtex-letter/manual/html/template.html
new file mode 100644
index 0000000000..94e3180acc
--- /dev/null
+++ b/support/gtex-letter/manual/html/template.html
@@ -0,0 +1,77 @@
+<HTML><HEAD><TITLE>Gtex-Letter User Manual</TITLE>
+
+<LINK REL="HOME" TITLE="Gtex-Letter User Manual" HREF="gtex-letter.html">
+<LINK REL="PREVIOUS" TITLE="" HREF=".html">
+<LINK REL="NEXT" TITLE="" HREF=".html">
+
+</HEAD><BODY>
+
+<DIV CLASS="NAVHEADER">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR> <TH COLSPAN="3" ALIGN="center">Gtex-Letter User Manual</TH></TR>
+
+<TR><TD WIDTH="10%" ALIGN="left" VALIGN="bottom"><A HREF=".html">Prev</A></TD>
+
+ <TD WIDTH="80%" ALIGN="center" VALIGN="bottom"></TD>
+ <TD WIDTH="10%" ALIGN="right" VALIGN="bottom"><A HREF=".html">Next</A></TD>
+
+</TR></TABLE>
+
+<HR ALIGN="LEFT" WIDTH="100%"></DIV><DIV CLASS="CHAPTER"><H1><A NAME="GCAL">The GNOME Calendar</A></H1>
+
+<DIV CLASS="TOC"><DL>
+
+<DT><B>Table of Contents</B></DT>
+<DT><A HREF=".html#AEN69">Introduction</A></DT>
+<DT><A HREF=".html">Setting</A></DT>
+<DT><A HREF=".html">Using</A></DT>
+<DT><A HREF=".html">Making</A></DT>
+
+</DL></DIV>
+
+<DIV CLASS="SECT1"><H1 CLASS="SECT1"><A NAME="AEN69">Introduction</A></H1>
+
+<P>
+
+ The GNOME Calendar is a simple calendar applications which can be quite
+ useful in your daily work. The Calendar, like much of GNOME, is in its
+ </P>
+
+<P>
+ The Calendar is broken up into four main tabs: Day, Week, Month,
+ the tabs.
+ </P>
+
+<DIV CLASS="FIGURE">
+<P><B>Figure 3-1. The GNOME Calendar</B></P>
+<P><IMG SRC="images/calday.gif"></P>
+</DIV>
+
+</DIV></DIV>
+
+
+
+<DIV CLASS="NAVFOOTER">
+
+<HR ALIGN="LEFT" WIDTH="100%">
+
+<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top"><A HREF="tech.html.html">Prev</A></TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top"><A HREF="gnomecal.html">Home</A></TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top"><A HREF="calsetup.html">Next</A></TD>
+</TR>
+
+<TR>
+<TD WIDTH="33%" ALIGN="left" VALIGN="top">Technical information about the GNOME calendar</TD>
+<TD WIDTH="34%" ALIGN="center" VALIGN="top">&nbsp;</TD>
+<TD WIDTH="33%" ALIGN="right" VALIGN="top">Setting Up the GNOME Calendar</TD>
+</TR>
+
+</TABLE>
+</DIV>
+</BODY>
+</HTML>
diff --git a/support/gtex-letter/manual/html/users-manual-ideas b/support/gtex-letter/manual/html/users-manual-ideas
new file mode 100644
index 0000000000..2539794460
--- /dev/null
+++ b/support/gtex-letter/manual/html/users-manual-ideas
@@ -0,0 +1,27 @@
+Ideas wat should go into a users-manual of gtex-letter.
+
+What is it all about. Scoop of the application
+ (personal to business)
+
+Dependencies
+
+Simple letter. More complex ones.
+Serial letters
+
+letter headers, multiple letter headers
+
+The different screens, frames.
+
+User interfaces
+
+The rc-file. Configuration
+
+Complex configuration:
+ address styles, openings depending on clauses, filename-guesses
+
+LaTeX for non-TeXies
+ .tex, .dvi, pdf, ps etc.
+
+Office automation, useful setups
+
+Internationalization. Different TeX-Styles, different Letter-headers
diff --git a/support/gtex-letter/mk_letter.py b/support/gtex-letter/mk_letter.py
new file mode 100644
index 0000000000..5704f3d314
--- /dev/null
+++ b/support/gtex-letter/mk_letter.py
@@ -0,0 +1,182 @@
+import os, string
+
+import utils, error, gettext
+
+gettext.bindtextdomain('gtex-letter', '/usr/share/locale')
+gettext.textdomain('gtex-letter')
+_ = gettext.gettext
+
+FALSE = 0
+TRUE = -1
+
+def appropriate_wd(cwd, newd):
+ if cwd and newd and ( cwd <> newd ):
+ if os.path.isdir(newd):
+ os.chdir(newd)
+
+def write_file (letter, rc):
+ def mkup_text(text, letter=letter, rc=rc, address_counter = 0):
+ while 1:
+ start = string.find(text, "__")
+ end = string.find(text, "__", start + 1)
+ if start == -1:
+ break
+ key = text[start+2:end]
+ if key == 'lettertype':
+ text = string.replace(text, '__' + key + '__', rc.lettertype)
+ if key == 'letter_address':
+ text = string.replace(text, '__' + key + '__', letter.addresses[address_counter])
+ if key == 'letter_opening':
+ if letter.opening:
+ text = string.replace(text, '__' + key + '__', utils.general_mkup_text(letter, letter.opening, rc, address_counter))
+ else:
+ text = ''
+ if key == 'letter_subject':
+ if letter.subject:
+ text = string.replace(text, '__' + key + '__', letter.subject)
+ else:
+ text = ''
+ if key == 'letter_contents':
+ if letter.contents:
+ text = string.replace(text, '__' + key + '__', letter.contents)
+ else:
+ text = ''
+ if key == 'letter_closing':
+ if letter.closing:
+ text = string.replace(text, '__' + key + '__', utils.general_mkup_text(letter, letter.closing, rc))
+ else:
+ text = ''
+ if key == 'letter_header':
+ if letter.header:
+ text = string.replace(text, '__' + key + '__', letter.header)
+ else:
+ text = ''
+ else:
+ break
+ return text
+
+ try:
+ if letter.filename:
+ try:
+ if not os.path.exists(letter.path) and not letter.path == '':
+ raise error.PathNotFound, letter.path
+ except error.PathNotFound, path:
+ print _("The provided path '%s' does not exist.") + " " + _("File not written.") % path
+ raise error.LetterNotWritten, letter.filename
+
+ olddir = os.getcwd()
+ appropriate_wd(olddir, letter.path)
+ try:
+ file = open (utils.file_strip_path(letter.filename), 'w')
+ if file:
+ if rc.advertisestr:
+ file.write(rc.advertisestr)
+
+ def divide (text):
+ adrs = []
+ while 1:
+ hit = string.find(text , '\n\\\\\n')
+ if hit == -1:
+ adrs.append(text)
+ break
+ adrs.append(text[:hit+1])
+ text = text[hit+4:]
+ return adrs
+ letter.addresses = divide(letter.address_slashes)
+
+ loop = FALSE
+ addr_counter = 0
+ i = 0
+
+ while 1:
+ line = rc.texcommands[i]
+ file.write( mkup_text(line, address_counter = addr_counter)+ '\n')
+ if line[:14] == '\\begin{letter}':
+ loop = i
+ if line[:12] == '\end{letter}':
+ addr_counter = addr_counter + 1
+ if addr_counter >= len(letter.addresses):
+ loop = FALSE
+ else:
+ i = loop - 1
+ i = i + 1
+ if i > len(rc.texcommands)-1:
+ break
+
+ file.close ()
+ else:
+ raise IOError, None, 'Unknown reason'
+ except IOError, (no, name):
+ print "Could not write file '%s'. %s." % (letter.filename, name)
+ raise error.LetterNotWritten, letter.filename
+
+ appropriate_wd(letter.path, olddir)
+
+ return 0
+
+ else:
+ try:
+ raise IOError, None, 'Filename not set.'
+ except IOError, (no, name):
+ print "'%s'. File not written." % name
+ raise error.LetterNotWritten, letter.filename
+
+ except error.LetterNotWritten, file:
+ print "Letter '%s' not written." % file
+ return 1
+
+def rm_latex_files(letter):
+ def rm_ifsuffix (file, suffix):
+ filename = file + "." + suffix
+ if os.path.isfile(filename):
+ os.remove(filename)
+ olddir = os.getcwd()
+ appropriate_wd(olddir, letter.path)
+ if utils.file_strip_suffix(letter.filename):
+ rm_ifsuffix(utils.file_strip_suffix(letter.filename), "log")
+ rm_ifsuffix(utils.file_strip_suffix(letter.filename), "aux")
+ appropriate_wd(letter.path, olddir)
+
+def tex_latex(letter, rc):
+ olddir = os.getcwd()
+ appropriate_wd(olddir, letter.path)
+ rm_latex_files(letter)
+ os.system(utils.general_mkup_text(letter, rc.mylatex, rc) + " " + rc.latex_output)
+ appropriate_wd(letter.path, olddir)
+
+def tex_xdvi(letter, rc):
+ olddir = os.getcwd()
+ appropriate_wd(olddir, letter.path)
+ os.system(utils.general_mkup_text(letter, rc.myxdvi, rc) \
+ + " " + rc.latex_output)
+ appropriate_wd(letter.path, olddir)
+
+def tex_pdf(letter, rc, event=None, data=None):
+ olddir = os.getcwd()
+ appropriate_wd(olddir, letter.path)
+ os.system(utils.general_mkup_text(letter, rc.mydvipdf, rc) \
+ + " " + rc.latex_output)
+ appropriate_wd(letter.path, olddir)
+
+def tex_print(letter, rc, event=None, data=None):
+ olddir = os.getcwd()
+ appropriate_wd(olddir, letter.path)
+ os.system(utils.general_mkup_text(letter, rc.mydvips, rc) \
+ + " " + rc.latex_output)
+ os.system(utils.general_mkup_text(letter, rc.myprintcommand, rc))
+ appropriate_wd(letter.path, olddir)
+
+def tex_postscript(letter, rc, event=None, data=None):
+ olddir = os.getcwd()
+ appropriate_wd(olddir, letter.path)
+ os.system(utils.general_mkup_text(letter, rc.mydvips, rc) \
+ + " " + rc.latex_output)
+ appropriate_wd(letter.path, olddir)
+
+def continue_editor(letter, rc, event=None, data=None):
+ olddir = os.getcwd()
+ appropriate_wd(olddir, letter.path)
+ os.system(utils.general_mkup_text(letter, rc.myeditor, rc))
+ appropriate_wd(letter.path, olddir)
+
+
diff --git a/support/gtex-letter/print.xpm b/support/gtex-letter/print.xpm
new file mode 100644
index 0000000000..4e437ad3c6
--- /dev/null
+++ b/support/gtex-letter/print.xpm
@@ -0,0 +1,292 @@
+/* XPM */
+static char *magick[] = {
+/* columns rows colors chars-per-pixel */
+"31 30 256 2",
+" c Gray0",
+". c Gray13",
+"X c Gray16",
+"o c #313131",
+"O c #393939",
+"+ c #423939",
+"@ c Gray26",
+"# c Gray29",
+"$ c #524a4a",
+"% c Gray32",
+"& c #5a5a5a",
+"* c Gray39",
+"= c Gray42",
+"- c Gray45",
+"; c #7b7b7b",
+": c #848484",
+"> c Gray55",
+", c Gray58",
+"< c Gray61",
+"1 c #a5a59c",
+"2 c #a5a5a5",
+"3 c Gray68",
+"4 c Gray71",
+"5 c Gray74",
+"6 c #c6c6c6",
+"7 c #cecec6",
+"8 c #cecece",
+"9 c Gray84",
+"0 c Gray87",
+"q c #e7e7de",
+"w c #e7e7e7",
+"e c #efe7e7",
+"r c #efefe7",
+"t c #efefef",
+"y c #f7efef",
+"u c #f7f7ef",
+"i c Gray97",
+"p c #fff7f7",
+"a c Gray100",
+"s c Gray100",
+"d c Gray100",
+"f c Gray100",
+"g c Gray100",
+"h c Gray100",
+"j c Gray100",
+"k c Gray100",
+"l c Gray100",
+"z c Gray100",
+"x c Gray100",
+"c c Gray100",
+"v c Gray100",
+"b c Gray100",
+"n c Gray100",
+"m c Gray100",
+"M c Gray100",
+"N c Gray100",
+"B c Gray100",
+"V c Gray100",
+"C c Gray100",
+"Z c Gray100",
+"A c Gray100",
+"S c Gray100",
+"D c Gray100",
+"F c Gray100",
+"G c Gray100",
+"H c Gray100",
+"J c Gray100",
+"K c Gray100",
+"L c Gray100",
+"P c Gray100",
+"I c Gray100",
+"U c Gray100",
+"Y c Gray100",
+"T c Gray100",
+"R c Gray100",
+"E c Gray100",
+"W c Gray100",
+"Q c Gray100",
+"! c Gray100",
+"~ c Gray100",
+"^ c Gray100",
+"/ c Gray100",
+"( c Gray100",
+") c Gray100",
+"_ c Gray100",
+"` c Gray100",
+"' c Gray100",
+"] c Gray100",
+"[ c Gray100",
+"{ c Gray100",
+"} c Gray100",
+"| c Gray100",
+" . c Gray100",
+".. c Gray100",
+"X. c Gray100",
+"o. c Gray100",
+"O. c Gray100",
+"+. c Gray100",
+"@. c Gray100",
+"#. c Gray100",
+"$. c Gray100",
+"%. c Gray100",
+"&. c Gray100",
+"*. c Gray100",
+"=. c Gray100",
+"-. c Gray100",
+";. c Gray100",
+":. c Gray100",
+">. c Gray100",
+",. c Gray100",
+"<. c Gray100",
+"1. c Gray100",
+"2. c Gray100",
+"3. c Gray100",
+"4. c Gray100",
+"5. c Gray100",
+"6. c Gray100",
+"7. c Gray100",
+"8. c Gray100",
+"9. c Gray100",
+"0. c Gray100",
+"q. c Gray100",
+"w. c Gray100",
+"e. c Gray100",
+"r. c Gray100",
+"t. c Gray100",
+"y. c Gray100",
+"u. c Gray100",
+"i. c Gray100",
+"p. c Gray100",
+"a. c Gray100",
+"s. c Gray100",
+"d. c Gray100",
+"f. c Gray100",
+"g. c Gray100",
+"h. c Gray100",
+"j. c Gray100",
+"k. c Gray100",
+"l. c Gray100",
+"z. c Gray100",
+"x. c Gray100",
+"c. c Gray100",
+"v. c Gray100",
+"b. c Gray100",
+"n. c Gray100",
+"m. c Gray100",
+"M. c Gray100",
+"N. c Gray100",
+"B. c Gray100",
+"V. c Gray100",
+"C. c Gray100",
+"Z. c Gray100",
+"A. c Gray100",
+"S. c Gray100",
+"D. c Gray100",
+"F. c Gray100",
+"G. c Gray100",
+"H. c Gray100",
+"J. c Gray100",
+"K. c Gray100",
+"L. c Gray100",
+"P. c Gray100",
+"I. c Gray100",
+"U. c Gray100",
+"Y. c Gray100",
+"T. c Gray100",
+"R. c Gray100",
+"E. c Gray100",
+"W. c Gray100",
+"Q. c Gray100",
+"!. c Gray100",
+"~. c Gray100",
+"^. c Gray100",
+"/. c Gray100",
+"(. c Gray100",
+"). c Gray100",
+"_. c Gray100",
+"`. c Gray100",
+"'. c Gray100",
+"]. c Gray100",
+"[. c Gray100",
+"{. c Gray100",
+"}. c Gray100",
+"|. c Gray100",
+" X c Gray100",
+".X c Gray100",
+"XX c Gray100",
+"oX c Gray100",
+"OX c Gray100",
+"+X c Gray100",
+"@X c Gray100",
+"#X c Gray100",
+"$X c Gray100",
+"%X c Gray100",
+"&X c Gray100",
+"*X c Gray100",
+"=X c Gray100",
+"-X c Gray100",
+";X c Gray100",
+":X c Gray100",
+">X c Gray100",
+",X c Gray100",
+"<X c Gray100",
+"1X c Gray100",
+"2X c Gray100",
+"3X c Gray100",
+"4X c Gray100",
+"5X c Gray100",
+"6X c Gray100",
+"7X c Gray100",
+"8X c Gray100",
+"9X c Gray100",
+"0X c Gray100",
+"qX c Gray100",
+"wX c Gray100",
+"eX c Gray100",
+"rX c Gray100",
+"tX c Gray100",
+"yX c Gray100",
+"uX c Gray100",
+"iX c Gray100",
+"pX c Gray100",
+"aX c Gray100",
+"sX c Gray100",
+"dX c Gray100",
+"fX c Gray100",
+"gX c Gray100",
+"hX c Gray100",
+"jX c Gray100",
+"kX c Gray100",
+"lX c Gray100",
+"zX c Gray100",
+"xX c Gray100",
+"cX c Gray100",
+"vX c Gray100",
+"bX c Gray100",
+"nX c Gray100",
+"mX c Gray100",
+"MX c Gray100",
+"NX c Gray100",
+"BX c Gray100",
+"VX c Gray100",
+"CX c Gray100",
+"ZX c Gray100",
+"AX c Gray100",
+"SX c Gray100",
+"DX c Gray100",
+"FX c Gray100",
+"GX c Gray100",
+"HX c Gray100",
+"JX c Gray100",
+"KX c Gray100",
+"LX c Gray100",
+"PX c Gray100",
+"IX c Gray100",
+"UX c Gray100",
+/* pixels */
+"a a a a a a a a a a a a a a a a a a i a a a a a a a a a a a : ",
+"a 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 5 5 5 5 5 5 5 5 5 5 5 : ",
+"a 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 5 5 6 5 6 5 6 5 6 5 6 5 : ",
+"a 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 5 5 5 5 5 5 5 5 5 5 5 : ",
+"a 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 5 5 6 5 6 5 6 5 6 5 6 5 : ",
+"a 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 5 5 5 5 5 5 5 5 5 5 5 : ",
+"a 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 5 6 5 6 5 6 5 6 5 6 5 5 : ",
+"a 5 5 5 5 5 5 5 5 5 5 5 5 5 i 6 % 5 5 5 5 5 5 5 5 6 5 : ",
+"a 5 6 5 6 5 6 5 6 5 6 5 6 i i i t t 6 # 6 5 6 5 5 5 : ",
+"a 5 5 5 5 5 5 5 5 5 5 5 6 i y t t r w q 0 1 5 5 5 5 6 5 : ",
+"a 5 6 5 6 5 6 5 6 5 6 5 X i t t r w w q 0 7 5 6 5 6 5 5 5 : ",
+"i 5 5 5 5 5 5 5 5 5 2 u t r w w q 0 0 % 6 5 5 5 5 5 6 5 : ",
+"i 6 5 6 5 6 5 6 8 4 < ; e w q q 0 0 5 5 6 5 6 5 5 5 : ",
+"a 5 5 5 5 5 8 w t w 0 4 & * : 3 0 7 + & - 5 5 5 6 5 : ",
+"a 5 6 5 6 > 4 w i i i t t t r > * $ * @ = # X 6 5 5 5 5 : ",
+"a 5 5 5 5 3 3 2 5 0 t t t t t w w w 9 @ X o O 5 6 5 6 5 : ",
+"a 5 6 5 5 4 3 3 2 3 2 9 w t t w t 0 @ O O O @ 5 5 5 5 5 : ",
+"a 5 5 6 5 = 2 4 4 4 2 2 < < 8 0 6 @ o o @ O O 6 5 6 5 5 : ",
+"a 5 5 5 5 * # * < 3 3 2 2 2 , ; o X O O @ O O 5 5 5 6 5 : ",
+"a 5 6 5 5 & & # # # * : 2 < < ; O O O o O O 5 6 5 5 5 : ",
+"a 5 5 6 5 5 # % % % @ @ # * ; O O o o o 5 5 6 5 5 6 5 : ",
+"a 5 5 5 5 6 5 5 @ & & * - = @ o O 5 6 5 5 5 6 5 5 : ",
+"a 5 6 5 5 5 5 6 5 5 5 # = - O @ 5 5 6 5 5 6 5 5 5 6 ; ",
+"a 5 5 6 5 6 5 5 5 6 5 5 5 5 5 6 5 5 5 6 5 5 6 5 5 : ",
+"a 5 5 5 5 5 5 6 5 5 5 6 5 5 5 5 5 5 6 5 5 5 6 5 5 5 6 5 5 5 : ",
+"a 5 6 5 6 5 5 5 6 5 5 5 6 5 6 5 6 5 5 5 6 5 5 5 6 5 5 5 6 5 : ",
+"i 6 5 5 5 6 5 5 5 6 5 5 5 6 5 5 5 5 6 5 5 5 6 5 5 5 6 5 5 5 : ",
+"a 5 5 6 5 5 6 5 5 5 6 5 5 5 5 6 5 5 5 6 5 5 5 6 5 5 5 6 5 5 : ",
+"a 5 5 5 5 6 5 5 6 5 5 6 5 6 5 5 6 5 5 5 6 5 5 5 6 5 5 5 6 5 : ",
+": : : > : : : : : : : : : : : : : : : : : : : ; : ; : : ; : ; "
+};
diff --git a/support/gtex-letter/translations/gtex-letter.de.mo b/support/gtex-letter/translations/gtex-letter.de.mo
new file mode 100644
index 0000000000..ad4f3fd64f
--- /dev/null
+++ b/support/gtex-letter/translations/gtex-letter.de.mo
Binary files differ
diff --git a/support/gtex-letter/translations/gtex-letter.de.po b/support/gtex-letter/translations/gtex-letter.de.po
new file mode 100644
index 0000000000..44b0ca5504
--- /dev/null
+++ b/support/gtex-letter/translations/gtex-letter.de.po
@@ -0,0 +1,349 @@
+# gtex-letter
+# Copyright (C) 2001
+# christian.folini@unifr.ch, 2001
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gtex-letter, Version 0.21\n"
+"PO-Revision-Date: Sun Mar 25 16:43:47 2001\n"
+"Last-Translator: christian.folini@unifr.ch\n"
+"Generated-By: pygettext.py 0.2\n"
+
+
+#: gui.py:576
+msgid "Subject"
+msgstr "Betreff"
+
+#: addressbook_vcard.py:298
+msgid "Sorting:"
+msgstr "Sortierung"
+
+#: gui.py:745
+msgid ""
+"save as\n"
+"pdf"
+msgstr ""
+"als pdf\n"
+"speichern"
+
+#: gui.py:651
+msgid "Save Contents"
+msgstr "Inhalt speichern"
+
+#: gtex-letter:220
+msgid "The addresscard '%s' could not be found."
+msgstr "Die Addresskarte '%s' konnte nichte gefunden werden."
+
+#: utils.py:28
+msgid "No section '%s' in config-file. Aborting."
+msgstr "Keine Sektion '%s' in der Konfigurations-Datei. Abbruch."
+
+#: gui.py:355
+msgid "Welcome to gtex-letter."
+msgstr "Willkommen zu gtex-letter."
+
+#: gui.py:648
+msgid "Import Textfile"
+msgstr "Textdatei importieren"
+
+#: gui.py:705
+msgid "show letter"
+msgstr "Brief anzeigen"
+
+#: gui.py:425
+msgid "Header-File"
+msgstr "Header-Datei"
+
+#: gui.py:662
+msgid "LaTeX"
+msgstr "LaTeX"
+
+#: gui.py:441
+#: gui.py:454
+msgid "Search"
+msgstr "Suchen"
+
+#: gui.py:338
+msgid "Search Files"
+msgstr "Dateien Suchen"
+
+#: gui.py:114
+msgid "Header and Filename"
+msgstr "Header und Dateiname"
+
+#: addressbook_vcard.py:85
+msgid "Set prefix firstname middlename lastname suffix to:"
+msgstr ""
+
+#: addressbook_vcard.py:124
+msgid "Error: Could not get address-card-attribute:"
+msgstr "Fehler: Folgendes Addresskarten-Attribut konnte nicht gefunden werden:"
+
+#: gui.py:610
+msgid "Export File"
+msgstr "Datei Exportieren"
+
+#: gui.py:428
+msgid "Filename:"
+msgstr "Dateiname:"
+
+#: gui.py:491
+msgid "Closing:"
+msgstr "Schliessen:"
+
+#: addressbook_vcard.py:155
+msgid "ID:"
+msgstr "ID:"
+
+#: gui.py:128
+#: gui.py:201
+msgid "Thankyou for using me."
+msgstr "Danke für die Benutzung."
+
+#: gui.py:107
+msgid "Contents and Closing"
+msgstr "Inhalt und Gru"
+
+#: addressbook_vcard.py:97
+msgid "Set address to:"
+msgstr "Adresse gesetzt:"
+
+#: gui.py:359
+msgid "The"
+msgstr "Das"
+
+#: gui.py:359
+msgid "-user-interface is being used."
+msgstr "-user-interface wird benutzt."
+
+#: utils.py:31
+msgid "No option '%s' in section '%s' of config-file. Aborting."
+msgstr "Keine Option '%s' in Sektion '%s' der Konfiguration-Datei. Abbruch."
+
+#: addressbook_vcard.py:102
+msgid "Set telephone to:"
+msgstr "Telefonnummer gesetzt:"
+
+#: gui.py:465
+msgid "Opening:"
+msgstr "Eröffnung"
+
+#: gui.py:382
+msgid "Divide multiple addresses by empty lines."
+msgstr "Unterteilen Sie verschiedene Adressen durch leere Zeilen."
+
+#: utils.py:92
+msgid "There is an error in the clause '%s' of the addressformat in the rc-file. Aborting."
+msgstr "In der Adressformats-Klausel '%s' der Konfigurations-Datei steckt ein Fehler. Abbruch."
+
+#: config.py:112
+msgid "Error: Could not retrieve '%s' from rc-file."
+msgstr "Fehler: Ich konnte '%s' nicht aus der Konfigurations-Datei lesen."
+
+#: gui.py:735
+msgid "Print"
+msgstr "Drucken"
+
+#: gtex-letter:253
+msgid "Submitted headerfile '%s' not found"
+msgstr "Die bereitgestellte Header-Datei '%s' wurde nicht gefunden."
+
+#: gui.py:488
+#: gui.py:545
+#: gui.py:558
+msgid "Closing"
+msgstr "Grußformel"
+
+#: gui.py:127
+#: gui.py:200
+msgid "Finish gtex-letter"
+msgstr "Beenden von gtex-letter"
+
+#: gui.py:147
+msgid "Contents, Closing, Header and Filename"
+msgstr "Inhalt, Grußformel, Header und Datei-Name"
+
+#: gui.py:734
+msgid "Could not find the file '%s'. Text substituted."
+msgstr "Konnte die Datei '%s' nicht finden. Durch Text ersetzt."
+
+#: addressbook_vcard.py:238
+msgid "Error: Not the same number of column_widths and column_names provided in the rc-file"
+msgstr "Fehler: Nicht dieselbe Anzahl von Spaltenbreiten (column_widths) und Spaltennamen (column_names) in der Konfigurations-Datei."
+
+#: main.py:251
+msgid "Error: Could not find header-file '%s'."
+msgstr "Fehler: Die Header-Datei '%s' konnte nicht gefunden werden."
+
+#: gui.py:415
+msgid "Browse Addresses"
+msgstr "Adressen suchen"
+
+#: addressbook_vcard.py:76
+msgid "Set id to:"
+msgstr "ID gesetzt"
+
+#: config.py:155
+msgid "Error: Could not find header defaultfile:"
+msgstr "Fehler: Konnte die Standard-Header-Datei nicht finden:"
+
+#: addressbook_vcard.py:214
+msgid "Error: Could not find addressbook:"
+msgstr "Fehler: Konnte das Addressbuch nicht finden:"
+
+#: gui.py:49
+msgid "Could not find '%s'."
+msgstr "'%s' konnte nicht gefunden werden."
+
+#: gui.py:752
+msgid ""
+"Continue\n"
+"with editor"
+msgstr ""
+"Weiter\n"
+"im Editor"
+
+#: main.py:267
+#: gtex-letter:269
+msgid "Aborting."
+msgstr "Abbruch"
+
+#: addressbook_vcard.py:157
+msgid "Phone:"
+msgstr "Telefon:"
+
+#: config.py:85
+msgid "Error: Could not find rc-file:"
+msgstr "Fehler: Die angegebene Konfigurations-Datei konnte nicht gefunden werden."
+
+#: gui.py:94
+msgid "Address"
+msgstr "Adresse"
+
+#: gui.py:356
+msgid "Follow me to make a LaTeX-letter."
+msgstr "Folgen Sie mir um einen LaTeX-Brief zu erzeugen."
+
+#: gui.py:267
+#: gui.py:278
+#: utils.py:224
+#: utils.py:235
+msgid "The clause '%s' is malformed. Aborting."
+msgstr "Die Klausel '%s' ist falsch formuliert. Abbruch."
+
+#: gui.py:358
+msgid "This is version"
+msgstr "Dies ist Version"
+
+#: config.py:164
+msgid "Error: I do not know the guilevel '%s'. Please check spelling."
+msgstr "Fehler: Ich kenne den guilevel '%s'. Bitte überprüfen Sie die Rechtschreibung."
+
+#: main.py:220
+msgid "Error: Did not find the address-id you provided: '%s'"
+msgstr "Fehler: Die Adressen-ID '%s' konnte nicht gefunden werden."
+
+#: config.py:15
+msgid "This file was generated by gtex-letter version"
+msgstr "Diese Datei wurde von gtex-letter erzeugt. Version"
+
+#: gui.py:121
+#: gui.py:156
+#: gui.py:194
+msgid "Makeup"
+msgstr "Zusammenfügen"
+
+#: addressbook_vcard.py:425
+msgid "Nothing selected."
+msgstr "Nichts ausgewählt."
+
+#: gui.py:589
+msgid "Import File"
+msgstr "Datei importieren"
+
+#: gui.py:462
+#: gui.py:514
+#: gui.py:526
+msgid "Opening"
+msgstr "Eröffnung"
+
+#: addressbook_vcard.py:421
+msgid "New address:"
+msgstr "Neue Adresse:"
+
+#: gui.py:38
+msgid "Could not find '%s'. Aborting."
+msgstr "'%s' konnte nicht gefunden werden. Abbruch."
+
+#: gui.py:100
+msgid "Subject and Opening"
+msgstr "Betreff und Eröffnung"
+
+#: gui.py:635
+msgid "Contents"
+msgstr "Inhalt"
+
+#: mk_letter.py:64
+msgid "The provided path '%s' does not exist."
+msgstr "Der angegebene Pfad '%s' existiert nicht."
+
+#: main.py:123
+#: gtex-letter:119
+msgid "Error: Provided rc-file not found."
+msgstr "Fehler: Die angegebene Konfigurations-Datei konnte nicht gefunden werden."
+
+#: gui.py:135
+msgid "gtex-letter"
+msgstr "gtex-letter"
+
+#: gui.py:671
+msgid "Error: No letter written so far. Can not show."
+msgstr "Fehler: Bislang wurde kein Brief erzeugt. Er kann nicht angezeigt werden."
+
+#: gui.py:364
+msgid "Destination-Address"
+msgstr "Adressat"
+
+#: gui.py:139
+msgid "Address, Subject and Opening"
+msgstr "Adresse, Betreff und Eröffnung"
+
+#: main.py:148
+#: gtex-letter:144
+msgid "Error: I do not know what to do with STDIN (pipe). You set both, -f/--file and -a/--address, in the options, so there is no place to put the pipe."
+msgstr "Fehler: Ich weiss nicht, was ich mit dem STDIN (Standard-Input, Pipe) anfangen soll. Sie haben beide Optionen gesetzt, -f/--file und -a/--address. Damit bleibt kein Platz mehr für den STDIN."
+
+#: main.py:92
+#: gtex-letter:88
+msgid "Error: Provided file not found."
+msgstr "Fehler: Die angegebene Datei konnte nicht gefunden werden."
+
+#: gui.py:170
+msgid "All in one big page"
+msgstr "Alles auf einer Seite"
+
+#: main.py:135
+#: gtex-letter:131
+msgid "Error: You may not set the noshow or the print option without setting nogui."
+msgstr "Fehler: Sie können die Option --noshow oder --print nicht setzen, ohne die Option --nogui anzugeben."
+
+#: mk_letter.py:64
+msgid "File not written."
+msgstr "Datei nicht geschrieben."
+
+#: gui.py:712
+msgid ""
+"save as\n"
+"postscript"
+msgstr ""
+"Als postscript\n"
+"schreiben."
+
+#: gui.py:449
+msgid "LaTeX-File (this is where the letter is saved)"
+msgstr "LaTeX-Datei (An diesen Ort wird der Brief abgespeichert.)"
+
+#: gui.py:358
+msgid "of gtex-letter."
+msgstr "von gtex-letter."
+
diff --git a/support/gtex-letter/uninstall b/support/gtex-letter/uninstall
new file mode 100644
index 0000000000..18cd94f7b9
--- /dev/null
+++ b/support/gtex-letter/uninstall
@@ -0,0 +1,36 @@
+#!/usr/bin/bash
+#
+#uninstall gtex-letter
+#must be root to run
+
+PREFIX=/opt/gnome/bin/
+DIR=gtex-letter-prg
+PRG=gtex-letter
+RCFILE=.gtex-letterrc
+LC_PATH=/usr/share/locale/de/LC_MESSAGES
+DOC_PATH=/opt/gnome/doc/gtex-letter
+
+if [ -d $PREFIX$DIR ]
+then
+ rm -r $PREFIX$DIR && echo "Directory $PREFIX$DIR deleted."
+fi
+
+if [ -h $PREFIX$PRG ]
+then
+ rm -r $PREFIX$PRG && echo "Link $PREFIX$PRG deleted."
+fi
+
+if [ -d $DOC_PATH ]
+then
+ rm -r $DOC_PATH && echo "Documentation deleted."
+fi
+
+if [ -e $LC_PATH/gtex-letter.mo ]
+then
+ rm -r $LC_PATH/gtex-letter.mo && echo "Translation-File deleted."
+fi
+
+
+
+
+
diff --git a/support/gtex-letter/utils.py b/support/gtex-letter/utils.py
new file mode 100644
index 0000000000..214d1ca68c
--- /dev/null
+++ b/support/gtex-letter/utils.py
@@ -0,0 +1,309 @@
+import os, string, sys, ConfigParser
+FALSE = 0
+TRUE = -1
+
+import error, gettext
+import time
+
+gettext.bindtextdomain('gtex-letter', '/usr/share/locale')
+gettext.textdomain('gtex-letter')
+_ = gettext.gettext
+
+
+def add_slashes (str):
+ string.rstrip (str)
+ return string.replace (str, "\n", "\\\\\n")
+
+def switch_yesno (mystr, default=FALSE):
+ # Submit yes, no, true, false, 0, -1 and 1 and this function will return TRUE and FALSE
+ # Default is FALSE
+ mystr= str(mystr)
+ if string.lower(mystr) == 'yes' or string.lower(mystr) == 'true' or mystr == '-1' or mystr == '1':
+ return TRUE
+ elif string.lower(mystr) == 'no' or string.lower(mystr) == 'false' or mystr == '0':
+ return FALSE
+ else:
+ return default
+
+def set_guilevel(str):
+ # 0 = beginner, 1 = normal, 2=expert
+ str = string.lower(str)
+ if str == 'novice' or str == 'beginner' or str == '0':
+ return 'beginner'
+ elif str == 'normal' or str == 'intermediate' or str == '1':
+ return 'normal'
+ elif str == 'advanced' or str == 'expert' or str == '2':
+ return 'advanced'
+ else:
+ print _("Error: I do not know the guilevel '%s'. Please check spelling.") % str
+ sys.exit()
+
+def stripmarks(str):
+ if str[0] == "'" or str[0] == "\"":
+ str = str [1:]
+ if str[-1] == "'" or str[-1] == "\"":
+ str = str [:-1]
+ return str
+
+
+def rc_set(section, arg, rc):
+ try:
+ val= rc.get(section, arg)
+ except ConfigParser.NoSectionError:
+ print _("No section '%s' in config-file. Aborting.") % section
+ sys.exit()
+ except ConfigParser.NoOptionError:
+ print _("No option '%s' in section '%s' of config-file. Aborting.") % arg, section
+ sys.exit()
+ return val
+
+def simplify_txt(text):
+ # Simplify the text by removing the clauses and variables by setting '...' instead.
+ # This is used for the buttons
+ a0 = string.find(text, "[")
+ a1 = string.find(text, "__")
+ if a0 == -1:
+ a = a1
+ elif a1 == -1:
+ a = a0
+ else:
+ a = min(a0,a1)
+
+ if a>0:
+ return text[0:a] + " ..."
+ else:
+ return text
+
+def get_path(file, *paths):
+ # if the file can be found in the cwd, this is returned. if not
+ # the joined filename is returned.
+ # If you just want to expand a pathname like ~, you just submit ~ as file and no path
+ if file[0] == '~':
+ file = os.environ['HOME'] + file[1:]
+ if not paths and os.path.isdir(file):
+ return file
+ if os.path.isfile(file):
+ return file
+ else:
+ for path in paths:
+ if path:
+ if path[0] == '~':
+ path = os.environ['HOME'] + path[1:]
+ joined=os.path.join(path, file)
+ if os.path.isfile(joined):
+ return joined
+
+def mk_adr(ac, addressformats, mycountry=''):
+ adr = ''
+ def mkup_text(text, ac, mycountry=mycountry):
+ save = text
+ try:
+ while 1:
+ start = string.find(text, "__")
+ end = string.find(text, "__", start + 1)
+ if start == -1:
+ break
+ key = text[start+2:end]
+ o_start = string.find(text, '[', 0, end)
+ end_optrange = string.find(text, "__", end+2)
+ if end_optrange == -1:
+ end_optrange = len(text)
+ o_end = string.find(text, ']', o_start, end_optrange)
+ if (o_start <> -1) <> (o_end <> -1):
+ raise error.AddressFormatMalformed, save
+ sys.exit()
+ optional = o_start <> -1
+
+ a = string.replace(text[start:end+2], '__' + key + '__', ac.get_by_name(key))
+
+ if key == 'country' and a == mycountry and optional:
+ a = None
+
+ if a:
+ if optional:
+ text = text[:o_start] + text[o_start+1:start] \
+ + a + text[end+2:o_end] + text[o_end+1:]
+ else:
+ text = text[:start] + a + text[end+2:]
+ else:
+ if optional:
+ text = text[:o_start] + text[o_end+1:]
+ else:
+ text = text[:start] + a + text[end+2:]
+
+ return text
+
+ except error.AddressFormatMalformed, str:
+ print _("There is an error in the clause '%s' of the addressformat in the rc-file. Aborting.") % str
+ sys.exit()
+
+
+ for line in addressformats:
+ line = mkup_text(line, ac)
+ if line:
+ adr = adr + line + "\n"
+ return adr
+
+def file_strip_path(file):
+ return os.path.split(file)[1]
+
+def file_strip_suffix(file):
+ path = os.path.split(file)[0]
+ file = os.path.split(file)[1]
+ file = os.path.splitext(file)[0]
+ file = os.path.join(path, file)
+ return file
+
+def get_path_from_file(file):
+ return os.path.split(file)[0]
+
+def guess_filename(letter, rc):
+ def mkup_text(text, letter, rc): # XXX This routine is very close to mkup_text in mk_adr,
+ # however, i can not see how i could melt them into one
+ # The problem is that mycountry-thing among others
+ while 1:
+ start = string.find(text, "__")
+ end = string.find(text, "__", start + 1)
+ if start == -1:
+ break
+ key = text[start+2:end]
+ o_start = string.find(text, '[', 0, end)
+ end_optrange = string.find(text, "__", end+2)
+ if end_optrange == -1:
+ end_optrange = len(text)
+ o_end = string.find(text, ']', o_start, end_optrange)
+ if (o_start <> -1) <> (o_end <> -1):
+ print "error: there is an error in the guess_filename_format."
+ sys.exit()
+ optional = o_start <> -1
+
+ if key in ('id', 'name_prefix', 'firstname', 'middlename', \
+ 'lastname', 'name_suffix', 'extended', 'post_office', \
+ 'street', 'zip', 'city', 'region', 'country') and len(letter.addresscards) > 1:
+ a = 'series'
+ else:
+ a = string.replace(text[start:end+2], '__' + key + '__', \
+ get_attr_by_name(letter, key, rc))
+ if a:
+ if optional:
+ text = text[:o_start] + text[o_start+1:start] \
+ + a + text[end+2:o_end] + text[o_end+1:]
+ else:
+ text = text[:start] + a + text[end+2:]
+ else:
+ if optional:
+ text = text[:o_start] + text[o_end+1:]
+ else:
+ text = text[:start] + a + text[end+2:]
+
+ return text
+
+ file = mkup_text(rc.filename_guess_format, letter, rc)
+ file = string.replace(file, ' ', '_')
+ file = string.replace(file, ':', '_')
+ file = string.replace(file, '/', '_')
+
+ file = os.path.join(rc.filename_guess_path, file)
+
+ if file[0] == '~':
+ file = os.environ['HOME'] + file[1:]
+
+ if len(os.path.split(file)[1]) > 4:
+ try:
+ if os.path.isfile(file):
+ raise error.FileExists, file
+ except error.FileExists, str:
+ print "File '%s' exists. It will be overwritten." % str
+ return file
+
+
+def get_attr_by_name(letter, key, rc, address_counter = 0):
+ try:
+ if key in ('id', 'name_prefix', 'firstname', 'middlename', \
+ 'lastname', 'name_suffix', 'extended', 'post_office', \
+ 'street', 'zip', 'city', 'region', 'country'):
+ if letter.addresscards:
+ return letter.addresscards[address_counter].get_by_name(key)
+ else:
+ return ''
+ elif key == 'subject':
+ return letter.subject
+ elif key == 'opening':
+ return letter.opening
+ elif key == 'closing':
+ return letter.closing
+ elif key == 'filename':
+ return letter.filename
+ elif key == 'short_filename':
+ return file_strip_suffix(letter.filename)
+ elif key == 'date':
+ return time.strftime(rc.dateformat, time.localtime(time.time()))
+ else:
+ raise error.KeyNotSupported, key
+ except error.KeyNotSupported, str:
+ print _("Key '%s' not supported.") % str
+
+
+def general_mkup_text(letter, text, rc, address_counter = 0):
+ while 1:
+ class clause:
+ def __init__ (self, clause):
+ self.clause=clause
+ def key(self):
+ if string.find(self.clause, '=') > -1:
+ return self.clause[0+2:string.find(self.clause, '=')-2]
+ def param(self):
+ if string.find(self.clause, '=') > -1:
+ return stripmarks(self.clause[string.find(self.clause, '=')+1:string.find(self.clause, ':')])
+ def value(self):
+ if string.find(self.clause, ':') > -1:
+ return stripmarks(self.clause[string.find(self.clause, ':')+1:])
+ def check(self, letter, rc, address_counter):
+ try:
+ err=FALSE
+ if not self.key():
+ err=TRUE
+ if not self.param():
+ err=TRUE
+ if not self.value():
+ err=TRUE
+ if get_attr_by_name(letter, self.key(), rc, address_counter)==None:
+ err=TRUE
+ if err:
+ raise error.MalformedClause, self.clause
+ except error.MalformedClause, clause:
+ print _("The clause '%s' is malformed. Aborting.") % clause
+ sys.exit()
+ while 1:
+ try:
+ br_start = string.find(text, "[")
+ br_end = string.find(text, "]")
+ if (br_start>-1 and not br_end > -1) \
+ or (br_end >-1 and not br_start >-1) \
+ or br_start > br_end:
+ raise error.MalformedClause, text
+ except error.MalformedClause, clause:
+ print _("The clause '%s' is malformed. Aborting.") % clause
+ sys.exit()
+
+ if br_start > -1:
+ cl = clause(text[br_start+1:br_end])
+ cl.check(letter, rc, address_counter)
+ if get_attr_by_name(letter, cl.key(), rc, address_counter) == cl.param():
+ text = text[0:br_start] + cl.value() + text[br_end+1:]
+ else:
+ text = text[0:br_start] + text[br_end+1:]
+ else:
+ break
+
+ start = string.find(text, "__")
+ end = string.find(text, "__", start + 1)
+ if start == -1:
+ break
+
+ key = text[start+2:end]
+
+ text = string.replace(text, '__' + key + '__', \
+ get_attr_by_name(letter, key, rc, address_counter))
+
+ return text
diff --git a/support/gtex-letter/wmark.jpg b/support/gtex-letter/wmark.jpg
new file mode 100644
index 0000000000..279e58024e
--- /dev/null
+++ b/support/gtex-letter/wmark.jpg
Binary files differ