MCPcopy
hub / github.com/catppuccin/catppuccin / run_command

Method run_command

samples/python1.py:217–239  ·  view source on GitHub ↗
(self, command, callback=None, show_status=False,
                    filter_empty_args=True, **kwargs)

Source from the content-addressed store, hash-verified

215 return log(settings=self.settings, *args, **kwargs)
216
217 def run_command(self, command, callback=None, show_status=False,
218 filter_empty_args=True, **kwargs):
219 if filter_empty_args:
220 command = [arg for arg in command if arg]
221 if 'working_dir' not in kwargs:
222 kwargs['working_dir'] = self.get_working_dir()
223 if 'fallback_encoding' not in kwargs and self.active_view() and self.active_view().settings().get('fallback_encoding'):
224 kwargs['fallback_encoding'] = self.active_view().settings().get('fallback_encoding').rpartition('(')[2].rpartition(')')[0]
225 kwargs['console_encoding'] = self.settings.get('console_encoding')
226
227 autosave = self.settings.get('autosave', True)
228 if self.active_view() and self.active_view().is_dirty() and autosave:
229 self.active_view().run_command('save')
230 if not callback:
231 callback = self.generic_done
232
233 log('run command:', ' '.join(command))
234 thread = CommandThread(command, callback, **kwargs)
235 thread.start()
236
237 if show_status:
238 message = kwargs.get('status_message', False) or ' '.join(command)
239 sublime.status_message(message + 'wef')
240
241 def generic_done(self, result):
242 self.log('generic_done', result)

Callers 13

generic_doneMethod · 0.80
_output_to_viewMethod · 0.80
panelMethod · 0.80
runMethod · 0.80
runMethod · 0.80
on_loadMethod · 0.80
on_load_asyncMethod · 0.80
on_activatedMethod · 0.80
on_activated_asyncMethod · 0.80
on_post_saveMethod · 0.80
on_post_save_asyncMethod · 0.80
runMethod · 0.80

Calls 4

get_working_dirMethod · 0.95
active_viewMethod · 0.95
logFunction · 0.85
CommandThreadClass · 0.85

Tested by

no test coverage detected