Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
FichteFoll committed Oct 15, 2015
1 parent 870c8c2 commit 14df2ae
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions WinMerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,36 @@
import os
from subprocess import Popen
try:
import _winreg as winreg
import _winreg as winreg
except:
import winreg
import winreg

WINMERGE = winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinMergeU.exe')

if not WINMERGE:
if os.path.exists("%s\WinMerge\WinMergeU.exe" % os.environ['ProgramFiles(x86)']):
WINMERGE = '"%s\WinMerge\WinMergeU.exe"' % os.environ['ProgramFiles(x86)']
else:
WINMERGE = '"%s\WinMerge\WinMergeU.exe"' % os.environ['ProgramFiles']
if os.path.exists("%s\WinMerge\WinMergeU.exe" % os.environ['ProgramFiles(x86)']):
WINMERGE = '"%s\WinMerge\WinMergeU.exe"' % os.environ['ProgramFiles(x86)']
else:
WINMERGE = '"%s\WinMerge\WinMergeU.exe"' % os.environ['ProgramFiles']

fileA = fileB = None


def recordActiveFile(f):
global fileA
global fileB
fileB = fileA
fileA = f
global fileA
global fileB
fileB = fileA
fileA = f


class WinMergeCommand(sublime_plugin.ApplicationCommand):
def run(self):
cmd_line = '%s /e /ul /ur "%s" "%s"' % (WINMERGE, fileA, fileB)
print("WinMerge command: " + cmd_line)
Popen(cmd_line)
def run(self):
cmd_line = '%s /e /ul /ur "%s" "%s"' % (WINMERGE, fileA, fileB)
print("WinMerge command: " + cmd_line)
Popen(cmd_line)


class WinMergeFileListener(sublime_plugin.EventListener):
def on_activated(self, view):
if view.file_name() != fileA:
recordActiveFile(view.file_name())
def on_activated(self, view):
if view.file_name() != fileA:
recordActiveFile(view.file_name())

0 comments on commit 14df2ae

Please sign in to comment.