MCPcopy Index your code
hub / github.com/wireservice/csvkit / run

Method run

csvkit/cli.py:130–149  ·  view source on GitHub ↗

A wrapper around the main loop of the utility which handles opening and closing files.

(self)

Source from the content-addressed store, hash-verified

128 raise NotImplementedError('add_arguments must be provided by each subclass of CSVKitUtility.')
129
130 def run(self):
131 """
132 A wrapper around the main loop of the utility which handles opening and
133 closing files.
134 """
135 if 'f' not in self.override_flags:
136 self.input_file = self._open_input_file(self.args.input_path)
137
138 if getattr(self.args, 'add_bom', False):
139 self.output_file.buffer.write(BOM_UTF8)
140
141 try:
142 with warnings.catch_warnings():
143 if getattr(self.args, 'no_header_row', None):
144 warnings.filterwarnings(action='ignore', message='Column names not specified', module='agate')
145
146 self.main()
147 finally:
148 if 'f' not in self.override_flags:
149 self.input_file.close()
150
151 def main(self):
152 """

Callers 15

launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80
launch_new_instanceFunction · 0.80

Calls 3

_open_input_fileMethod · 0.95
mainMethod · 0.95
closeMethod · 0.80

Tested by 12

test_emptyMethod · 0.64
test_invalid_optionsMethod · 0.64
test_invalid_columnMethod · 0.64
test_csvjson_performanceFunction · 0.64
test_csvlook_performanceFunction · 0.64
test_csvpy_performanceFunction · 0.64
test_csvsql_performanceFunction · 0.64
test_csvstat_performanceFunction · 0.64
assertCleanedMethod · 0.64
csvsqlMethod · 0.64