-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alkis Georgopoulos wrote:
> Is it possible for italc-launcher to sort the autodetected client list?
> 
>   return sorted(hosts, reverse=True)
> 
> in getAvahiHosts() works for me.
> 
> Cheers,
> Alkis
> 
> 

Does the attached patch also work for you ?
It has the advantage to work in mixed (ltsp-cluster + avahi) environment.

- --
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqRhZAACgkQjxyfqkjBhuwBbQCeItqkM+hJF5CFLbYP8Ar/JBIs
gGEAn3Nc3j71W5vwwoPsZQOQ8o3/+e+c
=3cJw
-----END PGP SIGNATURE-----
=== modified file 'debian/italc-launcher'
--- debian/italc-launcher	2009-08-19 06:17:13 +0000
+++ debian/italc-launcher	2009-08-23 18:06:37 +0000
@@ -87,6 +87,7 @@
     return hosts
 
 def getAvahiHosts():
+    global local_addr
     hosts=[]
     if not os.path.exists("/usr/bin/avahi-browse"):
         return hosts
@@ -98,7 +99,11 @@
                 param=line.split(";")
                 comment=re.findall('"(.*)" "(.*)" "(.*)" "(.*)"\n',param[9])[0]
                 if (comment[1] == md5_1 or comment[2] == md5_2 or comment[3] == md5_3):
-                    hosts.append([param[7]+":"+param[8],1,comment[0]])
+                    if param[7] in local_addr:
+                        param[7]="127.0.0.1"
+                    host=[param[7]+":"+param[8],1,comment[0]]
+                    if host not in hosts:
+                        hosts.append(host)
             except:
                 print 'Ignoring a client, invalid data received'
     return hosts
@@ -146,7 +151,7 @@
 body.appendChild(avahi)
 
 # Add computers to the classroom
-clients=getAvahiHosts()+getClusterHosts()
+clients=sorted(getAvahiHosts()+getClusterHosts(), reverse=True)
 count=0
 
 local_addr=getLocalIPs()

-- 
edubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/edubuntu-devel

Reply via email to