--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditEditor.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditEditor.py Wed Jul 13 14:55:47 2022 +0200 @@ -14,23 +14,25 @@ import sys import os -sys.path.insert(1, os.path.join( - os.path.dirname(__file__), "..", "..", "..", "..")) +sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "..", "..", "..")) # four times up is the eric7 package directory for arg in sys.argv[:]: if arg.startswith("--config="): import Globals + configDir = arg.replace("--config=", "") Globals.setConfigDir(configDir) sys.argv.remove(arg) elif arg.startswith("--settings="): from PyQt6.QtCore import QSettings + settingsDir = os.path.expanduser(arg.replace("--settings=", "")) if not os.path.isdir(settingsDir): os.makedirs(settingsDir) QSettings.setPath( - QSettings.Format.IniFormat, QSettings.Scope.UserScope, settingsDir) + QSettings.Format.IniFormat, QSettings.Scope.UserScope, settingsDir + ) sys.argv.remove(arg) from Globals import AppInfo @@ -41,7 +43,7 @@ def createMainWidget(argv): """ Function to create the main widget. - + @param argv list of commandline parameters @type list of str @return reference to the main widget or None in case of an error @@ -51,11 +53,13 @@ fileName = os.path.basename(argv[1]) if fileName.startswith("hg-histedit-"): from HgHisteditPlanEditor import HgHisteditPlanEditor + return HgHisteditPlanEditor(argv[1]) elif fileName.startswith("hg-editor-"): from HgHisteditCommitEditor import HgHisteditCommitEditor + return HgHisteditCommitEditor(argv[1]) - + return None @@ -64,21 +68,26 @@ Main entry point into the application. """ options = [ - ("--config=configDir", - "use the given directory as the one containing the config files"), - ("--settings=settingsDir", - "use the given directory to store the settings files"), - ("", "name of file to edit") + ( + "--config=configDir", + "use the given directory as the one containing the config files", + ), + ( + "--settings=settingsDir", + "use the given directory to store the settings files", + ), + ("", "name of file to edit"), ] - appinfo = AppInfo.makeAppInfo(sys.argv, - "Mercurial Histedit Editor", - "", - "Editor for the Mercurial histedit command", - options) - res = Startup.simpleAppStartup(sys.argv, - appinfo, - createMainWidget) + appinfo = AppInfo.makeAppInfo( + sys.argv, + "Mercurial Histedit Editor", + "", + "Editor for the Mercurial histedit command", + options, + ) + res = Startup.simpleAppStartup(sys.argv, appinfo, createMainWidget) sys.exit(res) -if __name__ == '__main__': + +if __name__ == "__main__": main()