diff options
author | Rajeesh K Nambiar <rajeeshknambiar@gmail.com> | 2009-02-01 10:39:16 +0530 |
---|---|---|
committer | Rajeesh K Nambiar <rajeeshknambiar@gmail.com> | 2009-02-01 10:39:16 +0530 |
commit | e25411a0451ce78b31350d42bd9527dad59d59ba (patch) | |
tree | 455ab90d202e7bec4dd255a44b946c796191cdac /pychathans | |
parent | cb32ee0447403aad868169bb5acecc8764dbf8c1 (diff) | |
download | AnjaliOldLipi.git-e25411a0451ce78b31350d42bd9527dad59d59ba.tar.gz AnjaliOldLipi.git-e25411a0451ce78b31350d42bd9527dad59d59ba.tar.xz AnjaliOldLipi.git-e25411a0451ce78b31350d42bd9527dad59d59ba.zip |
Chathans: Add functionality for giving output filename from file chooser
Diffstat (limited to 'pychathans')
-rwxr-xr-x | pychathans/chathans.py | 61 | ||||
-rw-r--r-- | pychathans/po/chathans-ml.po | 117 | ||||
-rw-r--r-- | pychathans/po/chathans.pot | 78 |
3 files changed, 158 insertions, 98 deletions
diff --git a/pychathans/chathans.py b/pychathans/chathans.py index ee34c3a..dc90840 100755 --- a/pychathans/chathans.py +++ b/pychathans/chathans.py @@ -34,7 +34,7 @@ try: from payyans import Payyans except ImportError: ''' ഹൈയ്, പയ്യന്റെ ദുര്ജ്ജനസംസര്ഗ്ഗമില്ലാതെ നോം സാധനം തൊടാറില്ല! ''' - print _("Chathans require Payyans") + print _("Chathans requires Payyans") raise SystemExit @@ -44,7 +44,7 @@ gettext.textdomain(PACKAGE) #_ = gettext.gettext name = _("Chathans") -version = "0.4" +version = "0.5" title = name + " " + version @@ -72,9 +72,13 @@ class Chathans (gtk.Window): unicode_lbl = gtk.Label(_("Unicode File : ")) # പ്രമാണോം പത്രോം ആധാരോം എടുക്ക്വാ.. - ascii_btn = gtk.FileChooserButton(_("Select the ASCII File (.txt,.pdf)")) + #ascii_btn = gtk.FileChooserButton(_("Select the ASCII File (.txt,.pdf)")) + ascii_btn = gtk.Button("ASCII File...",None) + ascii_btn.connect("clicked", self.__choose_ascii_file) + unicode_btn = gtk.Button("Unicode File...",None) + unicode_btn.connect("clicked", self.__choose_unicode_file) mapping_btn = gtk.FileChooserButton(_("Select the ASCII-Unicode Mapping File")) - unicode_btn = gtk.FileChooserButton(_("Select Output Unicode File")) + #unicode_btn = gtk.FileChooserButton(_("Select Output Unicode File")) # ആസ്കി-യൂണിക്കോഡ് ആണോ, അതോ യൂണിക്കോഡ്-ആസ്കിയോ? a2u_radio = gtk.RadioButton(None, (_("ASCII-to-Unicode"))) @@ -92,13 +96,6 @@ class Chathans (gtk.Window): about_btn = gtk.Button(_("About"), gtk.STOCK_ABOUT) about_btn.connect("clicked", self.__show_about) - # Add File Filter for ASCII input file. അരിപ്പ! - ascii_filter = gtk.FileFilter() - ascii_filter.set_name("*.txt,*.pdf") - ascii_filter.add_pattern("*.[Tt][Xx][Tt]") - ascii_filter.add_pattern("*.[Pp][Dd][Ff]") - ascii_btn.add_filter(ascii_filter) - self.a2u_radio = a2u_radio self.u2a_radio = u2a_radio @@ -148,11 +145,49 @@ class Chathans (gtk.Window): self.show_all() + def __choose_ascii_file(self, event): + if self.u2a_radio.get_active() == True: + the_action = gtk.FILE_CHOOSER_ACTION_SAVE + else: + the_action = gtk.FILE_CHOOSER_ACTION_OPEN + filechooser = gtk.FileChooserDialog(title=_("Select the ASCII File (.txt,.pdf)"), + action=the_action, + buttons=(gtk.STOCK_OPEN, gtk.RESPONSE_ACCEPT, + gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) + # Add File Filter for ASCII input file. അരിപ്പ! + ascii_filter = gtk.FileFilter() + ascii_filter.set_name("*.txt,*.pdf") + ascii_filter.add_pattern("*.[Tt][Xx][Tt]") + ascii_filter.add_pattern("*.[Pp][Dd][Ff]") + filechooser.add_filter(ascii_filter) + filechooser.connect("response", self.__get_file, "a") + filechooser.run() + + def __get_file(self, dialog, response, in_data): + dialog.hide() + if response == gtk.RESPONSE_ACCEPT: + if in_data == "a": + self.AsciiFile = dialog.get_filename() + else: + self.UnicodeFile = dialog.get_filename() + + def __choose_unicode_file(self, event): + if self.a2u_radio.get_active() == True: + the_action = gtk.FILE_CHOOSER_ACTION_SAVE + else: + the_action = gtk.FILE_CHOOSER_ACTION_OPEN + filechooser = gtk.FileChooserDialog(title=_("Select the Unicode File"), + action=the_action, + buttons=(gtk.STOCK_OPEN, gtk.RESPONSE_ACCEPT, + gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) + filechooser.connect("response", self.__get_file, "u") + filechooser.run() + def __convert_file(self, event): ''' പയ്യനെ വിളിക്ക്യാ, ഇനി നോം ഗ്യാലറിയിലിരുന്ന് കളി കാണട്ടെ. ''' - self.AsciiFile = self.ascii_btn.get_filename() + #self.AsciiFile = self.ascii_btn.get_filename() self.MappingFile = self.mapping_btn.get_filename() - self.UnicodeFile = self.unicode_btn.get_filename() + #self.UnicodeFile = self.unicode_btn.get_filename() if self.a2u_radio.get_active() == True: direction = "a2u" diff --git a/pychathans/po/chathans-ml.po b/pychathans/po/chathans-ml.po index 5a72472..e96e0dd 100644 --- a/pychathans/po/chathans-ml.po +++ b/pychathans/po/chathans-ml.po @@ -1,109 +1,122 @@ -# Chathans Malayalam Localization file. +# Chathans Localization Template File. # Copyright (C) 2009 Rajeesh K Nambiar # This file is distributed under the same license as Chathans package. # Rajeesh K Nambiar <rajeeshknambiar@gmail.com>, 2009. # +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: 0.2\n" +"Project-Id-Version: Chathans 0.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-01-24 14:26+0530\n" -"PO-Revision-Date: 2009-01-24 15:01+0530\n" +"POT-Creation-Date: 2009-02-01 10:21+0530\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Rajeesh K Nambiar <rajeeshknambiar@gmail.com>\n" -"Language-Team: ml\n" +"Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: chathans.py:29 +#: chathans.py:30 msgid "Chathans requires PyGTK" -msgstr "ചാത്തന്സിന് PyGTK ആവശ്യമാണ്" +msgstr "ചാത്തന്സിന് pygtk ആവശ്യമാണ്" -#: chathans.py:36 -msgid "Chathans require Payyans" +#: chathans.py:37 +msgid "Chathans requires Payyans" msgstr "ചാത്തന്സിന് പയ്യന്സ് ആവശ്യമാണ്" -#: chathans.py:45 +#: chathans.py:46 msgid "Chathans" msgstr "ചാത്തന്സ്" -#: chathans.py:69 +#: chathans.py:70 msgid "ASCII File : " msgstr "ആസ്കി ഫയല്" -#: chathans.py:70 +#: chathans.py:71 msgid "Mapping File : " msgstr "മാപ്പിങ്ങ് ഫയല്" -#: chathans.py:71 +#: chathans.py:72 msgid "Unicode File : " msgstr "യൂണിക്കോഡ് ഫയല്" -#: chathans.py:74 -msgid "Select the ASCII File (.txt,.pdf)" -msgstr "ആസ്കി ഫയല് തിരഞ്ഞെടുക്കൂ" - -#: chathans.py:75 +#: chathans.py:80 msgid "Select the ASCII-Unicode Mapping File" -msgstr "ആസ്കി-യൂണിക്കോഡ് മാപ്പിങ്ങ് ഫയല് തിരഞ്ഞെടുക്കൂ" +msgstr "ആസ്കി-യുണിക്കോഡ് മാപ്പിങ്ങ് ഫയല് തിരഞ്ഞെടുക്കുക" + +#: chathans.py:84 +msgid "ASCII-to-Unicode" +msgstr "ആസ്കി-യൂണിക്കോഡ്" -#: chathans.py:76 -msgid "Select Output Unicode File" -msgstr "ഉണ്ടാക്കേണ്ട യൂണീക്കോഡ് ഫയല് തിരഞ്ഞെടുക്കൂ" +#: chathans.py:85 +msgid "Unicode-to-ASCII" +msgstr "യൂണിക്കോഡ്-ആസ്കി" -#: chathans.py:83 +#: chathans.py:92 msgid "Convert" msgstr "പരിവര്ത്തനം ചെയ്യുക" -#: chathans.py:85 +#: chathans.py:94 msgid "Quit" -msgstr "പുറത്തുകടക്കുക" +msgstr "പുറത്ത് പോവുക" -#: chathans.py:87 +#: chathans.py:96 msgid "About" msgstr "സംബന്ധിച്ച്" -#: chathans.py:149 -msgid "Please select both ASCII file and Mapping file" -msgstr "ദയവായി ആസ്കി ഫയലും മാപ്പിങ്ങ് ഫയലും തിരഞ്ഞെടുക്കുക" +#: chathans.py:153 +msgid "Select the ASCII File (.txt,.pdf)" +msgstr "ആസ്കി ഫയല് (.txt,.pdf) തിരഞ്ഞെടുക്കുക" + +#: chathans.py:179 +msgid "Select the Unicode File" +msgstr "യൂണിക്കോഡ് ഫയല് തിരഞ്ഞെടുക്കുക" + +#: chathans.py:207 +msgid "Please select both Input file and Mapping file" +msgstr "ദയവായി പരിവര്ത്തനം ചെയ്യേണ്ട ഫയലും മാപ്പിങ്ങ് ഫയലും തിരഞ്ഞെടുക്കുക" + +#: chathans.py:229 +msgid "Coversion Done - Unicode file : " +msgstr "പരിവര്ത്തനം ചെയ്തു കഴിഞ്ഞു - യൂണിക്കോഡ് ഫയല് : " -#: chathans.py:163 -msgid "Coversion Done - Unicode file :" -msgstr "പരിവര്ത്തനം ചെയ്തു കഴിഞ്ഞു - യൂണിക്കോഡ് ഫയല് :" +#: chathans.py:231 +msgid "Conversion Done - ASCII file : " +msgstr "പരിവര്ത്തനം ചെയ്തു കഴിഞ്ഞു - ആസ്കി ഫയല് : " -#: chathans.py:165 +#: chathans.py:233 msgid "Could not find the pdftotext utility. Exiting..." -msgstr "pdftotext ഉപാധി കണ്ടെത്താന് കഴിഞ്ഞില്ല. നിര്ത്തുന്നു..." +msgstr "pdftotext ഉപാധി കണ്ടെത്താന് സാധിച്ചില്ല. നിര്ത്തുന്നു..." -#: chathans.py:167 +#: chathans.py:235 msgid "Syntax Error in Mapping file. Exiting..." -msgstr "മാപ്പിങ്ങ് ഫയലില് വ്യാകരണ പിശകുണ്ട്. നിര്ത്തുന്നു..." +msgstr "മാപ്പിങ്ങ് ഫയലില് വ്യാകരണപ്പിശകുണ്ട്. നിര്ത്തുന്നു..." -#: chathans.py:182 +#: chathans.py:250 msgid "Chathans: Rajeesh K Nambiar <rajeeshknambiar@gmail.com>" -msgstr "ചാത്തന്സ്: രജീഷ് കെ നമ്പ്യാര് <rajeeshknambiar@gmail.com>" +msgstr "ചാത്തന്സ് : രജീഷ് കെ നമ്പ്യാര് <rajeeshknambiar@gmail.com>" -#: chathans.py:183 +#: chathans.py:251 msgid "" "Payyans : Santhosh Thottingal, Nishan Naseer,\n" "\t\t Manu S Madhav, Rajeesh K Nambiar" msgstr "" -"പയ്യന്സ് : സന്തോഷ് തോട്ടിങ്ങല്, നിഷാന് നസീര്,\n" -"\t\t മനു എസ് മാധവ്, രജീഷ് കെ നമ്പ്യാര്" +"പയ്യന്സ് : സന്തോഷ് തോട്ടിങ്ങല്, നിഷാന് നസീര്,\n" +"\t\t മനു എസ് മാധവ്, രജീഷ് കെ നമ്പ്യാര്" -#: chathans.py:185 -msgid "Chathans is an easy to use GUI frontend to Payyans ASCII<->Unicode Converter" -msgstr "ചാത്തന്സ് ഉപയോഗിക്കാന് എളുപ്പമുള്ള, പയ്യന്സ് എന്ന ആസ്കി<->യൂണിക്കോഡ് പരിവര്ത്തകനു വേണ്ടിയുള്ള ഒരു അഭിമുഖീകരണ ഉപാധിയാണ്." - -#: chathans.py:190 +#: chathans.py:253 +msgid "" +"Chathans is an easy to use GUI frontend to Payyans ASCII<->Unicode Converter" +msgstr "" +"ചാത്തന്സ് ഉപയോഗിക്കാന് എളുപ്പമുള്ള, പയ്യന്സ് ആസ്കി<->യൂണിക്കോഡ് പരിവര്ത്തകനു വേണ്ടിയുള്ള ഒരു അഭിമുഖോപാധിയാണ്" +#: chathans.py:258 msgid "Copyright (c) Rajeesh K Nambiar" msgstr "പകര്പ്പവകാശം (c) രജീഷ് കെ നമ്പ്യാര്" -#: chathans.py:191 +#: chathans.py:259 msgid "Chathans is licensed under GNU GPL version 3" -msgstr "ചാത്തന്സ് ഗ്നു GPLന്റെ മൂന്നാം പതിപ്പിനാല് സംരക്ഷിക്കപ്പെട്ടിരിക്കുന്നു" +msgstr "ചാത്തന്സ് ഗ്നു ജിപിഎല് മൂന്നാം പതിപ്പു പ്രകാരം സംരക്ഷിക്കപ്പെട്ടിരിക്കുന്നു" -#: chathans.py:203 +#: chathans.py:271 msgid "Do you really want to Quit?" -msgstr "പുറത്തു കടക്കണമെന്ന് താങ്കള്ക്ക് തീര്ച്ചയാണോ?" - +msgstr "പുറത്ത് കടക്കണമെന്ന് താങ്കള്ക്ക് തീര്ച്ചയാണോ?" diff --git a/pychathans/po/chathans.pot b/pychathans/po/chathans.pot index 7dcb80f..b747d0b 100644 --- a/pychathans/po/chathans.pot +++ b/pychathans/po/chathans.pot @@ -1,14 +1,14 @@ -# Chathans Localization template file. -# Copyright (c) 2009 Rajeesh K Nambiar -# This file is distributed under the same license as Chathans package. -# Rajeesh K Nambiar <rajeeshknambiar@gmail.com>, 2009. +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-01-24 14:26+0530\n" +"POT-Creation-Date: 2009-02-01 10:21+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,93 +16,105 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: chathans.py:29 +#: chathans.py:30 msgid "Chathans requires PyGTK" msgstr "" -#: chathans.py:36 -msgid "Chathans require Payyans" +#: chathans.py:37 +msgid "Chathans requires Payyans" msgstr "" -#: chathans.py:45 +#: chathans.py:46 msgid "Chathans" msgstr "" -#: chathans.py:69 +#: chathans.py:70 msgid "ASCII File : " msgstr "" -#: chathans.py:70 +#: chathans.py:71 msgid "Mapping File : " msgstr "" -#: chathans.py:71 +#: chathans.py:72 msgid "Unicode File : " msgstr "" -#: chathans.py:74 -msgid "Select the ASCII File (.txt,.pdf)" +#: chathans.py:80 +msgid "Select the ASCII-Unicode Mapping File" msgstr "" -#: chathans.py:75 -msgid "Select the ASCII-Unicode Mapping File" +#: chathans.py:84 +msgid "ASCII-to-Unicode" msgstr "" -#: chathans.py:76 -msgid "Select Output Unicode File" +#: chathans.py:85 +msgid "Unicode-to-ASCII" msgstr "" -#: chathans.py:83 +#: chathans.py:92 msgid "Convert" msgstr "" -#: chathans.py:85 +#: chathans.py:94 msgid "Quit" msgstr "" -#: chathans.py:87 +#: chathans.py:96 msgid "About" msgstr "" -#: chathans.py:149 -msgid "Please select both ASCII file and Mapping file" +#: chathans.py:153 +msgid "Select the ASCII File (.txt,.pdf)" +msgstr "" + +#: chathans.py:179 +msgid "Select the Unicode File" +msgstr "" + +#: chathans.py:207 +msgid "Please select both Input file and Mapping file" +msgstr "" + +#: chathans.py:229 +msgid "Coversion Done - Unicode file : " msgstr "" -#: chathans.py:163 -msgid "Coversion Done - Unicode file :" +#: chathans.py:231 +msgid "Conversion Done - ASCII file : " msgstr "" -#: chathans.py:165 +#: chathans.py:233 msgid "Could not find the pdftotext utility. Exiting..." msgstr "" -#: chathans.py:167 +#: chathans.py:235 msgid "Syntax Error in Mapping file. Exiting..." msgstr "" -#: chathans.py:182 +#: chathans.py:250 msgid "Chathans: Rajeesh K Nambiar <rajeeshknambiar@gmail.com>" msgstr "" -#: chathans.py:183 +#: chathans.py:251 msgid "" "Payyans : Santhosh Thottingal, Nishan Naseer,\n" "\t\t Manu S Madhav, Rajeesh K Nambiar" msgstr "" -#: chathans.py:185 +#: chathans.py:253 msgid "" "Chathans is an easy to use GUI frontend to Payyans ASCII<->Unicode Converter" msgstr "" -#: chathans.py:190 +#: chathans.py:258 msgid "Copyright (c) Rajeesh K Nambiar" msgstr "" -#: chathans.py:191 +#: chathans.py:259 msgid "Chathans is licensed under GNU GPL version 3" msgstr "" -#: chathans.py:203 +#: chathans.py:271 msgid "Do you really want to Quit?" msgstr "" |