[gen_confs/generate] Modification du handling des signaux seulement dans le __main__
sinon, ça fait du caca quand on veux l'importer
This commit is contained in:
parent
2c6cdb7201
commit
9a93373ab8
2 changed files with 2 additions and 46 deletions
|
@ -28,8 +28,6 @@ from syslog import *
|
|||
import platform
|
||||
openlog("generate")
|
||||
|
||||
signal.signal(signal.SIGINT, signal.SIG_IGN) # Pas de Ctrl-C
|
||||
|
||||
db = crans_ldap()
|
||||
make_lock('auto_generate', 'Big lock', nowait=1)
|
||||
|
||||
|
@ -323,10 +321,10 @@ class gordon(base_reconfigure) :
|
|||
class titanic(base_reconfigure):
|
||||
pass
|
||||
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL) # Comportement normal de Ctrl-C
|
||||
remove_lock('auto_generate')
|
||||
|
||||
if __name__ == '__main__':
|
||||
signal.signal(signal.SIGINT, signal.SIG_IGN) # Pas de Ctrl-C
|
||||
openlog('generate', LOG_PID)
|
||||
for x in db.services_to_restart():
|
||||
try:
|
||||
|
@ -418,3 +416,4 @@ if __name__ == '__main__':
|
|||
|
||||
# On fait ce qu'il y a à faire
|
||||
classe(to_do)
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL) # Comportement normal de Ctrl-C
|
||||
|
|
|
@ -101,49 +101,6 @@ class Theme(ThemeBase):
|
|||
'{o}': ("{o}", "star_off.png", 16, 16),
|
||||
}
|
||||
|
||||
def navibar(self, d):
|
||||
""" Assemble the navibar
|
||||
|
||||
@param d: parameter dictionary
|
||||
@rtype: unicode
|
||||
@return: navibar html
|
||||
"""
|
||||
request = self.request
|
||||
found = {} # pages we found. prevent duplicates
|
||||
items = [] # navibar items
|
||||
item = u'<li class="%s">%s</li>'
|
||||
current = d['page_name']
|
||||
|
||||
# Process config navi_bar
|
||||
if request.cfg.navi_bar:
|
||||
for text in request.cfg.navi_bar:
|
||||
pagename, link = self.splitNavilink(text)
|
||||
if pagename == current:
|
||||
cls = 'wikilink current'
|
||||
else:
|
||||
cls = 'wikilink'
|
||||
items.append(item % (cls, link))
|
||||
found[pagename] = 1
|
||||
|
||||
# Add current page at end of local pages
|
||||
if not current in found:
|
||||
title = d['page'].split_title()
|
||||
title = self.shortenPagename(title)
|
||||
link = d['page'].link_to(request, title)
|
||||
cls = 'current'
|
||||
items.append(item % (cls, link))
|
||||
|
||||
# Assemble html
|
||||
items = u''.join(items)
|
||||
html = u'''
|
||||
<ul id="navibar">
|
||||
%s
|
||||
</ul>
|
||||
''' % items
|
||||
return html
|
||||
|
||||
|
||||
|
||||
def wikipanel(self, d):
|
||||
""" Create wiki panel """
|
||||
_ = self.request.getText
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue