* src/plugins/WriteGedcom.py: Allow iso-8859-1 (ANSI) encoding

* src/plugins/gedcomexport.glade: Allow iso-8859-1 (ANSI) encoding


svn: r1772
This commit is contained in:
Don Allingham 2003-06-24 23:07:14 +00:00
parent a6c96b70ef
commit b6fe7af0c8
2 changed files with 49 additions and 31 deletions

View File

@ -62,6 +62,9 @@ from QuestionDialog import ErrorDialog
def keep_utf8(s): def keep_utf8(s):
return s return s
def iso8859(s):
return s.encode('iso-8859-1')
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Calendar month names # Calendar month names
@ -447,6 +450,8 @@ class GedcomWriter:
if self.topDialog.get_widget("ansel").get_active(): if self.topDialog.get_widget("ansel").get_active():
self.cnvtxt = ansel_utf8.utf8_to_ansel self.cnvtxt = ansel_utf8.utf8_to_ansel
elif self.topDialog.get_widget("ansi").get_active():
self.cnvtxt = iso8859
else: else:
self.cnvtxt = keep_utf8 self.cnvtxt = keep_utf8
@ -557,6 +562,8 @@ class GedcomWriter:
self.g.write("1 DATE %s %s %s\n" % (date[2],string.upper(date[1]),date[4])) self.g.write("1 DATE %s %s %s\n" % (date[2],string.upper(date[1]),date[4]))
if self.cnvtxt == ansel_utf8.utf8_to_ansel: if self.cnvtxt == ansel_utf8.utf8_to_ansel:
self.g.write("1 CHAR ANSEL\n") self.g.write("1 CHAR ANSEL\n")
elif self.cnvtxt == iso8859:
self.g.write("1 CHAR ANSI\n")
else: else:
self.g.write("1 CHAR UTF-8\n") self.g.write("1 CHAR UTF-8\n")
self.g.write("1 SUBM @SUBM@\n") self.g.write("1 SUBM @SUBM@\n")

View File

@ -91,7 +91,7 @@
<widget class="GtkTable" id="table3"> <widget class="GtkTable" id="table3">
<property name="border_width">12</property> <property name="border_width">12</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">11</property> <property name="n_rows">12</property>
<property name="n_columns">3</property> <property name="n_columns">3</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
@ -144,8 +144,8 @@
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">6</property> <property name="top_attach">7</property>
<property name="bottom_attach">7</property> <property name="bottom_attach">8</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -172,8 +172,8 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">6</property> <property name="top_attach">7</property>
<property name="bottom_attach">7</property> <property name="bottom_attach">8</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -200,8 +200,8 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">7</property> <property name="top_attach">8</property>
<property name="bottom_attach">8</property> <property name="bottom_attach">9</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -230,8 +230,8 @@
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">7</property> <property name="top_attach">8</property>
<property name="bottom_attach">8</property> <property name="bottom_attach">9</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -258,8 +258,8 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">8</property> <property name="top_attach">9</property>
<property name="bottom_attach">9</property> <property name="bottom_attach">10</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -306,8 +306,8 @@
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">8</property> <property name="top_attach">9</property>
<property name="bottom_attach">9</property> <property name="bottom_attach">10</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -378,8 +378,8 @@
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">5</property> <property name="top_attach">6</property>
<property name="bottom_attach">6</property> <property name="bottom_attach">7</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -400,8 +400,8 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">9</property> <property name="top_attach">10</property>
<property name="bottom_attach">10</property> <property name="bottom_attach">11</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -422,8 +422,8 @@
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">3</property> <property name="right_attach">3</property>
<property name="top_attach">10</property> <property name="top_attach">11</property>
<property name="bottom_attach">11</property> <property name="bottom_attach">12</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -473,6 +473,29 @@
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkRadioButton" id="ansi">
<property name="border_width">2</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">AN_SI (ISO-8859-1)</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">ansel</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -655,10 +678,6 @@
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
<property name="fraction">0</property> <property name="fraction">0</property>
<property name="pulse_step">0.1</property> <property name="pulse_step">0.1</property>
<property name="activity_mode">False</property>
<property name="show_text">False</property>
<property name="text_xalign">0.5</property>
<property name="text_yalign">0.5</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
@ -675,10 +694,6 @@
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
<property name="fraction">0</property> <property name="fraction">0</property>
<property name="pulse_step">0.1</property> <property name="pulse_step">0.1</property>
<property name="activity_mode">False</property>
<property name="show_text">False</property>
<property name="text_xalign">0.5</property>
<property name="text_yalign">0.5</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
@ -695,10 +710,6 @@
<property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
<property name="fraction">0</property> <property name="fraction">0</property>
<property name="pulse_step">0.1</property> <property name="pulse_step">0.1</property>
<property name="activity_mode">False</property>
<property name="show_text">False</property>
<property name="text_xalign">0.5</property>
<property name="text_yalign">0.5</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>