solium-gutter.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:sublime-solium-gutter 作者: sey 项目源码 文件源码
def run_script_on_file(self, temp_file_path):
    try:
      node_path = PluginUtils.get_node_path()
      script_path = PLUGIN_FOLDER + "/scripts/run.js"
      file_path = self.view.file_name()
      cmd = [node_path, script_path, temp_file_path, file_path or "?"]
      output = SoliumGutterCommand.get_output(cmd)
      print(output)
      if output.find(OUTPUT_VALID) != -1:
        output = output.decode('utf-8');
        return output
      print(output)
      raise Exception(output)
    except:
      # Something bad happened.
      print("Unexpected error({0}): {1}".format(sys.exc_info()[0], sys.exc_info()[1]))

      # Usually, it's just node.js not being found. Try to alleviate the issue.
      msg = "Node.js was not found in the default path. Please specify the location."
      if not sublime.ok_cancel_dialog(msg):
        msg = "You won't be able to use this plugin without specifying the path to node.js."
        sublime.error_message(msg)
      else:
        PluginUtils.open_sublime_settings(self.view.window())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号