Skip to content
Snippets Groups Projects
Commit afe99470 authored by André Machado's avatar André Machado
Browse files

Get number of files and space of le-edubar

parent 091e987a
No related branches found
No related tags found
1 merge request!6Get number of files and space of le-edubar
Pipeline #
le-control-panel (0.0.1) UNRELEASED; urgency=medium
* Add Epoptes integration
* Add Family-Shield integration
* Add le-edubar integration
-- André <alsm14@prdb> Fri, 29 Sep 2017 11:03:01 -0300
le-control-panel (0.0.0) UNRELEASED; urgency=medium
* Initial release. (Closes: #XXXXXX)
......
......@@ -118,11 +118,22 @@ class Handler:
def getNumArquivosEdubar():
# TODO: retornar uma string contendo o numero de arquivos correto
return "10"
path = '/var/cache/le-edubar'
if os.path.isdir(path):
content = [i for i in os.listdir(path) if os.path.isdir(os.path.join(path, i))]
return str(len(content))
else:
return "0"
def getArmazenamentoEdubar():
# TODO: retornar uma string contendo o espaco de armazenamento
return "15Mb"
path = '/var/cache/le-edubar'
if os.path.isdir(path):
proc = Popen("du -sh " + path, shell=True, stdout=PIPE)
size = proc.communicate()[0].split()[0]
else:
size = "0"
return size + 'b'
def statusEpoptes(label):
proc = Popen("le-lab -s get_attribute epoptes _status", shell=True, stdout=PIPE)
......
......@@ -326,6 +326,7 @@
<child>
<object class="GtkBox" id="box5">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Habilitar atualização automática dos pacotes do sistema.
A atualização ocorrerá uma vez por dia</property>
......@@ -436,6 +437,7 @@ A atualização ocorrerá uma vez por dia</property>
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">Abrir Pasta compartilhada</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">start</property>
......@@ -592,6 +594,7 @@ A atualização ocorrerá uma vez por dia</property>
<child>
<object class="GtkBox" id="box9">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Habilitar compartilhamento de conteúdo educacional na rede P2P</property>
<property name="margin_top">3</property>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment