From cee435c7adc32565347fed07ebc5669448f9fad3 Mon Sep 17 00:00:00 2001 From: Antoine Durand-Gasselin Date: Sat, 4 Oct 2008 19:57:02 +0200 Subject: [PATCH] kikoololisation de munin (on rajoute des accents partout :) darcs-hash:20081004175702-bd074-cf32f0e641d84d78ea6a7a8d3a2ed5902ca514b4.gz --- munin/batiments | 4 ++-- munin/laserjet_ | 12 ++++++------ munin/laserjet__etat | 19 +++++++++---------- munin/laserjet__pages | 12 ++++++------ munin/wiki_pages | 8 ++------ munin/wiki_themes | 5 ++--- munin/wiki_users | 2 +- wiki/theme/crans.py | 1 + 8 files changed, 29 insertions(+), 34 deletions(-) diff --git a/munin/batiments b/munin/batiments index fd4e05b8..34a7a143 100755 --- a/munin/batiments +++ b/munin/batiments @@ -12,7 +12,7 @@ except : if arg == "config" : print 'host_name adherents' - print 'graph_title Adhérents par batiments' + print u'graph_title Adhérents par batiments' print "graph_args --base 1000 --lower-limit 0" print "graph_vlabel nb d'adhérents" print 'bata.label Bâtiment A' @@ -37,7 +37,7 @@ if arg == "config" : elif arg == "fichier" : file = open('%s.next' % fichier,'w') - + sys.path.append('/usr/scripts/gestion') from ldap_crans import crans_ldap db = crans_ldap() diff --git a/munin/laserjet_ b/munin/laserjet_ index 4631e66f..72713640 100755 --- a/munin/laserjet_ +++ b/munin/laserjet_ @@ -7,7 +7,7 @@ sys.path.append("/usr/scripts/gestion") import hptools dico_courbes_gen = { - 'car' : {'titre' : "Etat des cartouches", + 'car' : {'titre' : u"État des cartouches", 'vlabel' : "nb de pages restantes", 'lower-limit' : 0, 'upper-limit' : 30000, @@ -19,7 +19,7 @@ dico_courbes_gen = { 'car_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.3.0","Cartouche magenta","ff00ff"), 'car_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.4.0","Cartouche jaune","ffff00") }}, - 'car-p' : {'titre' : "Etat des cartouches", + 'car-p' : {'titre' : u"État des cartouches (pourcentage)", 'vlabel' : "pourcentage restant", 'lower-limit' : 0, 'upper-limit' : 100, @@ -29,7 +29,7 @@ dico_courbes_gen = { 'car_p_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.1.1.18.3.0","Cartouche magenta","ff00ff"), 'car_p_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.1.1.18.4.0","Cartouche jaune","ffff00") }}, - 'tam' : {'titre' : "Etat des tambours", + 'tam' : {'titre' : u"État des tambours", 'vlabel' : "nb de pages restantes", 'lower-limit' : 0, 'upper-limit' : 40000, @@ -41,7 +41,7 @@ dico_courbes_gen = { 'tam_mag' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.7.0","Tambour d'imagerie magenta","ff00ff"), 'tam_yel' : ("enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.8.0","Tambour d'imagerie jaune","ffff00"), }}, - 'tam-p' : {'titre' : "Etat des tambours", + 'tam-p' : {'titre' : u"État des tambours (pourcentage)", 'vlabel' : "Pourcentage restant", 'lower-limit' : 0, 'upper-limit' : 100, @@ -65,7 +65,7 @@ dico_courbes_gen = { 'tray1' : ("1.3.6.1.2.1.43.8.2.1.10.1.1","Transparents","ffff33"), 'tray1_max' : ("1.3.6.1.2.1.43.8.2.1.9.1.1","Transparents (max)","cccc00"), }}, - 'stock-papier-p' : {'titre' : "Stock papier", + 'stock-papier-p' : {'titre' : "Stock papier (pourcentage)", 'vlabel' : "Pourcentage restant", 'lower-limit' : 0, 'upper-limit' : 100, @@ -81,7 +81,7 @@ dico_courbes_gen = { 'tray2' : "1.3.6.1.2.1.43.8.2.1.9.1.2", 'tray1' : "1.3.6.1.2.1.43.8.2.1.9.1.1", }}, - 'kit' : {'titre' : "Etat des kits images", + 'kit' : {'titre' : u"État des kits images", 'vlabel' : "nb de pages restantes", 'lower-limit' : 0, 'upper-limit' : 150000, diff --git a/munin/laserjet__etat b/munin/laserjet__etat index d70a7db3..2b71f0d1 100755 --- a/munin/laserjet__etat +++ b/munin/laserjet__etat @@ -44,7 +44,6 @@ def etat(): if diff == None: diff = 4 total += diff - except Exception, err: total += 24 return total @@ -56,15 +55,15 @@ else: if arg == "config": # Ecrit sur la sortie standard la configuration - print 'host_name laserjet' - print "graph_category etat" - print "graph_args --lower-limit 0 --upper-limit 10" - print "graph_title Etat de l'imprimante" - print "graph_vlabel nb" - print "etat.label Estimation des embrouilles (>3=problemes)" - print "etat.warning 4" - print "etat.critical 8" - print "lpq.label Taille de la file d'attente" + print u'host_name laserjet' + print u"graph_category État" + print u"graph_args --lower-limit 0 --upper-limit 10" + print u"graph_title État de l'imprimante" + print u"graph_vlabel nb" + print u"etat.label Estimation des embrouilles (>3=problemes)" + print u"etat.warning 4" + print u"etat.critical 8" + print u"lpq.label Taille de la file d'attente" else: # Ecrit les valeurs actuelles sur la sortie standard print "etat.value %s" % etat() diff --git a/munin/laserjet__pages b/munin/laserjet__pages index fc93cb0a..dcdd4413 100755 --- a/munin/laserjet__pages +++ b/munin/laserjet__pages @@ -11,14 +11,14 @@ if len(sys.argv) > 1: arg = sys.argv[1] else: arg = '' - + if arg == "config": # Ecrit sur la sortie standard la configuration - print 'host_name laserjet' - print "graph_category etat" - print "graph_title Pages imprimees" - print "graph_vlabel nb" - print "total.label Total" + print u'host_name laserjet' + print u"graph_category État" + print u"graph_title Pages imprimées" + print u"graph_vlabel nb" + print u"total.label Total" else: # Ecrit les valeurs actuelles sur la sortie standard oid = "1.3.6.1.2.1.43.10.2.1.4.1.1" diff --git a/munin/wiki_pages b/munin/wiki_pages index 446cae21..25ec44f7 100755 --- a/munin/wiki_pages +++ b/munin/wiki_pages @@ -26,15 +26,11 @@ if arg == "config" : print 'orphelines.draw AREA' elif arg == "fichier" : - request = RequestCLI(u"wiki.crans.org/") request.form = request.args = request.setup_args() - _ = request.getText - #if request.mode_getpagelinks: # prevent recursion #return '' - # find root page. #from MoinMoin.Page import Page #rootpage = Page(request, u"FrontPage", is_rootpage=1) @@ -48,14 +44,14 @@ elif arg == "fichier" : for link in links: if link in orphaned: del orphaned[link] - + fichier_temp = tempfile.mktemp() file = open('%s' % fichier_temp,'w') file.write("total.value %d\n" % pages.__len__()) file.write("orphelines.value %d\n" % orphaned.__len__()) file.close() - + os.system('mv %s %s' % (fichier_temp, fichier)) else : os.system('cat %s' % fichier) diff --git a/munin/wiki_themes b/munin/wiki_themes index a6f125c8..dd064942 100755 --- a/munin/wiki_themes +++ b/munin/wiki_themes @@ -11,11 +11,11 @@ try : arg = sys.argv[1] except : arg = '' - + if arg == "config" : print 'host_name web.rouge' print 'graph_category wiki' - print 'graph_title Thèmes wiki utilisés' + print u'graph_title Thèmes wiki utilisés' print 'graph_scale no' print "graph_vlabel nb d'utilisateurs" for theme in THEMES : @@ -35,4 +35,3 @@ else : for char in [' ','_','-','/','\\',':',';','.','<','>'] : nom = nom.replace(char, '') print '%s.value %s' % (nom, nb) - diff --git a/munin/wiki_users b/munin/wiki_users index 91738cfb..d1186d9c 100755 --- a/munin/wiki_users +++ b/munin/wiki_users @@ -7,7 +7,7 @@ if [ "$1" = "config" ]; then echo 'graph_title Utilisateurs wiki' echo 'graph_args --base 1000 --lower-limit 0' echo "graph_vlabel nombre d'utilisateurs" - echo 'enregistres.label Nb enregistrés' + echo u'enregistres.label Nb enregistrés' echo 'enregistres.draw AREA' echo 'favoris.label Nb avec favoris' exit 0 diff --git a/wiki/theme/crans.py b/wiki/theme/crans.py index 6bff1729..8ab8101b 100644 --- a/wiki/theme/crans.py +++ b/wiki/theme/crans.py @@ -118,6 +118,7 @@ class ThemeCrans(ThemeBase): return classic_head + open_search_desc + wiki_rel def headscript(self, d): + html = [] # Check mode if d.get('print_mode'): link = ""