Beispiel #1
0
 def _write(self, text, compile):
     '''
     Parses the source, storing the body, params, title, bindings,
     and source in self.  If compile is set, compiles the
     function.
     '''
     ps = PythonScript(self.id)
     ps.write(text)
     if compile:
         ps._makeFunction(1)
         self._v_f = f = ps._v_f
         if f is not None:
             self.func_code = f.func_code
             self.func_defaults = f.func_defaults
         else:
             # There were errors in the compile.
             # No signature.
             self.func_code = bad_func_code()
             self.func_defaults = None
     self._body = ps._body
     self._params = ps._params
     if not self.title:
         self.title = ps.title
     self._setupBindings(ps.getBindingAssignments().getAssignedNames())
     self._source = ps.read()  # Find out what the script sees.
 def _write(self, text, compile):
     '''
     Parses the source, storing the body, params, title, bindings,
     and source in self.  If compile is set, compiles the
     function.
     '''
     ps = PythonScript(self.id)
     ps.write(text)
     if compile:
         ps._makeFunction()
         self._v_ft = ps._v_ft
         self.func_code = ps.func_code
         self.func_defaults = ps.func_defaults
     self._body = ps._body
     self._params = ps._params
     self.title = ps.title
     self._setupBindings(ps.getBindingAssignments().getAssignedNames())
     self._source = ps.read()  # Find out what the script sees.
Beispiel #3
0
 def _write(self, text, compile):
     '''
     Parses the source, storing the body, params, title, bindings,
     and source in self.  If compile is set, compiles the
     function.
     '''
     ps = PythonScript(self.id)
     ps.write(text)
     if compile:
         ps._makeFunction()
         self._v_ft = ps._v_ft
         self.func_code = ps.func_code
         self.func_defaults = ps.func_defaults
     self._body = ps._body
     self._params = ps._params
     self.title = ps.title
     self._setupBindings(ps.getBindingAssignments().getAssignedNames())
     self._source = ps.read()  # Find out what the script sees.