Merge lp:~alfred-maghi/rapache/rapache-ubuntu10.04 into lp:rapache

Proposed by Alfred Maghi
Status: Needs review
Proposed branch: lp:~alfred-maghi/rapache/rapache-ubuntu10.04
Merge into: lp:rapache
Diff against target: 166 lines (+49/-13)
6 files modified
AUTHORS (+1/-0)
Glade/main.glade (+1/-1)
RapacheCore/Apache.py (+10/-4)
RapacheCore/Shell.py (+21/-0)
RapacheGtk/RapacheGui.py (+12/-5)
setup.py (+4/-3)
To merge this branch: bzr merge lp:~alfred-maghi/rapache/rapache-ubuntu10.04
Reviewer Review Type Date Requested Status
Rapache Developers Pending
Review via email: mp+25699@code.launchpad.net

Description of the change

fix start/stop/restart-apache feature, fix location of glade files and icon.

To post a comment you must log in.

Unmerged revisions

95. By Alfred Maghi

fix start/stop/restart-apache feature, fix location of glade files and icon.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2008-09-15 02:30:54 +0000
+++ AUTHORS 2010-05-20 16:23:24 +0000
@@ -16,6 +16,7 @@
1616
17Rapache Developers Team:17Rapache Developers Team:
1818
19 * Alfred Maghi <alfred.maghi@gmail.com>
19 * Stefano Forenza <tacone@gmail.com>20 * Stefano Forenza <tacone@gmail.com>
20 * Emanuele Gentili <emgent@ubuntu.com>21 * Emanuele Gentili <emgent@ubuntu.com>
21 * Damiano Di Carlo <damianodicarlo@gmail.com>22 * Damiano Di Carlo <damianodicarlo@gmail.com>
2223
=== modified file 'Glade/main.glade'
--- Glade/main.glade 2008-09-15 04:55:10 +0000
+++ Glade/main.glade 2010-05-20 16:23:24 +0000
@@ -105,7 +105,7 @@
105 <property name="visible">True</property>105 <property name="visible">True</property>
106 <property name="label" translatable="yes">_Start Apache</property>106 <property name="label" translatable="yes">_Start Apache</property>
107 <property name="use_underline">True</property>107 <property name="use_underline">True</property>
108 <signal name="activate" handler="please_restart"/>108 <signal name="activate" handler="please_start"/>
109 <child internal-child="image">109 <child internal-child="image">
110 <widget class="GtkImage" id="menu-item-image7">110 <widget class="GtkImage" id="menu-item-image7">
111 <property name="stock">gtk-media-play</property>111 <property name="stock">gtk-media-play</property>
112112
=== modified file 'RapacheCore/Apache.py'
--- RapacheCore/Apache.py 2008-09-15 04:16:47 +0000
+++ RapacheCore/Apache.py 2010-05-20 16:23:24 +0000
@@ -40,16 +40,22 @@
40 return False40 return False
4141
42 def start(self):42 def start(self):
43 Shell.command.sudo_execute(["apache2ctl", "start"])43 Shell.command.gksudo(
44 "gksudo service apache2 start",
45 "Apache http server will be started with the command:")
44 return46 return
45 47
46 def stop(self):48 def stop(self):
47 #Shell.command.sudo_execute(["apache2ctl", "-k", "graceful"])49 Shell.command.gksudo(
48 Shell.command.sudo_execute(["apache2ctl", "stop"])50 "gksudo service apache2 stop",
51 "Apache http server will be stopped with the command:",
52 "warning")
49 return53 return
50 54
51 def restart(self):55 def restart(self):
52 Shell.command.sudo_execute(["apache2ctl", "graceful"])56 Shell.command.gksudo(
57 "gksudo service apache2 restart",
58 "Apache http server will be restarted with the command:")
53 return59 return
54 60
55 def test_config(self):61 def test_config(self):
5662
=== modified file 'RapacheCore/Shell.py'
--- RapacheCore/Shell.py 2008-09-08 00:18:34 +0000
+++ RapacheCore/Shell.py 2010-05-20 16:23:24 +0000
@@ -43,6 +43,7 @@
43import glob43import glob
44import operator44import operator
45import Configuration45import Configuration
46import gtk
4647
47class CommandLogEntry:48class CommandLogEntry:
4849
@@ -289,6 +290,26 @@
289 def ask_password(self, description = "Super user priviledges are required to perform this operation"):290 def ask_password(self, description = "Super user priviledges are required to perform this operation"):
290 res = self.sudo_execute( ['echo'], description = "Super user priviledges are required to perform this operation" )291 res = self.sudo_execute( ['echo'], description = "Super user priviledges are required to perform this operation" )
291 return res[0] == 0292 return res[0] == 0
293
294 # gksudo is used to start/stop apache and mysql services
295 def gksudo(self, cmd, comment, msg = "info"):
296 if (msg=="info"):
297
298 dialog = gtk.MessageDialog(None,
299 gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
300 gtk.MESSAGE_INFO, gtk.BUTTONS_OK,
301 comment+"\n\n"+cmd[2:])
302
303 else:
304 dialog = gtk.MessageDialog(None,
305 gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
306 gtk.MESSAGE_WARNING, gtk.BUTTONS_OK,
307 comment+"\n\n"+cmd[2:])
308
309 dialog.run()
310 os.system(cmd)
311 dialog.destroy()
312
292 def sudo_execute(self, command, description = "Super user priviledges are required to perform this operation"):313 def sudo_execute(self, command, description = "Super user priviledges are required to perform this operation"):
293 #log = CommandLogEntry(command)314 #log = CommandLogEntry(command)
294 #self.command_log.append( log )315 #self.command_log.append( log )
295316
=== modified file 'RapacheGtk/RapacheGui.py'
--- RapacheGtk/RapacheGui.py 2008-09-15 06:53:55 +0000
+++ RapacheGtk/RapacheGui.py 2010-05-20 16:23:24 +0000
@@ -86,8 +86,9 @@
86 self.xml = gtk.glade.XML(self.gladefile) 86 self.xml = gtk.glade.XML(self.gladefile)
87 #Create our dictionary and connect it87 #Create our dictionary and connect it
88 dic = { "new_button_clicked" : self.new_button_clicked,88 dic = { "new_button_clicked" : self.new_button_clicked,
89 "on_MainWindow_destroy" : self.quit ,89 "on_MainWindow_destroy" : self.quit,
90 "please_restart" : self.restart_apache , 90 "please_start" : self.start_apache,
91 "please_restart" : self.restart_apache,
91 "on_delete" : self.delete_button_clicked,92 "on_delete" : self.delete_button_clicked,
92 "edit_button_clicked" : self.edit_button_clicked,93 "edit_button_clicked" : self.edit_button_clicked,
93 "edit_module_button_clicked" : self.edit_module_button_clicked,94 "edit_module_button_clicked" : self.edit_module_button_clicked,
@@ -389,16 +390,22 @@
389 self.refresh_vhosts()390 self.refresh_vhosts()
390 self.refresh_modules()391 self.refresh_modules()
391 self.refresh_config_test(focus_error)392 self.refresh_config_test(focus_error)
392 393
394 def start_apache ( self, widget ):
395 print "Starting apache on user's request"
396 self.apache.start()
397 self.update_server_status()
398 self.xml.get_widget( 'restart_apache_notice' ).show()
399
393 def please_restart ( self ):400 def please_restart ( self ):
394 self.xml.get_widget( 'restart_apache_notice' ).show()401 self.xml.get_widget( 'restart_apache_notice' ).show()
395 def restart_apache ( self, widget ):402 def restart_apache ( self, widget ):
396 if not Shell.command.ask_password(): return403 #if not Shell.command.ask_password(): return # Not usefull: password is handle by gksudo
397 print "Restarting apache on user's request"404 print "Restarting apache on user's request"
398 self.apache.restart()405 self.apache.restart()
399 self.update_server_status()406 self.update_server_status()
400 self.xml.get_widget( 'restart_apache_notice' ).hide()407 self.xml.get_widget( 'restart_apache_notice' ).hide()
401 self.refresh_lists(True)408 #self.refresh_lists(True) # FIXME
402 409
403 def is_vhost_editable (self, name):410 def is_vhost_editable (self, name):
404 return name != 'default'411 return name != 'default'
405412
=== modified file 'setup.py'
--- setup.py 2008-09-16 14:00:49 +0000
+++ setup.py 2010-05-20 16:23:24 +0000
@@ -21,22 +21,23 @@
21from distutils.core import setup21from distutils.core import setup
22setup(22setup(
23 name='rapache',23 name='rapache',
24 version='0.7',
24 author='Rapache Developers',25 author='Rapache Developers',
25 author_email='rapache-devel@lists.launchpad.net',26 author_email='rapache-devel@lists.launchpad.net',
26 maintainer='Emanuele Gentili',27 maintainer='Emanuele Gentili',
27 maintainer_email='emgent@ubuntu.com',28 maintainer_email='emgent@ubuntu.com',
28 description='Simple tool for managing and configuring an apache2 instance',29 description='Simple tool for managing and configuring an apache2 instance',
29 url = 'http://www.rapache.org',30 url = 'http://launchpad.net/rapache',
30 license='GNU GPL',31 license='GNU GPL',
31 packages=['RapacheCore', 'RapacheGtk'],32 packages=['RapacheCore', 'RapacheGtk'],
32 scripts=['rapache', 'hosts-manager'],33 scripts=['rapache', 'hosts-manager'],
33 data_files=[34 data_files=[
34 ('share/rapache/Glade', glob.glob('Glade/*')),35 ('/usr/share/rapache/Glade', glob.glob('Glade/*')),
35 ('lib/rapache/plugins/', glob.glob('plugins/__init__.py')),36 ('lib/rapache/plugins/', glob.glob('plugins/__init__.py')),
36 ('lib/rapache/plugins/ssl', glob.glob('plugins/ssl/*')),37 ('lib/rapache/plugins/ssl', glob.glob('plugins/ssl/*')),
37 ('lib/rapache/plugins/advanced', glob.glob('plugins/advanced/*')),38 ('lib/rapache/plugins/advanced', glob.glob('plugins/advanced/*')),
38 ('lib/rapache/plugins/basic_authentication', glob.glob('plugins/basic_authentication/*')),39 ('lib/rapache/plugins/basic_authentication', glob.glob('plugins/basic_authentication/*')),
39 ('share/applications', ['data/rapache.desktop']),40 ('/usr/share/applications', ['data/rapache.desktop']),
40 ],41 ],
41 )42 )
4243

Subscribers

People subscribed via source and target branches

to all changes: