Hi All,
I did a short work around online and gather information to write this script.
The objective is to propose a GUI for the nice ovniconv script done by ProgFou. to make it easier to use by end-users without shell knowledge
The script open a odt file and convert it using ovniconv, using GTK+ filebrowse method.
It works but it's still an early version
Will be nice to have :
Include a condition
if file = doc , then convert to odt and ovniconv
if file = odt then ovniconv
select path to save it
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
if gtk.pygtk_version < (2,3,90):
print "PyGtk 2.3.90 or later required for this example"
raise SystemExit
dialog = gtk.FileChooserDialog("Open..",
None,
gtk.FILE_CHOOSER_ACTION_OPEN,
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK))
dialog.set_default_response(gtk.RESPONSE_OK)
filter = gtk.FileFilter()
filter.set_name("ODT Files")
filter.add_pattern("*.odt")
dialog.add_filter(filter)
response = dialog.run()
if response == gtk.RESPONSE_OK:
FileName = dialog.get_filename()
import os
my_command = "ovniconv "+FileName
os.system(my_command)
elif response == gtk.RESPONSE_CANCEL:
print 'Closed, no files selected'
dialog.destroy()
Your input are welcome
Stephane Masse
IT Director
The Apple tree Group
18HBT , 18 Hai Ba Trung, District 1 , Ho Chi Minh City , Vietnam
http://www.appletree-asia.com