Convert sample data to new style
[mudpy.git] / mudpy / misc.py
index 170a4c3..b322afc 100644 (file)
@@ -309,9 +309,9 @@ class Element:
     def portals(self):
         """Map the portal directions for an area to neighbors."""
         portals = {}
-        if re.match(r"""^area:-?\d+,-?\d+,-?\d+$""", self.key):
+        if re.match(r"""^area\.-?\d+,-?\d+,-?\d+$""", self.key):
             coordinates = [(int(x))
-                           for x in self.key.split(":")[1].split(",")]
+                           for x in self.key.split(".")[-1].split(",")]
             offsets = dict(
                 (x,
                  self.universe.contents["mudpy.movement.%s" % x].get("vector")
@@ -319,7 +319,7 @@ class Element:
             for portal in self.get("gridlinks"):
                 adjacent = map(lambda c, o: c + o,
                                coordinates, offsets[portal])
-                neighbor = "area:" + ",".join(
+                neighbor = "area." + ",".join(
                     [(str(x)) for x in adjacent]
                 )
                 if neighbor in self.universe.contents: