From fe641d01d4d0741a0b8dcddcfe3ba4e795952f6d Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Mon, 14 Oct 2013 21:51:35 -0700 Subject: [PATCH] remove support for subversion on Windows to prevent cmd windows from opening --- packages/wakatime/wakatime/projects/subversion.py | 3 +++ packages/wakatime/wakatime/stats.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/wakatime/wakatime/projects/subversion.py b/packages/wakatime/wakatime/projects/subversion.py index 6a7aed5..403f344 100644 --- a/packages/wakatime/wakatime/projects/subversion.py +++ b/packages/wakatime/wakatime/projects/subversion.py @@ -11,6 +11,7 @@ import logging import os +import platform from subprocess import Popen, PIPE from .base import BaseProject @@ -62,6 +63,8 @@ class Subversion(BaseProject): return info def _find_project_base(self, path, found=False): + if platform.system() == 'Windows': + return False path = os.path.realpath(path) if os.path.isfile(path): path = os.path.split(path)[0] diff --git a/packages/wakatime/wakatime/stats.py b/packages/wakatime/wakatime/stats.py index 112ad1f..ac29996 100644 --- a/packages/wakatime/wakatime/stats.py +++ b/packages/wakatime/wakatime/stats.py @@ -18,7 +18,6 @@ if sys.version_info[0] == 2: else: sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'packages', 'pygments3')) from pygments.lexers import guess_lexer_for_filename -from pygments.util import ClassNotFound log = logging.getLogger(__name__) @@ -29,7 +28,7 @@ def guess_language(file_name): try: with open(file_name) as f: lexer = guess_lexer_for_filename(file_name, f.read(512000)) - except (ClassNotFound, IOError): + except: pass if lexer: return str(lexer.name)