def generate(self, path=None, template=None): assert path and template, 'wrong call' try: if not os.path.exists(path): os.mkdir(path) except OSError as e: _logger.error(e) sublime.status_message('Dart: Error. Check console for details.') return with pushd(path): was_empty_dir = len(glob.glob("*")) == 0 sdk = SDK() self.window.run_command( 'dart_exec', { 'cmd': [sdk.path_to_pub, 'global', 'run', 'stagehand', template], 'preamble': "Running stagehand...\n", 'working_dir': path, }) if was_empty_dir: after(2000, self.create_sublime_project, path)
def start(self, working_dir='.'): with PipeServer.status_lock: if self.is_running: _logger.debug( 'tried to start an already running PipeServer; aborting') return with pushd(working_dir): _logger.debug('starting PipeServer with args: %s', self.args) self.proc = Popen(self.args, stdout=PIPE, stdin=PIPE, stderr=PIPE, startupinfo=supress_window())
def generate(self, path=None, template=None): assert path and template, 'wrong call' try: if not os.path.exists(path): os.mkdir(path) except OSError as e: _logger.error(e) sublime.status_message('Dart: Error. Check console for details.') return with pushd(path): was_empty_dir = len(glob.glob("*")) == 0 sdk = SDK() self.window.run_command('dart_exec', { 'cmd': [sdk.path_to_pub, 'global', 'run', 'stagehand', template], 'preamble': "Running stagehand...\n", 'working_dir': path, }) if was_empty_dir: after(2000, self.create_sublime_project, path)