23 _output_attr =
'window.output'
27 _settings_attr =
'window.settings'
35 _strings_key =
'strings'
38 start_block='<script type="text/javascript">\n',
39 end_block='</script>\n',
40 split_threshold=9500):
41 writer =
JsonWriter(output, separator=end_block+start_block)
48 def write(self, result, settings):
65 self.
_write_write(
'%s = []' % variable)
66 prefix =
'%s = %s.concat(' % (variable, variable)
69 for index
in range(0, len(strings), threshold):
70 self.
_write_json_write_json(prefix, strings[index:index+threshold], postfix)
87 def __init__(self, write_json, split_threshold):
91 def write(self, suite, variable):
94 self.
_write_json_write_json(
'%s = ' % variable, suite, mapping=mapping)
97 if not isinstance(data, tuple):
107 part_name =
'window.sPart%d' % len(mapping)
108 self.
_write_json_write_json(
'%s = ' % part_name, data, mapping=mapping)
109 mapping[data] = part_name
117 def write(self, keywords, strings, index, notify):
118 self.
_writer_writer.write_json(
'window.keywords%d = ' % index, keywords)
119 self.
_writer_writer.write_json(
'window.strings%d = ' % index, strings)
120 self.
_writer_writer.
write(
'window.fileLoading.notify("%s")' % notify)
def _start_output_block(self)
def _write_suite(self, suite)
def _output_var(self, key)
def write(self, result, settings)
def __init__(self, output, start_block='< script type="text/javascript">\n', end_block='</script >\n', split_threshold=9500)
def _write_data(self, data)
def _write_settings_and_end_output_block(self, settings)
def _write_strings(self, strings)
def __init__(self, output)
def write(self, keywords, strings, index, notify)
def _write_part(self, data, mapping)
def __init__(self, write_json, split_threshold)
def write(self, suite, variable)
def _write_parts_over_threshold(self, data, mapping)