Mnage dans l'intranet
darcs-hash:20081006060625-ffbb2-6d2a621ace92b0fa82b3963650d7096fcbdb3974.gz
This commit is contained in:
parent
7cc9a25757
commit
bcad68a7dd
4 changed files with 11 additions and 14 deletions
|
@ -1,9 +1,9 @@
|
|||
#! /usr/bin/env python
|
||||
import cherrypy, tempfile, shutil, os
|
||||
import crans.utils.quota
|
||||
|
||||
import crans.cp
|
||||
from ClassesIntranet.ModuleBase import ModuleBase
|
||||
|
||||
import crans.utils.quota as quota
|
||||
|
||||
class main(ModuleBase):
|
||||
def category(self):
|
||||
|
@ -18,8 +18,12 @@ class main(ModuleBase):
|
|||
return "icon.png"
|
||||
|
||||
def _get_quota(self):
|
||||
return crans.utils.quota.getUserQuota(cherrypy.session['uid'])
|
||||
#return [{'%': 33.9, 'quota': 390.62, 'label': u'Dossier personnel', 'limite': 585.94, 'filesystem': '/home', 'usage': 420.32}, {'%': 0.1, 'quota': 100.00, 'label': u'Boite de r\xe9ception', 'limite': 150.00, 'filesystem': '/var/mail', 'usage': 0.06}]
|
||||
if (cherrypy.config.configMap["global"]["server.environment"] == "development"):
|
||||
return quota.fake_getUserQuota(cherrypy.session['uid'])
|
||||
else:
|
||||
return quota.getUserQuota(cherrypy.session['uid'])
|
||||
|
||||
|
||||
|
||||
##########################
|
||||
# affichage
|
||||
|
@ -28,7 +32,6 @@ class main(ModuleBase):
|
|||
# methode qui affiche la template
|
||||
#
|
||||
def index(self ):
|
||||
#return "youpiiii"
|
||||
values = {}
|
||||
try:
|
||||
quotas = self._get_quota()
|
||||
|
@ -60,7 +63,7 @@ class main(ModuleBase):
|
|||
"svg_url":"barreSVG?filesystem=%s" % a_quota['filesystem'],
|
||||
}
|
||||
returned_quotas.append(a_returned_quota)
|
||||
values = {'quotas': returned_quotas, 'e': "eeede"}
|
||||
values = {'quotas': returned_quotas}
|
||||
except Exception, e:
|
||||
crans.cp.log('error getting quota for user %s : %s' % (cherrypy.session['uid'], str(e)), 'QUOTA', 1)
|
||||
values = {'erreur':str(e)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue