Preferences/__init__.py

branch
maintenance
changeset 6004
548a9ba8c970
parent 5949
22657f04f332
parent 5970
411f7ba577d5
child 6050
25a4ddb25ca4
diff -r ab851fd69434 -r 548a9ba8c970 Preferences/__init__.py
--- a/Preferences/__init__.py	Sun Nov 19 13:06:01 2017 +0100
+++ b/Preferences/__init__.py	Sat Dec 02 12:40:22 2017 +0100
@@ -53,7 +53,7 @@
 
 from Project.ProjectBrowserFlags import SourcesBrowserFlag, FormsBrowserFlag, \
     ResourcesBrowserFlag, TranslationsBrowserFlag, InterfacesBrowserFlag, \
-    OthersBrowserFlag, AllBrowsersFlag
+    OthersBrowserFlag, ProtocolsBrowserFlag, AllBrowsersFlag
 
 try:
     from Helpviewer.FlashCookieManager.FlashCookieUtilities import \
@@ -112,6 +112,7 @@
         "PathTranslationLocal": "",
         "NetworkInterface": "127.0.0.1",
         "AutoViewSourceCode": False,
+        "MaxVariableSize": 0,     # Bytes, 0 = no limit
     }
     debuggerDefaults["AllowedHosts"] = ["127.0.0.1", "::1%0"]
     if sys.version_info[0] == 2:
@@ -779,54 +780,63 @@
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "Qt4C": (
             SourcesBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "PyQt5": (
             SourcesBrowserFlag |
             FormsBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "PyQt5C": (
             SourcesBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "E6Plugin": (
             SourcesBrowserFlag |
             FormsBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "Console": (
             SourcesBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "Other": (
             SourcesBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "PySide": (
             SourcesBrowserFlag |
             FormsBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "PySideC": (
             SourcesBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
     }
     
     # defaults for the project browser colour settings
@@ -1269,7 +1279,13 @@
     
     # defaults for corba related stuff
     corbaDefaults = {
-        "omniidl": "omniidl"
+        "omniidl": ""
+    }
+    
+    # defaults for protobuf related stuff
+    protobufDefaults = {
+        "protoc": "",
+        "grpcPython": "",
     }
     
     # defaults for user related stuff
@@ -1713,7 +1729,7 @@
                ]:
         return toBool(prefClass.settings.value(
             "Debugger/" + key, prefClass.debuggerDefaults[key]))
-    elif key in ["PassiveDbgPort"]:
+    elif key in ["PassiveDbgPort", "MaxVariableSize"]:
         return int(
             prefClass.settings.value(
                 "Debugger/" + key, prefClass.debuggerDefaults[key]))
@@ -3138,7 +3154,7 @@
 
 def getCorba(key, prefClass=Prefs):
     """
-    Module function to retrieve the various corba settings.
+    Module function to retrieve the various Corba settings.
     
     @param key the key of the value to get
     @param prefClass preferences class used as the storage area
@@ -3150,7 +3166,7 @@
 
 def setCorba(key, value, prefClass=Prefs):
     """
-    Module function to store the various corba settings.
+    Module function to store the various Corba settings.
     
     @param key the key of the setting to be set
     @param value the value to be set
@@ -3159,6 +3175,35 @@
     prefClass.settings.setValue("Corba/" + key, value)
     
 
+def getProtobuf(key, prefClass=Prefs):
+    """
+    Module function to retrieve the various protobuf settings.
+    
+    @param key the key of the value to get
+    @type str
+    @param prefClass preferences class used as the storage area
+    @type Prefs
+    @return the requested protobuf setting
+    @rtype any
+    """
+    return prefClass.settings.value(
+        "Protobuf/" + key, prefClass.protobufDefaults[key])
+    
+
+def setProtobuf(key, value, prefClass=Prefs):
+    """
+    Module function to store the various protobuf settings.
+    
+    @param key the key of the setting to be set
+    @type str
+    @param value the value to be set
+    @type any
+    @param prefClass preferences class used as the storage area
+    @type Prefs
+    """
+    prefClass.settings.setValue("Protobuf/" + key, value)
+    
+
 def getUser(key, prefClass=Prefs):
     """
     Module function to retrieve the various user settings.

eric ide

mercurial