import warnings

from dtml import tal, metal, tales, context

from sheared.python import io

class Entwiner:
    def __init__(self):
        self.builtins = context.BuiltIns({})
        #self.context = context.Context()
        #self.context.setDefaults(self.builtins)

    def handle(self, request, reply, subpath):
        self.context = {}
        self.entwine(request, reply, subpath)
        r = self.execute(self.page_path, throwaway=0)

        reply.send(r)

    def execute(self, path, throwaway=1):
        r = io.readfile(path)
        c = tal.compile(r, tales)
        r = tal.execute(c, self.context, self.builtins, tales)
        c = metal.compile(r, tales)
        r = metal.execute(c, self.context, self.builtins, tales)

        if throwaway and r.strip():
            warnings.warn('%s: ignored non-macro content' % path)

        return r

import warnings

from dtml import tal, metal, tales

from sheared.python import io

class Entwiner:
    def handle(self, request, reply, subpath):
        self.context = {}
        self.entwine(request, reply, subpath)
        r = self.execute(self.page_path, throwaway=0)
        reply.send(r)

    def execute(self, path, throwaway=1):
        r = io.readfile(path)
        c = tal.compile(r, tales)
        r = tal.execute(c, self.context, tales)
        c = metal.compile(r, tales)
        r = metal.execute(c, self.context, tales)

        if throwaway and r.strip():
            warnings.warn('%s: ignored non-macro content' % path)

        return r

Remove the builtins arguments to the {tal,metal}.execute calls.
Remove the builtins arguments to the {tal,metal}.execute calls.


git-svn-id: 8b0eea19d26e20ec80f5c0ea247ec202fbcc1090@107 5646265b-94b7-0310-9681-9501d24b2df7

  import warnings
  
- from dtml import tal, metal, tales, context
+ from dtml import tal, metal, tales
  
  from sheared.python import io
  
  class Entwiner:
-     def __init__(self):
-         self.builtins = context.BuiltIns({})
-         #self.context = context.Context()
-         #self.context.setDefaults(self.builtins)
- 
      def handle(self, request, reply, subpath):
          self.context = {}
          self.entwine(request, reply, subpath)
          r = self.execute(self.page_path, throwaway=0)
- 
          reply.send(r)
  
      def execute(self, path, throwaway=1):
          r = io.readfile(path)
          c = tal.compile(r, tales)
-         r = tal.execute(c, self.context, self.builtins, tales)
+         r = tal.execute(c, self.context, tales)
          c = metal.compile(r, tales)
-         r = metal.execute(c, self.context, self.builtins, tales)
+         r = metal.execute(c, self.context, tales)
  
          if throwaway and r.strip():
              warnings.warn('%s: ignored non-macro content' % path)
  
          return r
  
Remove the builtins arguments to the {tal,metal}.execute calls.
## Code Before:
import warnings

from dtml import tal, metal, tales, context

from sheared.python import io

class Entwiner:
    def __init__(self):
        self.builtins = context.BuiltIns({})
        #self.context = context.Context()
        #self.context.setDefaults(self.builtins)

    def handle(self, request, reply, subpath):
        self.context = {}
        self.entwine(request, reply, subpath)
        r = self.execute(self.page_path, throwaway=0)

        reply.send(r)

    def execute(self, path, throwaway=1):
        r = io.readfile(path)
        c = tal.compile(r, tales)
        r = tal.execute(c, self.context, self.builtins, tales)
        c = metal.compile(r, tales)
        r = metal.execute(c, self.context, self.builtins, tales)

        if throwaway and r.strip():
            warnings.warn('%s: ignored non-macro content' % path)

        return r

## Instruction:
Remove the builtins arguments to the {tal,metal}.execute calls.
## Code After:
import warnings

from dtml import tal, metal, tales

from sheared.python import io

class Entwiner:
    def handle(self, request, reply, subpath):
        self.context = {}
        self.entwine(request, reply, subpath)
        r = self.execute(self.page_path, throwaway=0)
        reply.send(r)

    def execute(self, path, throwaway=1):
        r = io.readfile(path)
        c = tal.compile(r, tales)
        r = tal.execute(c, self.context, tales)
        c = metal.compile(r, tales)
        r = metal.execute(c, self.context, tales)

        if throwaway and r.strip():
            warnings.warn('%s: ignored non-macro content' % path)

        return r
