da ich keinen freien Mysql Beautifier fand, habe ich mir die Mühe gemacht, einen Beautifier auf Javascript Basis zu schreiben. Der funktioniert auch soweit.
Das Teil habe ich anschließend in eine html Seite gepackt und per python-webkit/gtk aufgerufen.
Probleme:
- Leider setzt er keinen Seitentitel
Beim Resize ist er mehr als lahm
Der thread wird nicht sauber beendet, wenn man schließt, da hilft nur control c im terminal
Hier der Code:
(Hab Archlinux am laufen, daher python2 als env)
Code: Alles auswählen
#!/usr/bin/env python2
#
# Copyright (C) 20010 by Sebastian Sauer <info@dynpages.de>
#
# MySql Beautifier is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License V3 as published by
# the Free Software Foundation;
#
# MySql Beautifier 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 MySql Beautifier; If not, see <http://www.gnu.org/licenses/>.
#
import gtk
import webkit
class BrowserInstance:
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title('MySQL Beautifier')
self.window.connect('destroy', self.destroy)
self.window.connect('delete_event', self.delete_event)
def launch(self):
window = gtk.Window()
box = gtk.VBox(homogeneous=False, spacing=0)
browser = webkit.WebView()
window.set_default_size(800, 700)
window.add(box)
box.pack_start(browser, expand=True, fill=True, padding=0)
window.show_all()
self.window.set_border_width(10)
browser.open('file:///home/basti/pages/mysql-beautifier/index.html')
return browser
def main(self):
gtk.main()
def delete_event(self, widget, event, data=None):
return false
def destroy(self, widget, data=None):
gtk.main_quit()
if __name__ == "__main__":
try:
browser = BrowserInstance()
browser.launch()
browser.main()
#set_title('MySQL Beautifier')
except:
pass
edit: Hilfe jeder Art ist nat. auch willkommen