Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-06-16 17:07:10 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-06-16 17:07:10 (GMT)
commite30f9c337afc1e4911b51a7e558825026cd81168 (patch)
tree67fd9a323c72dd10827f48f2a50da60054fa7fc0 /sugar
parent4a0e8ac2d404a78bbeb75ef16f3604c2d74191d7 (diff)
parent6db22150b1c6619bd60523bb3c383c44da5d09b7 (diff)
Merge branch 'master' of git+ssh://crank.laptop.org/git/sugar
Diffstat (limited to 'sugar')
-rw-r--r--sugar/presence/Service.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/sugar/presence/Service.py b/sugar/presence/Service.py
index 9219b80..2288936 100644
--- a/sugar/presence/Service.py
+++ b/sugar/presence/Service.py
@@ -2,28 +2,6 @@ import avahi
from sugar import util
import string
-def new_group_service(group_name, resource):
- """Create a new service suitable for defining a new group."""
- if type(group_name) != type("") or not len(group_name):
- raise ValueError("group name must be a valid string.")
- if type(resource) != type("") or not len(resource):
- raise ValueError("group resource must be a valid string.")
-
- # Create a randomized service type
- data = "%s%s" % (group_name, resource)
- stype = "_%s_group_olpc._udp" % sugar.util.unique_id(data)
-
- properties = {__GROUP_NAME_TAG: group_name, __GROUP_RESOURCE_TAG: resource }
- owner_nick = ""
- port = random.randint(5000, 65000)
- # Use random currently unassigned multicast address
- address = "232.%d.%d.%d" % (random.randint(0, 254), random.randint(1, 254),
- random.randint(1, 254))
- service = Service.Service(owner_nick, stype, "local", address=address,
- port=port, properties=properties)
- return service
-
-
def _txt_to_dict(txt):
"""Convert an avahi-returned TXT record formatted
as nested arrays of integers (from dbus) into a dict