Piccole dimenticanze

Leonardo [2010-04-17 08:32]
Piccole dimenticanze
Filename
phcstats.py
diff --git a/phcstats.py b/phcstats.py
index 4793897..33904e7 100755
--- a/phcstats.py
+++ b/phcstats.py
@@ -4,7 +4,7 @@
 # Monitora se i computer dell'aula studenti sono accesi
 # e restituisce delle statistiche a proposito.

-import subprocess
+import subprocess, time

 # Qualche variabile globale
 database_directory = '/home/robol/client_stats/' # Il traling slash ci serve
@@ -16,8 +16,9 @@ def LoadClients(group = 'all'):
     gruppo group di dsh. Il default è 'all'
     """
     clients = []
-    for client in open('/etc/dsh/groups/' + group, 'r'):
-        clients.append (client)
+    for client in open('/etc/dsh/group/' + group, 'r'):
+        if client.strip() != '' and client.strip()[0] != '#':
+            clients.append (client)
     return clients

 def IsAlive(client):
ViewGit