Exemple #1
0
 def tostring_proc(self, env, cont):
     w_val = self.struct_type().read_prop(w_prop_custom_write)
     if w_val is not None:
         assert isinstance(w_val, values_vector.W_Vector)
         w_write_proc = w_val.ref(0)
         port = values.W_StringOutputPort()
         # TODO: #t for write mode, #f for display mode,
         # or 0 or 1 indicating the current quoting depth for print mode
         mode = values.w_false
         return w_write_proc.call([self, port, mode], env, cont)
     return self.tostring()
Exemple #2
0
def make_output_port(name, evt, write_out, close, write_out_special,\
    get_write_evt, get_write_special_evt, get_location, count_lines,\
    init_position, buffer_mode):
    return values.W_StringOutputPort()
Exemple #3
0
def open_output_string():
    # FIXME: actual implementation for bytes and string
    return values.W_StringOutputPort()