pyXAMPP is a simple foolish XAMPP for Linux Control Panel (see http://www.apachefriends.org). This is is a simple dialog to start, stop and reload the XAMPP server. This is pure writed in python and GTK+. Please install python and GTK+ to used it.

Screenshoot

pyXAMPP – main dialog

pyXAMPP – About dialog

Sourcecode


#!/usr/bin/python

# pyXAMPP Control Panel
#
# a simple foolish Linux XAMPP Control Panel (dont blame me please 😀 )
#
#
# author: Luthfi Emka <luthfi@emka.web.id>
# website: http://code.emka.web.id/index.php/pyxampp
# version: 0.1


import gtk
import subprocess

class PyApp(gtk.Window): 
    def __init__(self):
        super(PyApp, self).__init__()
        
        self.set_size_request(400, 200)
        self.set_position(gtk.WIN_POS_CENTER)
        self.connect("destroy", gtk.main_quit)
        self.set_title("pyXAMPP Control Panel")
        
        
        table = gtk.Table(2, 2, True);
        
        startlampp	= gtk.Button("Start Apache-MySQL")
        stoplampp	= gtk.Button("Stop Apache-MySQL")
        restartlampp	= gtk.Button("Restart Apache-MySQL")
        aboutdlg	= gtk.Button("About")

        
        startlampp.connect("clicked", self.on_startlampp)
        stoplampp.connect("clicked", self.on_stoplampp)
        restartlampp.connect("clicked", self.on_restartlampp)
        aboutdlg.connect("clicked", self.on_aboutdlg)
        
        table.attach(startlampp, 0, 1, 0, 1)
        table.attach(stoplampp, 1, 2, 0, 1)
        table.attach(restartlampp, 0, 1, 1, 2)
        table.attach(aboutdlg, 1, 2, 1, 2)
        
        
        self.add(table)
        self.show_all()

    def on_startlampp(self, widget):
        md = gtk.MessageDialog(self, 
            gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, 
            gtk.BUTTONS_CLOSE, "Apache-MySQL server started...")
        subprocess.call(["/opt/lampp/lampp", "start"]);
        md.run()
        md.destroy()
        
    
    def on_stoplampp(self, widget):
        md = gtk.MessageDialog(self, 
            gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, 
            gtk.BUTTONS_CLOSE, "Apache-MySQL server stopped...")
        subprocess.call(["/opt/lampp/lampp", "stop"]);
        md.run()
        md.destroy()
    
    
    
    def on_restartlampp(self, widget):
        md = gtk.MessageDialog(self, 
            gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, 
            gtk.BUTTONS_CLOSE, "Apache-MySQL server restarted...")
        subprocess.call(["/opt/lampp/lampp", "restart"]);
        md.run()
        md.destroy()
    
    
    def on_aboutdlg(self, widget):
        md = gtk.MessageDialog(self, 
            gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, 
            gtk.BUTTONS_CLOSE, "v0.1 \n\npyXAMPP Control Panel is a simple foolish control panel for XAMPP Linux. \n\n(c) 2012 Luthfi Emka, emka.web.id. \nLicense: GPLv2. \n\nhttp://code.emka.web.id/index.php/pyxampp")
        md.run()
        md.destroy()
    

PyApp()
gtk.main()

Download

via emka.web.id: http://emka.web.id/wp-content/uploads/2012/10/xampp-panel.zip

See yaa…

No comments

Leave a Reply

%d bloggers like this: