Preferences/__init__.py

branch
maintenance
changeset 6826
c6dda2cbe081
parent 6693
3629d88ae235
parent 6798
3985c1a67fa2
child 6923
d062df8f1d9f
--- a/Preferences/__init__.py	Sat Feb 16 10:27:50 2019 +0100
+++ b/Preferences/__init__.py	Sat Mar 02 11:15:24 2019 +0100
@@ -171,6 +171,8 @@
         "ShowFileBrowser": True,                # left side
         "ShowSymbolsViewer": True,              # left side
         "ShowCodeDocumentationViewer": True,    # right side
+        "ShowPyPIPackageManager": True,         # right side
+        "ShowCondaPackageManager": True,        # right side
         "ShowCooperation": True,                # right side
         "ShowIrc": True,                        # right side
         "ShowNumbersViewer": True,              # bottom side
@@ -434,6 +436,7 @@
         # show QScintilla completions, if plug-in fails
         "AutoCompletionScintillaOnFail": False,
         "AutoCompletionReversedList": False,
+        "AutoCompletionCacheEnabled": True,
         "AutoCompletionCacheSize": 100,
         "AutoCompletionCacheTime": 300,     # 5 minutes
         "AutoCompletionWatchdogTime": 3000,     # ms
@@ -1580,6 +1583,16 @@
         "Provider": "disabled",
         "ShowInfoOnOpenParenthesis": True,
     }
+    
+    # defaults for conda
+    condaDefaults = {
+        "CondaExecutable": "",
+    }
+    
+    # defaults for pip
+    pipDefaults = {
+        "PipSearchIndex": "",           # used by the search command
+    }
 
 
 def readToolGroups(prefClass=Prefs):
@@ -1983,7 +1996,8 @@
                "LayoutShellEmbedded", "LayoutFileBrowserEmbedded",
                "CheckErrorLog", "NotificationsEnabled", "DynamicOnlineCheck",
                "OpenCrashSessionOnStartup", "CrashSessionEnabled",
-               "ShowCodeDocumentationViewer", "ShowCooperation", "ShowIrc",
+               "ShowCodeDocumentationViewer", "ShowPyPIPackageManager",
+               "ShowCondaPackageManager", "ShowCooperation", "ShowIrc",
                "ShowTemplateViewer", "ShowFileBrowser", "ShowSymbolsViewer",
                "ShowNumbersViewer", "UseNativeMenuBar"]:
         return toBool(prefClass.settings.value(
@@ -3720,7 +3734,7 @@
     
     @param key the key of the value to get
     @param prefClass preferences class used as the storage area
-    @return the requested editor colour
+    @return the requested Code Documentation Viewer value
     """
     if key in ["ShowInfoAsRichText", "ShowInfoOnOpenParenthesis"]:
         return toBool(prefClass.settings.value(
@@ -3743,6 +3757,54 @@
     prefClass.settings.setValue("CodeDocumentationViewer/" + key, value)
 
 
+def getConda(key, prefClass=Prefs):
+    """
+    Module function to retrieve the conda related settings.
+    
+    @param key the key of the value to get
+    @param prefClass preferences class used as the storage area
+    @return the requested conda value
+    """
+    return prefClass.settings.value(
+        "Conda/" + key,
+        prefClass.condaDefaults[key])
+
+
+def setConda(key, value, prefClass=Prefs):
+    """
+    Module function to store the conda related settings.
+    
+    @param key the key of the setting to be set
+    @param value the value to be set
+    @param prefClass preferences class used as the storage area
+    """
+    prefClass.settings.setValue("Conda/" + key, value)
+
+
+def getPip(key, prefClass=Prefs):
+    """
+    Module function to retrieve the pip related settings.
+    
+    @param key the key of the value to get
+    @param prefClass preferences class used as the storage area
+    @return the requested pip value
+    """
+    return prefClass.settings.value(
+        "Pip/" + key,
+        prefClass.pipDefaults[key])
+
+
+def setPip(key, value, prefClass=Prefs):
+    """
+    Module function to store the pip related settings.
+    
+    @param key the key of the setting to be set
+    @param value the value to be set
+    @param prefClass preferences class used as the storage area
+    """
+    prefClass.settings.setValue("Pip/" + key, value)
+
+
 def getGeometry(key, prefClass=Prefs):
     """
     Module function to retrieve the display geometry.

eric ide

mercurial