home · contact · privacy
Server: Simplify code.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 2 Mar 2016 01:53:54 +0000 (02:53 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 2 Mar 2016 01:53:54 +0000 (02:53 +0100)
server/io.py

index a483e2d4e313bdd91ddd25f08aa7f700e9e55376..bb5d3ac13e7661feb6bfd3b7f2594038759c6772 100644 (file)
@@ -174,8 +174,6 @@ def save_world():
                     x = world_db[category][_id][key]
                     argument = quote_escape(x) if str == type(x) else str(x)
                     string = string + key + " " + argument + "\n"
-                elif special_keys[key]:
-                    string = string + special_keys[key](_id)
         return string
 
     def helper_things():
@@ -194,25 +192,6 @@ def save_world():
             string += memthing(tid) + memmap(tid) + memdepthmap(tid)
         return string
 
-    # ALTERNATIVE TO helper_things, but not more efficient despite listcomp
-    # def helper4():
-    #     def foo(t, key):
-    #         argument = t[key]
-    #         return key + " " + (quote_escape(argument) if \
-    #                 str == type(argument) else str(argument)) + "\n"
-    #     string = ""
-    #     memmap = mapsetter("T_MEMMAP")
-    #     memdepthmap = mapsetter("T_MEMDEPTHMAP")
-    #     for tid in sorted(world_db["Things"].keys()):
-    #         string += "T_ID " + str(tid) + "\n"
-    #         t = world_db["Things"][tid]
-    #         lines = [foo(t, key) for key in sorted(t.keys())
-    #                  if key not in {"T_CARRIES", "carried", "fovmap",
-    #                  "T_MEMMAP", "T_MEMTHING", "T_MEMDEPTHMAP"}]
-    #         string += "".join(lines)
-    #         string += memthing(tid) + memmap(tid) + memdepthmap(tid)
-    #     return string
-
     string = ""
     for plugin in world_db["PLUGIN"]:
         string = string + "PLUGIN " + plugin + "\n"