--- a/scripts/install.py Sat Sep 21 20:30:56 2019 +0200 +++ b/scripts/install.py Sat Sep 21 22:03:03 2019 +0200 @@ -194,8 +194,10 @@ else: # install them in the user's bin directory platBinDir = os.path.expanduser("~/bin") - if platBinDir != "/usr/local/bin" and \ - os.access("/usr/local/bin", os.W_OK): + if ( + platBinDir != "/usr/local/bin" and + os.access("/usr/local/bin", os.W_OK) + ): platBinDirOld = "/usr/local/bin" modDir = distutils.sysconfig.get_python_lib(True) @@ -276,9 +278,11 @@ text = f.read() f.close() - text = text.replace("@MARKER@", "")\ - .replace("@VERSION@", Version.split(None, 1)[0])\ + text = ( + text.replace("@MARKER@", "") + .replace("@VERSION@", Version.split(None, 1)[0]) .replace("@DATE@", time.strftime("%Y-%m-%d")) + ) f = open(dst, "w", encoding="utf-8") f.write(text) @@ -319,17 +323,19 @@ if sys.platform.startswith(("win", "cygwin")): wname = wfile + ".cmd" if isGuiScript: - wrapper = \ - '''@echo off\n''' \ - '''start "" "{2}\\pythonw.exe"''' \ - ''' "{0}\\{1}.pyw"''' \ + wrapper = ( + '''@echo off\n''' + '''start "" "{2}\\pythonw.exe"''' + ''' "{0}\\{1}.pyw"''' ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\n'''.format( pydir, wfile, sys.exec_prefix) + ) else: - wrapper = \ - '''@"{0}\\python" "{1}\\{2}.py"''' \ + wrapper = ( + '''@"{0}\\python" "{1}\\{2}.py"''' ''' %1 %2 %3 %4 %5 %6 %7 %8 %9\n'''.format( sys.exec_prefix, pydir, wfile) + ) # Mac OS X elif sys.platform == "darwin": @@ -639,8 +645,10 @@ # links were not created by install.py return - regPath = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" + \ - "\\User Shell Folders" + regPath = ( + "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" + + "\\User Shell Folders" + ) if doCleanDesktopLinks or forceCleanDesktopLinks: # 1. cleanup desktop links @@ -1007,8 +1015,10 @@ ) return - regPath = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" + \ - "\\User Shell Folders" + regPath = ( + "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" + + "\\User Shell Folders" + ) # 1. create desktop shortcuts regName = "Desktop" @@ -1459,8 +1469,11 @@ major = int(major) minor = int(minor) pat = int(pat) - if major < 4 or (major == 4 and minor < 14) or \ - (major == 4 and minor == 14 and pat < 2): + if ( + major < 4 or + (major == 4 and minor < 14) or + (major == 4 and minor == 14 and pat < 2) + ): print('Sorry, you must have sip 4.14.2 or higher or' ' a recent snapshot release.') exit(3) @@ -1516,8 +1529,10 @@ ' a recent snapshot release.') exit(5) # check for blacklisted versions - for vers in BlackLists["QScintilla2"] + \ - PlatformBlackLists["QScintilla2"]: + for vers in ( + BlackLists["QScintilla2"] + + PlatformBlackLists["QScintilla2"] + ): if vers == scintillaVersion: print( 'Sorry, QScintilla2 version {0} is not compatible with' @@ -1574,8 +1589,10 @@ f = open(fileName + ".orig", "r", encoding="utf-8") text = f.read() f.close() - text = text.replace("@@REVISION@@", hgOut)\ + text = ( + text.replace("@@REVISION@@", hgOut) .replace("@@VERSION@@", "rev_" + hgOut) + ) copyToFile(fileName, text) else: shutil.copy(fileName + ".orig", fileName)