Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't bubble up GitFileInfo errors; print to standard err

  • Loading branch information...
commit 694703f77dad2da98ce0f6fa13eacb0372d35d0d 1 parent 4af973d
@noahd1 authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 code_climate.py
View
16 code_climate.py
@@ -1,14 +1,18 @@
import os
+import sys
import urllib
import webbrowser
-import git_utils
import sublime, sublime_plugin
+import git_utils
class CodeClimateCommand(sublime_plugin.TextCommand):
def run(self, args):
- file_info = git_utils.GitFileInfo(self.view.file_name())
- params = urllib.urlencode({"repo": file_info.remote_repository(), "path": file_info.path()})
- url = "https://codeclimate.com/browse?%s" % params
- print "Opening URL: " + url
- webbrowser.open_new(url)
+ try:
+ file_info = git_utils.GitFileInfo(self.view.file_name())
+ params = urllib.urlencode({"repo": file_info.remote_repository(), "path": file_info.path()})
+ url = "https://codeclimate.com/browse?%s" % params
+ print "Opening URL: " + url
+ webbrowser.open_new(url)
+ except git_utils.GitInfoError as err:
+ sys.stderr.write("Cannot open file in CodeClimate: " + str(err))
Please sign in to comment.
Something went wrong with that request. Please try again.