summaryrefslogtreecommitdiffstats
path: root/pychathans
diff options
context:
space:
mode:
authorRajeesh K Nambiar <rajeeshknambiar@gmail.com>2009-01-10 20:51:12 +0530
committerRajeesh K Nambiar <rajeeshknambiar@gmail.com>2009-01-10 20:51:12 +0530
commitebc64dbecc9fa87fdcd8a8fe2b0b2bb8443039bc (patch)
tree981b671aca203c87288a674a9400603b109e2b61 /pychathans
parentb7212c3ff2e4598c6b2c32a8b1803d1508ea94fb (diff)
downloadRachana.git-ebc64dbecc9fa87fdcd8a8fe2b0b2bb8443039bc.tar.gz
Rachana.git-ebc64dbecc9fa87fdcd8a8fe2b0b2bb8443039bc.tar.xz
Rachana.git-ebc64dbecc9fa87fdcd8a8fe2b0b2bb8443039bc.zip
Create Unicode filename automatically if not given
Diffstat (limited to 'pychathans')
-rw-r--r--pychathans/chathans.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/pychathans/chathans.py b/pychathans/chathans.py
index fa02742..eab4c8d 100644
--- a/pychathans/chathans.py
+++ b/pychathans/chathans.py
@@ -131,32 +131,30 @@ class Chathans (gtk.Window):
self.UnicodeFile = self.unicode_btn.get_filename()
if ( self.AsciiFile == None
- or self.MappingFile == None
- or self.UnicodeFile == None ):
+ or self.MappingFile == None ):
dlg = gtk.MessageDialog(self.get_toplevel(),
gtk.DIALOG_MODAL,
gtk.MESSAGE_INFO,
gtk.BUTTONS_OK,
- "Please select all the files")
+ "Please select both ASCII file and Mapping file")
dlg.run()
dlg.destroy()
return
- # Check the extenstion of ASCII file for Text/PDF '''
- #(inp_file, inp_ext) = os.path.splitext(self.AsciiFile)
- #if string.upper(inp_ext) == ".PDF":
- # self.PdfFile = self.AsciiFile
- # self.AsciiFile = None
+ if self.UnicodeFile == None:
+ (inp_file, inp_ext) = os.path.splitext(self.AsciiFile)
+ self.UnicodeFile = inp_file + "-unicode" + ".txt"
# ഓഹ്, പയ്യന്‍! നീ വ്യാഘ്രമാകുന്നു.
payyan = Payyans(self.AsciiFile, self.UnicodeFile, self.MappingFile)
payyan.ascii2unicode()
# കത്തിച്ചു കഴിഞ്ഞു.
+ msg = "Coversion Done - Unicode file :" + self.UnicodeFile
dlg = gtk.MessageDialog(self.get_toplevel(),
gtk.DIALOG_MODAL,
gtk.MESSAGE_INFO,
gtk.BUTTONS_OK,
- "Conversion Done !!")
+ msg)
dlg.run()
dlg.destroy()