修改不能报错的 Python代码
要求修改这一块
_('System Default'), None),
('English', 'en'),
('Deutsch (German)', 'de'),
(u'Fran\xe7ais (French)', 'fr'),
(u'\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Russian)', 'ru')]
让其默认 是de语,保留一个英语! 没了。谢谢。
{:301_1006:}
#! /usr/bin/env python 2.7 (62211)
#coding=utf-8
# Compiled at: 2019-03-01 16:01:26
#Powered by BugScaner
#http://tools.bugscaner.com/
#如果觉得不错,请分享给你朋友使用吧!
""" prefs.py -- Preferences for top-level of IDE
Copyright (c) 1999-2012, Archaeopteryx Software, Inc.All rights reserved.
Written by Stephan R.A. Deibel and John P. Ehresman
"""
import sys, os
from wingutils.textio import *
from guiutils.formbuilder import *
from wingbase import miscutils
from wingbase import mime
from wingbase import filefilter
from wingutils import encoding_utils
from wingbase import fileutils
import types, config, gettext
_ = gettext.translation('src', fallback=1).ugettext
kPrefsVersion = CTextIOValueDef('main', 'prefs-version', 'Used internally to identify prefs file version', None, CNoneOr(CType('')), CHiddenGui())
_kLanguages = [
(
_('System Default'), None),
('English', 'en'),
('Deutsch (German)', 'de'),
(u'Fran\xe7ais (French)', 'fr'),
(u'\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Russian)', 'ru')]
kDisplayLanguage = CTextIOValueDef('main', 'display-language', _('The language to use for the user interface.Either the default for this system, or set to a specific supported language.'), None, CValue(*[ l for l in _kLanguages ]), CPopupChoiceGui(_kLanguages))
kDocumentationLanguage = CTextIOValueDef('main', 'documentation-language', _('The language to use for the documentation, when available (not all documentation is translated into all supported languages).'), 'en', CValue(*[ l for l in _kLanguages ]), CPopupChoiceGui(_kLanguages))
kAutoReopenLastProject = CTextIOValueDef('main', 'auto-reopen-last-project', _('Controls whether most recent project is reopened at startup, in the absence of any other project on the command line.'), 1, CBoolean(), CBooleanGui())
from guiutils import scintilla
_kSyntaxChoices = []
for mime_type, name in scintilla.kMimeTypeNames.items():
_kSyntaxChoices.append((name, mime_type))
_kSyntaxChoices.sort()
kExtraMimeTypes = CTextIOValueDef('main', 'extra-mime-types', _('This is a map from file extension or wildcard to mime type.It adds additional file type mappings to those built into Wing.File extensions can be specified alone without dot or wildcard, for example "xcf" or using wildcards containing "*" and/or "?", for example "Makefile*". The mime type to use for Python files is "text/x-python".'), {}, CDict(CType(''), CValue(*[ m for n, m in _kSyntaxChoices ])), CDictGui((_('File Extension'), _('Mime Type')), CSmallTextGui(), CPopupChoiceGui(_kSyntaxChoices)))
kExtraMimeTypeNames = CTextIOValueDef('main', 'extra-mime-type-names', _('This is a map from mime type to displayable name for that mime type; one entry should be added for each new mime type added with the main.extra-mime-types preference.'), {}, CDict(CType(''), CType('')), CDictGui((_('Mime Type'), _('Name')), CSmallTextGui(), CSmallTextGui()))
kExtraMimeTypeComments = CTextIOValueDef('main', 'extra-mime-type-comments', _('This is a map from mime type to tuple of start/end comment characters for each mime type.One entry should be added for each new mime type added with the main.extra-mime-types preference.'), {}, CDict(CType(''), CFixed(CType(''), CType(''))), CDictGui((_('Mime Type'), _('Comment Characters')), CSmallTextGui(), CEntryGroupGui(True, , )))
_kEncodings = encoding_utils._kEncodings[:]
_kEncodings.insert(0, (None, None))
_kEncodings.insert(0, (_('System default (%s)') % miscutils.GetSystemTextEncoding(), None))
kDefaultEncoding = CTextIOValueDef('edit', 'default-encoding', _('The default encoding to use for text files opened in the source editor and other tools, when an encoding for that file cannot be determined by reading the file.Other encodings may also be tried.This also sets the encoding to use for newly created files.'), None, CNoneOr(CValue(*[ x for x in _kEncodings ])), CPopupChoiceGui(_kEncodings, use_underline=False))
import codecs
kMaxErrorLogSize = CTextIOValueDef('main', 'max-error-log-size', _('The number of bytes at which the IDE log file (%s) is truncated.This file can be sent to technical support to help diagnose problems with the IDE.') % config.kErrorLogFile, 500000, CRange(10000, 10000000), CNumberGui(10000, 10000000, 10000, 0))
kUnchangedReloadOptions = CValue('auto-reload', 'request-reload', 'edit-reload', 'never-reload')
kUnchangedReloadChoices = (
(
_('Auto Reload'), 'auto-reload'),
(
_('Immediately Request Reload'), 'request-reload'),
(
_('Request Reload on Edit'), 'edit-reload'),
(
_('Never Reload'), 'never-reload'))
kChangedReloadOptions = CValue('request-reload', 'edit-reload', 'never-reload')
kChangedReloadChoices = (
(
_('Immediately Request Reload'), 'request-reload'),
(
_('Request Reload on Edit'), 'edit-reload'),
(
_('Never Reload'), 'never-reload'))
if config.kAvail101Support:
_unchanged_reload_default = 'never-reload'
_changed_reload_dfeault = 'never-reload'
else:
_unchanged_reload_default = 'auto-reload'
_changed_reload_dfeault = 'request-reload'
kUnchangedReloadPolicy = CTextIOValueDef('cache', 'unchanged-reload-policy', _('Selects action to perform on files found to be externally changed but unaltered within the IDE.Use Auto Reload to automatically reload these files, Immediately Request Reload to ask via a dialog box upon detection, Request Reload on Edit to ask only if the unchanged file is edited within the IDE subsequently, or Never Reload to ignore external changes (although you will still be warned if you try to save over an externally changed file)'), _unchanged_reload_default, kUnchangedReloadOptions, CPopupChoiceGui(kUnchangedReloadChoices))
kChangedReloadPolicy = CTextIOValueDef('cache', 'changed-reload-policy', _('Selects action to perform on files found to be externally changed and that also have been altered in the IDE.One of Immediately Request Reload to ask via a dialog box upon detection, Request Reload on Edit to ask if the file is edited further, or Never Reload to ignore external changes (although you will always be warned if you try to save over an externally changed file)'), _changed_reload_dfeault, kChangedReloadOptions, CPopupChoiceGui(kChangedReloadChoices))
kExternalCheckFreq = CTextIOValueDef('cache', 'external-check-freq', _('Time in seconds indicating the frequency with which the IDE should check the disk for files that have changed externally. Set to 0 to disable entirely.'), 5, CType(0.1, 1), CNumberGui(0, 10000000, 5, 1))
kCheckHashBeforeReload = CTextIOValueDef('cache', 'check-hash-before-reload', _("Don't reload files if size has not changed and a hash of the contents matches the hash when it was last read. This check is skipped if file is larger than 5 MB."), True, CBoolean(), CBooleanGui())
script_dir = config.GetWingFilename('scripts')
kScriptPath = CTextIOValueDef('main', 'script-path', _('Specifies the directories in which Wing will look for user-defined scripts that extend the functionality of the IDE itself.The directory names may contain environment variables in the $(envname) form.Use $(WING:PROJECT_DIR) for the project directory.For each directory, Wing will load all found Python modules and packages, treating any function whose name starts with a letter (not _ or __) as a script-provided command.Extension scripts found in files within directories later in the list will override scripts of the same name found earlier, except that scripts can never override commands that are defined internally in Wing itself (these are documented in the Command Reference in the users manual). See the Scripting and Extending chapter of the manual for more information on writing and using extension scripts.Note that %s is always appended to the given path since it contains scripts that ship with Wing.') % script_dir, [
fileutils.join(config.kUserWingDir, 'scripts')], CValueList(CType('')), CPathSequenceGui())
kAutoReloadScripts = CTextIOValueDef('main', 'auto-reload-scripts', _('When enabled, Wing will automatically reload scripts that extend the IDE when they are edited and saved from the IDE.This makes developing extension scripts for the IDE very fast, and should work in most cases.Disable this when working on extension scripts that do not reload properly, such as those that reach through the scripting API extensively.'), True, CBoolean(), CBooleanGui())
if config.kAvail101Support:
_kAutoCheckUpdatesDefault = 0
else:
_kAutoCheckUpdatesDefault = 1
kAutoCheckUpdates = CTextIOValueDef('main', 'auto-check-updates', _('Automatically attempt to connect to wingware.com to check for updates once every day after Wing is started.'), _kAutoCheckUpdatesDefault, CBoolean(), CBooleanGui())
if config.kAvail101Support or config.kSteam:
_kAutoCheckSupportDefault = 0
else:
_kAutoCheckSupportDefault = 1
kMonitorSupportUpdates = CTextIOValueDef('main', 'monitor-support-upgrades', _('Show a reminder when Support+Upgrades for the active license is expired or will expire soon.'), _kAutoCheckSupportDefault, CBoolean(), CBooleanGui())
kIgnoredUpdates = CTextIOValueDef('main', 'ignored-updates', _('Used internally to keep track of updates the user is not interested in'), [], CValueList(CType('')), None)
kStartDirPolicyChoices = (
(
_('Base on the Current File or Selection'), 'current-focus'),
(
_("Use Project's Home Directory"), 'current-project'),
(
_('Use Last Open/Save Directory'), 'recent-directory'),
(
_('Use Startup or Current Directory'), 'current-directory'),
(
_('Use Fixed Directory Specified Below'), 'selected-directory'))
kStartDirPolicy = CTextIOValueDef('main', 'start-dir-policy', _('Defines how Wing determines the starting directory to use when prompting for a file name:Either based on location of the resource at current focus, location of the current project home directory, the last directory visited for file selection, the current directory at startup (or selected since), or always the specific fixed directory entered here.'), ('current-focus',
''), CFixed(CValue(*[ i for i in kStartDirPolicyChoices ]), CType('')), CPopupPlusOtherGui(kStartDirPolicyChoices, CFileSelectorGui(want_dir=1, name_type=dialogs.kExistingDirectoryName), ('selected-directory', )))
_kBaseExcludes = (
(
filefilter.kFileNameSpec, '*~'),
(
filefilter.kFileNameSpec, '#*#'),
(
filefilter.kFileNameSpec, '.#*'),
(
filefilter.kFileNameSpec, '*.svn-base'),
(
filefilter.kFileNameSpec, '/.coverage'),
(
filefilter.kFileNameSpec, '*.orig'),
(
filefilter.kDirNameSpec, '__pycache__'),
(
filefilter.kDirNameSpec, '.bzr'),
(
filefilter.kDirNameSpec, 'CVS'),
(
filefilter.kDirNameSpec, '.hg'),
(
filefilter.kDirNameSpec, '.git'),
(
filefilter.kDirNameSpec, '.svn'),
(
filefilter.kDirNameSpec, '_svn'),
(
filefilter.kDirNameSpec, '.xvpics'))
kPythonFilterName = 'Python Files'
kHiddenAndTempFilterName = 'Hidden & Temporary Files'
kNonGeneratedFilterName = 'All Source Files'
kCCPPFilterName = 'C/C++ Files'
kHTMLXMLFilterName = 'HTML and XML Files'
kPythonFilterNameX = _('Python Files')
kHiddenAndTempFilterNameX = _('Hidden & Temporary Files')
kNonGeneratedFilterNameX = _('All Source Files')
kCCPPFilterNameX = _('C/C++ Files')
kHTMLXMLFilterNameX = _('HTML and XML Files')
_kFilterNameToTranslatedName = {kPythonFilterName: kPythonFilterNameX,
kHiddenAndTempFilterName: kHiddenAndTempFilterNameX,
kNonGeneratedFilterName: kNonGeneratedFilterNameX,
kCCPPFilterName: kCCPPFilterNameX,
kHTMLXMLFilterName: kHTMLXMLFilterNameX}
def _FilterNameToTranslatedName(name):
return _kFilterNameToTranslatedName.get(name, name)
_kTranslatedNameToFilterName = {}
for key, value in _kFilterNameToTranslatedName.items():
_kTranslatedNameToFilterName = key
def _TranslatedNameToFilterName(tname):
"""Get untranslated filter name for given translated name; may return the
same name if already in English or is a user-named file filter"""
return _kTranslatedNameToFilterName.get(tname, tname)
_kDefaultFilters = {kPythonFilterName: (
(
(
filefilter.kMimeTypeSpec, mime.kPythonMimeType),
(
filefilter.kMimeTypeSpec, mime.kCythonMimeType)),
_kBaseExcludes[:]),
kCCPPFilterName: (
(
(
filefilter.kMimeTypeSpec, 'text/x-c-source'),
(
filefilter.kMimeTypeSpec, 'text/x-cpp-source')),
_kBaseExcludes[:]),
kHTMLXMLFilterName: (
(
(
filefilter.kMimeTypeSpec, 'text/html'),
(
filefilter.kMimeTypeSpec, 'text/xml'),
(
filefilter.kMimeTypeSpec, 'text/x-zope-pt')),
_kBaseExcludes[:]),
kNonGeneratedFilterName: (
(),
(
(
filefilter.kFileNameSpec, '*.o'),
(
filefilter.kFileNameSpec, '*.obj'),
(
filefilter.kFileNameSpec, '*.a'),
(
filefilter.kFileNameSpec, '*.lib'),
(
filefilter.kFileNameSpec, '*.so'),
(
filefilter.kFileNameSpec, '*.dll'),
(
filefilter.kFileNameSpec, '*.exe'),
(
filefilter.kFileNameSpec, '*.ilk'),
(
filefilter.kFileNameSpec, '*.pdb'),
(
filefilter.kFileNameSpec, '*.pyc'),
(
filefilter.kFileNameSpec, '*.pyo'),
(
filefilter.kFileNameSpec, '*.pyd'),
(
filefilter.kFileNameSpec, '*$py.class'),
(
filefilter.kFileNameSpec, '/core'),
(
filefilter.kFileNameSpec, '*.bak'),
(
filefilter.kFileNameSpec, '*.tmp'),
(
filefilter.kFileNameSpec, '*.temp'),
(
filefilter.kFileNameSpec, '*-old'),
(
filefilter.kFileNameSpec, '*.old'),
(
filefilter.kFileNameSpec, '*.wpr'),
(
filefilter.kFileNameSpec, '*.wpu'),
(
filefilter.kFileNameSpec, '*.zip'),
(
filefilter.kFileNameSpec, '*.tgz'),
(
filefilter.kFileNameSpec, '*.tar.gz'),
(
filefilter.kFileNameSpec, '*.dsp'),
(
filefilter.kFileNameSpec, '*.dsw'),
(
filefilter.kFileNameSpec, '*.sln'),
(
filefilter.kFileNameSpec, '*.suo'),
(
filefilter.kFileNameSpec, '*.vcproj'),
(
filefilter.kFileNameSpec, '*.user'),
(
filefilter.kFileNameSpec, '*.manifest'),
(
filefilter.kFileNameSpec, '*.ncb'),
(
filefilter.kFileNameSpec, '*.bsc'),
(
filefilter.kFileNameSpec, '*.sbr'),
(
filefilter.kFileNameSpec, '*.log')) + _kBaseExcludes),
kHiddenAndTempFilterName: (
(
(
filefilter.kFileNameSpec, '*.o'),
(
filefilter.kFileNameSpec, '*.obj'),
(
filefilter.kFileNameSpec, '*.a'),
(
filefilter.kFileNameSpec, '*.lib'),
(
filefilter.kFileNameSpec, '*.so'),
(
filefilter.kFileNameSpec, '*.dll'),
(
filefilter.kFileNameSpec, '*.exe'),
(
filefilter.kFileNameSpec, '*.ilk'),
(
filefilter.kFileNameSpec, '*.pdb'),
(
filefilter.kFileNameSpec, '*.pyc'),
(
filefilter.kFileNameSpec, '*.pyo'),
(
filefilter.kFileNameSpec, '*.pyd'),
(
filefilter.kFileNameSpec, '*$py.class'),
(
filefilter.kFileNameSpec, '/core'),
(
filefilter.kFileNameSpec, '*.bak'),
(
filefilter.kFileNameSpec, '*.tmp'),
(
filefilter.kFileNameSpec, '*.temp'),
(
filefilter.kFileNameSpec, '*-old'),
(
filefilter.kFileNameSpec, '*.old'),
(
filefilter.kFileNameSpec, '*.wpr'),
(
filefilter.kFileNameSpec, '*.wpu'),
(
filefilter.kFileNameSpec, '*.zip'),
(
filefilter.kFileNameSpec, '*.tgz'),
(
filefilter.kFileNameSpec, '*.tar.gz'),
(
filefilter.kFileNameSpec, '*.ncb'),
(
filefilter.kFileNameSpec, '*.bsc'),
(
filefilter.kFileNameSpec, '*.sbr')) + _kBaseExcludes,
())}
_kFilterPopupItems = [ (value, key) for key, value in filefilter.kFileFilterSpecTypes.items() ]
_kSpecItemGui1 = CEntryGroupGui(0, (_('Type'), _('Spec')), (CPopupChoiceGui(_kFilterPopupItems), CSmallTextGui()))
_kSpecItemGui2 = CEntryGroupGui(0, (_('Type'), _('Spec')), (CPopupChoiceGui(_kFilterPopupItems), CSmallTextGui()))
_kSpecGui1 = CSequenceGui(_kSpecItemGui1)
_kSpecGui2 = CSequenceGui(_kSpecItemGui2)
_kFilterGui = CEntryGroupGui(0, (_('Include'), _('Exclude')), (_kSpecGui1, _kSpecGui2))
_filters_doc = _('Defines file filters to apply to file names for inclusion and exclusion from a larger set (such as scanned disk files or all project files).\n\nEach filter is named and contains one list of inclusion patterns and one list of exclusion patterns.The patterns can be a wildcard on the file name, wildcard on a directory name, or a mime type name.\n\n Only a single pattern needs to be matched for inclusion or exclusion.Exclusion patterns take precedence over inclusion patterns, so any match on an exclusion pattern will always exclude a file from the selected set.Filters are used in constraining search, adding project files, and for other operations on collections of files.')
_filters_prefname = 'file-filters'
_filters_type = CFileFiltersType()
_defaults = CFileFilters()
for name, (inc, exc) in _kDefaultFilters.items():
_defaults = (
set(inc), set(exc))
_kDefaultFilters = _defaults
def _translate_filters(inout, values, key, value):
if inout == 'in':
xkey, xvalue = _FilterNameToTranslatedName(key), value
if xkey == key and xkey in _kTranslatedNameToFilterName and _kTranslatedNameToFilterName != xkey:
raise KeyError
else:
return (
xkey, xvalue)
else:
return (
_TranslatedNameToFilterName(key), value)
kFileFilters = CTextIOValueDef('main', _filters_prefname, _filters_doc, _kDefaultFilters, _filters_type, CDictGui((_('Name'), _('Specification')), CSmallTextGui(), _kFilterGui, dict_class=datatype.CFileFilters, translate_cb=_translate_filters))
kBreakOnCritical = CTextIOValueDef('main', 'debug-break-on-critical', _('If True and a gtk, gdk, or glib critical message is logged, Wing tries to start a C debugger and break at the current execution point'), False, CBoolean(), CBooleanGui())
kShowSplashScreen = CTextIOValueDef('main', 'show-splash-screen', _('Controls whether or not the splash screen is shown at startup.'), 1, CBoolean(), CBooleanGui())
_kInstanceReusePolicy = [
(
_('Reuse Existing Instance to Open Files'), None),
(
_('Always Reuse Existing Instance'), 'reuse'),
(
_('Always Launch New Instance'), 'new')]
kInstanceReusePolicy = CTextIOValueDef('main', 'instance-reuse-policy', _('Controls whether Wing tries to reuse an existing running instance of the IDE when it is launched again.'), None, CTuple(CValue(*[ i for i in _kInstanceReusePolicy ])), CPopupChoiceGui(_kInstanceReusePolicy))
if config.kAvailRemoteSupport:
kAutoCheckRemoteAgentVersion = CTextIOValueDef('main', 'autocheck-remote-agent-version', _("When enabled, Wing will show a dialog offerring to update any remote agent that does not match Wing's version."), True, CBoolean(), CBooleanGui())
if sys.platform != 'win32':
_ssh_default_label = 'ssh'
else:
_ssh_default_label = 'plink.exe or ssh.exe'
kSSHExecutable = CTextIOValueDef('main', 'ssh-executable', _('The executable to use in order to run the SSH client on the host where Wing is running.This is used to establish secure SSH tunnels to remote hosts. You must configure SSH and a key server outside of Wing, since Wing assumes it can connect to remote hosts without entering a password.'), None, CNoneOr(CType('')), CDefaultsOrSpecifyGui(False, ((_('Find %s on PATH') % _ssh_default_label, None),), _('Use executable:'), CSmallTextGui()))
kSSHRemotePort = CTextIOValueDef('main', 'ssh-remote-port', _("The TCP/IP port number to use for the remote end of the SSH tunnel to Wing's remote agent.Using a random port should work in most cases and avoids collisions if there are multiple active sessions, but a fixed port is needed if the random port generated IDE-side is not also available on the remote host."), None, CNoneOr(CType(1)), CDefaultsOrSpecifyGui(False, ((_('Use Random Port'), None),), _('Use specified port:'), CNumberGui(1024, 65535, 1, 0, 50010)))
kSSHTimeout = CTextIOValueDef('main', 'ssh-timeout', _('The maximum time in seconds to wait for SSH tunnels to be established.'), 10, CType(1), CNumberGui(3, 60, 1, 0, 5))
kHungConnectionTimeout = CTextIOValueDef('main', 'hung-connection-threshold', _('The maximum time in seconds to wait if a connection to a remote host is not responding.Afterwards the connection is closed and retried.'), 15, CType(1), CNumberGui(3, 60, 1, 0, 5))
kHTTPProxy = CTextIOValueDef('main', 'http-proxy', _('Allows manual configuration of an http proxy to be used for feedback, bug reports, and license activation, all of which result in Wing connecting to wingware.com via http.Leave user name and password blank if not required.'), None, CNoneOr(CFixed(CType(''), CType(1), CType(''), CType(''))), CDefaultsOrSpecifyGui(False, ((_('No proxy server (or auto-detected)'), None),), _('Configure proxy server manually:'), CEntryGroupGui(False, (_('Host name'), _('Port'), _('User name'),
_('Password')), (
CSmallTextGui(), CNumberGui(1, 65535, 1, 0),
CSmallTextGui(), CSmallTextGui()))))
_kAutoRStripChoices = (
(
_('Never'), 'disabled'),
(
_('When saving files'), 'on-save'),
(
_('When saving files in project'), 'on-save-project'))
kAutoRStripOnSave = CTextIOValueDef('main', 'auto-rstrip-on-save', _('Controls whether to automatically strip trailing white space in the editor.May be enabled for any file or only files that are part of the current project.'), 'disabled', CFixed(CValue(*[ i for i in _kAutoRStripChoices ]), CType('')), CPopupChoiceGui(_kAutoRStripChoices))
_kPerspectiveStyles = (
(
_('Tools and Layout'), 'tools-only'),
(
_('Tools, Layout, and Editors'), 'tools-and-editors'),
(
_('All Visual State'), 'all'))
kPerspectiveSharedFile = CTextIOValueDef('main', 'perspective-shared-file', _("Selects the file to use for storing and retrieving shared perspectives. By default (when value is None) the file 'perspectives' in the user settings directory is used."), None, COneOf(CType(None), CType('')), CDefaultsOrSpecifyGui(0, ((_('Default'), None),), _('File:'), CFileSelectorGui(name_type=dialogs.kSaveAsFilename, hostname=None)))
_kPerspectiveAutoSaveOptions = (
(
_('Always'), 'always'),
(
_('Never'), 'never'),
(
_('Prompt'), 'prompt'),
(
_('Configured by Perspective'), 'choose'))
kPerspectiveAutoSave = CTextIOValueDef('main', 'perspective-auto-save', _('Selects whether to auto-save perspectives when switching to another perspective. Can always auto-save, never auto-save, prompt each time a perspective is left, or auto-save as configured on a per-perspective basis.'), 'always', CFixed(CValue(*[ i for i in _kPerspectiveAutoSaveOptions ]), CType('')), CPopupChoiceGui(_kPerspectiveAutoSaveOptions))
kFileSetSharedFile = CTextIOValueDef('main', 'fileset-shared-file', _("Selects the file to use for storing and retrieving shared named files sets. By default (when value is None) the file 'filesets' in the user settings directory is used."), None, COneOf(CType(None), CType('')), CDefaultsOrSpecifyGui(0, ((_('Default'), None),), _('File:'), CFileSelectorGui(name_type=dialogs.kSaveAsFilename, hostname=None)))
kPluginOverrides = CTextIOValueDef('main', 'plugin-overrides', _('Defines which plugins are enabled or disabled.'), {}, CDict(CType(''), CBoolean()), None)
kHelpFontZoom = CTextIOValueDef('main', 'help-font-zoom', _('The amount by which to zoom font sizes in or out in the documentation viewer.'), 1.0, CType(1.0), CNumberGui(0.7, 5.0, 0.1, 1, default=1.0))
kSourceAssistantUsePEP287 = CTextIOValueDef('main', 'sassist-tries-pep287', _('Whether to try parsing docstrings as ReST format for display in the Source Assistant.This may destroy formatting of some docstrings.'), True, CBoolean(), CBooleanGui())
_kPEP287ErrorLevels = [
(
_('Debug'), 0),
(
_('Informational'), 1),
(
_('Warning'), 2),
(
_('Error'), 3),
(
_('Severe'), 4)]
kSourceAssistantPEP287ErrorThreshold = CTextIOValueDef('main', 'sassist-pep287-error-level', _('The error level at or above which the source assistant will display parse errors in PEP287 docstrings (if showing PEP287 errors) or will fall back to showing plain text (if not showing PEP287 errors).For errors below this threshold, a best attempt is made to achieve a reasonable rendering.'), 2, CValue(0, 1, 2, 3, 4), CPopupChoiceGui(_kPEP287ErrorLevels))
kSourceAssistantAllowPEP287Errors = CTextIOValueDef('main', 'sassist-allow-pep287-errors', _('Whether to render docstrings even if they contain parse errors at or above the threshold set by Source Assistant PEP 287 Error Threshold.When disabled, failing docstrings are shown as plain text instead.When enabled, a best effort is made to display the formatted docstring while suppressing errors.'), False, CBoolean(), CBooleanGui())
kSourceAssistantRewrapsDocstrings = CTextIOValueDef('main', 'sassist-tries-rewrap', _('Whether to rewrap plain text docstrings for display in the Source Assistant.This may destroy formatting of some docstrings.'), True, CBoolean(), CBooleanGui())
kSourceAssistantAlwaysShowDocstrings = CTextIOValueDef('main', 'sassist-always-show-docstrings', _('Whether to always show docstrings in the Source Assistant.When disabled, only the docstring for the last displayed symbol is shown.'), False, CBoolean(), CBooleanGui())
kSourceAssistantShowValidity = CTextIOValueDef('main', 'sassist-show-validity', _('Whether show docstring type and validity in the Source Assistant.'), True, CBoolean(), CBooleanGui())
kLastPrefsPage = CTextIOValueDef('main', 'last-prefs-page', _('Used internally to select the most recently used prefs page.'), (-1,
-1), CFixed(CType(1), CType(1)), CHiddenGui())
kLastPropertiesPages = CTextIOValueDef('main', 'last-properties-pages', _('Used internally to select the most recently used properties dialog pages.'), {}, CDict(CType(''), CType(1)), CHiddenGui()) 看见头都大了,难怪楼主火冒金星 本帖最后由 冥界3大法王 于 2020-1-7 23:35 编辑
默认是德语了,但是代码未被执行呢?
#! /usr/bin/env python 2.7 (62211)
#coding=utf-8
# Compiled at: 2020-01-06 10:28:06
#Powered by BugScaner
#http://tools.bugscaner.com/
#如果觉得不错,请分享给你朋友使用吧!
""" prefs.py -- Preferences for top-level of IDE
Copyright (c) 1999-2012, Archaeopteryx Software, Inc.All rights reserved.
Written by Stephan R.A. Deibel and John P. Ehresman
"""
import sys
from wingutils.textio import *
from guiutils.formbuilder import *
from wingbase import miscutils
from wingbase import mime
from wingbase import filefilter
from wingutils import encoding_utils
from wingbase import fileutils
import types, config, gettext
_ = gettext.translation('src', fallback=1).ugettext
kPrefsVersion = CTextIOValueDef('main', 'prefs-version', 'Used internally to identify prefs file version', None, CNoneOr(CType(2)), CHiddenGui())
_kLanguages = [
(
_('System Default'), None),
('English', 'en'),
('Deutsch (German)', 'de')]
kDisplayLanguage = CTextIOValueDef('main', 'display-language', _('The language to use for the user interface.Either the default for this system, or set to a specific supported language.'), 'de', CValue(* for l in _kLanguages]), CPopupChoiceGui(_kLanguages))
kAutoReopenLastProject = CTextIOValueDef('main', 'auto-reopen-last-project', _('Controls whether most recent project is reopened at startup, in the absence of any other project on the command line.'), 1, CBoolean(), CBooleanGui())
from guiutils import scintilla
_kSyntaxChoices = []
for mime_type, name in scintilla.kMimeTypeNames.items():
_kSyntaxChoices.append((name, mime_type))
_kSyntaxChoices.sort()
kExtraMimeTypes = CTextIOValueDef('main', 'extra-mime-types', _('This is a map from file extension or wildcard to mime type.It adds additional file type mappings to those built into Wing.File extensions can be specified alone without dot or wildcard, for example "xcf" or using wildcards containing "*" and/or "?", for example "Makefile*". The mime type to use for Python files is "text/x-python".'), {}, CDict(CType(''), CValue(*[ m for n, m in _kSyntaxChoices ])), CDictGui((_('File Extension'), _('Mime Type')), CSmallTextGui(), CPopupChoiceGui(_kSyntaxChoices)))
kExtraMimeTypeNames = CTextIOValueDef('main', 'extra-mime-type-names', _('This is a map from mime type to displayable name for that mime type; one entry should be added for each new mime type added with the main.extra-mime-types preference.'), {}, CDict(CType(''), CType('')), CDictGui((_('Mime Type'), _('Name')), CSmallTextGui(), CSmallTextGui()))
kExtraMimeTypeComments = CTextIOValueDef('main', 'extra-mime-type-comments', _('This is a map from mime type to tuple of start/end comment characters for each mime type.One entry should be added for each new mime type added with the main.extra-mime-types preference.'), {}, CDict(CType(''), CFixed(CType(''), CType(''))), CDictGui((_('Mime Type'), _('Comment Characters')), CSmallTextGui(), CEntryGroupGui(True, , )))
_kEncodings = encoding_utils._kEncodings[:]
_kEncodings.insert(0, (None, None))
_kEncodings.insert(0, (_('System default (%s)') % miscutils.GetSystemTextEncoding(), None))
kDefaultEncoding = CTextIOValueDef('edit', 'default-encoding', _('The default encoding to use for text files opened in the source editor and other tools, when an encoding for that file cannot be determined by reading the file.Other encodings may also be tried.This also sets the encoding to use for newly created files.'), None, CNoneOr(CValue(*[ x for x in _kEncodings ])), CPopupChoiceGui(_kEncodings, use_underline=False))
kMaxErrorLogSize = CTextIOValueDef('main', 'max-error-log-size', _('The number of bytes at which the IDE log file (%s) is truncated.This file can be sent to technical support to help diagnose problems with the IDE.') % config.kErrorLogFile, 500000, CRange(10000, 10000000), CNumberGui(10000, 10000000, 10000, 0))
kUnchangedReloadOptions = CValue('auto-reload', 'request-reload', 'edit-reload', 'never-reload')
kUnchangedReloadChoices = (
(
_('Auto Reload'), 'auto-reload'),
(
_('Immediately Request Reload'), 'request-reload'),
(
_('Request Reload on Edit'), 'edit-reload'),
(
_('Never Reload'), 'never-reload'))
kChangedReloadOptions = CValue('request-reload', 'edit-reload', 'never-reload')
kChangedReloadChoices = (
(
_('Immediately Request Reload'), 'request-reload'),
(
_('Request Reload on Edit'), 'edit-reload'),
(
_('Never Reload'), 'never-reload'))
if config.kAvail101Support:
_unchanged_reload_default = 'never-reload'
_changed_reload_dfeault = 'never-reload'
else:
_unchanged_reload_default = 'auto-reload'
_changed_reload_dfeault = 'request-reload'
kUnchangedReloadPolicy = CTextIOValueDef('cache', 'unchanged-reload-policy', _('Selects action to perform on files found to be externally changed but unaltered within the IDE.Use Auto Reload to automatically reload these files, Immediately Request Reload to ask via a dialog box upon detection, Request Reload on Edit to ask only if the unchanged file is edited within the IDE subsequently, or Never Reload to ignore external changes (although you will still be warned if you try to save over an externally changed file)'), _unchanged_reload_default, kUnchangedReloadOptions, CPopupChoiceGui(kUnchangedReloadChoices))
kChangedReloadPolicy = CTextIOValueDef('cache', 'changed-reload-policy', _('Selects action to perform on files found to be externally changed and that also have been altered in the IDE.One of Immediately Request Reload to ask via a dialog box upon detection, Request Reload on Edit to ask if the file is edited further, or Never Reload to ignore external changes (although you will always be warned if you try to save over an externally changed file)'), _changed_reload_dfeault, kChangedReloadOptions, CPopupChoiceGui(kChangedReloadChoices))
kExternalCheckFreq = CTextIOValueDef('cache', 'external-check-freq', _('Time in seconds indicating the frequency with which the IDE should check the disk for files that have changed externally. Set to 0 to disable entirely.'), 5, CType(0.1, 1), CNumberGui(0, 10000000, 5, 1))
kCheckHashBeforeReload = CTextIOValueDef('cache', 'check-hash-before-reload', _("Don't reload files if size has not changed and a hash of the contents matches the hash when it was last read. This check is skipped if file is larger than 5 MB."), True, CBoolean(), CBooleanGui())
_kDeletedDiskFileOptions = [
(
_('Closes Editor'), 'close'),
(
_('Shows Blank Editor'), 'blank'),
(
_('Prompts for Action'), 'prompt')]
if config.kAvail101Support:
_kDeletedDiskFilePolicyDefault = 'prompt'
else:
_kDeletedDiskFilePolicyDefault = 'close'
kDeletedDiskFilePolicy = CTextIOValueDef('guimgr', 'deleted-disk-file-policy', _('Specifies the behavior of reload when a file that is open in an editor disappears on disk.The default Closes Editor is recommended if using revision control.Otherwise, retaining the current editor content reduces the chances of entirely losing a file if it is accidentally deleted on disk.'), _kDeletedDiskFilePolicyDefault, CValueList(CValue(*[ i for i in _kDeletedDiskFileOptions ])), CPopupChoiceGui(_kDeletedDiskFileOptions))
kScriptPath = CTextIOValueDef('main', 'script-path', _('Specifies the directories in which Wing will look for user-defined scripts that extend the functionality of the IDE itself.The directory names may contain environment variables in the $(envname) form.Use $(WING:PROJECT_DIR) for the project directory.For each directory, Wing will load all found Python modules and packages, treating any function whose name starts with a letter (not _ or __) as a script-provided command.Extension scripts found in files within directories later in the list will override scripts of the same name found earlier, except that scripts can never override commands that are defined internally in Wing itself (these are documented in the Command Reference in the users manual). See the Scripting and Extending chapter of the manual for more information on writing and using extension scripts.'), [
fileutils.join(config.kUserSettings, 'scripts')], CValueList(CType('')), CPathSequenceGui())
kAutoReloadScripts = CTextIOValueDef('main', 'auto-reload-scripts', _('When enabled, Wing will automatically reload scripts that extend the IDE when they are edited and saved from the IDE.This makes developing extension scripts for the IDE very fast, and should work in most cases.Disable this when working on extension scripts that do not reload properly, such as those that reach through the scripting API extensively.'), True, CBoolean(), CBooleanGui())
if config.kAvail101Support:
_kAutoCheckUpdatesDefault = 0
else:
_kAutoCheckUpdatesDefault = 1
kAutoCheckUpdates = CTextIOValueDef('main', 'auto-check-updates', _('Automatically check for updates at startup by connecting to wingware.com. Updates are checked every three days, or more often for prerelease versions.'), _kAutoCheckUpdatesDefault, CBoolean(), CBooleanGui())
if config.kAvail101Support or config.kSteam:
_kAutoCheckSupportDefault = 0
else:
_kAutoCheckSupportDefault = 1
kMonitorSupportUpdates = CTextIOValueDef('main', 'monitor-support-upgrades', _('Show a reminder when Support+Upgrades for the active license is expired or will expire soon.'), _kAutoCheckSupportDefault, CBoolean(), CBooleanGui())
kIgnoredUpdate = CTextIOValueDef('main', 'ignored-update', _('Used internally to keep track of latest version the user is not interested in'), (0,
0,
0,
0), CTuple(CType(1)), None)
if config.kAvail101Support:
_kSubmitStatsDefault = 0
else:
_kSubmitStatsDefault = 1
kSubmitUsageStats = CTextIOValueDef('main', 'submit-usage-stats', _('Allow submitting a log of which features you use to Wingware.This is done periodically at startup and also when you submit bug reports, feedback, or check for updates.The data provided is held confidential, used only for technical support and planning future development, and can be seen in the file %s') % config.kStatsLogFile, _kSubmitStatsDefault, CBoolean(), CBooleanGui())
kStartDirPolicyChoices = (
(
_('Base on the Current File or Selection'), 'current-focus'),
(
_("Use Project's Home Directory"), 'current-project'),
(
_('Use Last Open/Save Directory'), 'recent-directory'),
(
_('Use Startup or Current Directory'), 'current-directory'),
(
_('Use Fixed Directory Specified Below'), 'selected-directory'))
kStartDirPolicy = CTextIOValueDef('main', 'start-dir-policy', _('Defines how Wing determines the starting directory to use when prompting for a file name:Either based on location of the resource at current focus, location of the current project home directory, the last directory visited for file selection, the current directory at startup (or selected since), or always the specific fixed directory entered here.'), ('current-focus',
''), CFixed(CValue(*[ i for i in kStartDirPolicyChoices ]), CType('')), CPopupPlusOtherGui(kStartDirPolicyChoices, CFileSelectorGui(want_dir=1, name_type=dialogs.kExistingDirectoryName), ('selected-directory', )))
_kBaseExcludes = (
(
filefilter.kFileNameSpec, '*~'),
(
filefilter.kFileNameSpec, '#*#'),
(
filefilter.kFileNameSpec, '.#*'),
(
filefilter.kFileNameSpec, '*.svn-base'),
(
filefilter.kFileNameSpec, '/.coverage'),
(
filefilter.kFileNameSpec, '*.orig'),
(
filefilter.kDirNameSpec, '__pycache__'),
(
filefilter.kDirNameSpec, '.bzr'),
(
filefilter.kDirNameSpec, 'CVS'),
(
filefilter.kDirNameSpec, '.hg'),
(
filefilter.kDirNameSpec, '.git'),
(
filefilter.kDirNameSpec, '.svn'),
(
filefilter.kDirNameSpec, '_svn'),
(
filefilter.kDirNameSpec, '.xvpics'),
(
filefilter.kDirNameSpec, '.pytest_cache'))
kPythonFilterName = 'Python Files'
kHiddenAndTempFilterName = 'Hidden & Temporary Files'
kNonGeneratedFilterName = 'All Source Files'
kCCPPFilterName = 'C/C++ Files'
kHTMLXMLFilterName = 'HTML and XML Files'
kPythonFilterNameX = _('Python Files')
kHiddenAndTempFilterNameX = _('Hidden & Temporary Files')
kNonGeneratedFilterNameX = _('All Source Files')
kCCPPFilterNameX = _('C/C++ Files')
kHTMLXMLFilterNameX = _('HTML and XML Files')
_kFilterNameToTranslatedName = {kPythonFilterName: kPythonFilterNameX,
kHiddenAndTempFilterName: kHiddenAndTempFilterNameX,
kNonGeneratedFilterName: kNonGeneratedFilterNameX,
kCCPPFilterName: kCCPPFilterNameX,
kHTMLXMLFilterName: kHTMLXMLFilterNameX}
def _FilterNameToTranslatedName(name):
return _kFilterNameToTranslatedName.get(name, name)
_kTranslatedNameToFilterName = {}
for key, value in _kFilterNameToTranslatedName.items():
_kTranslatedNameToFilterName = key
def _TranslatedNameToFilterName(tname):
"""Get untranslated filter name for given translated name; may return the
same name if already in English or is a user-named file filter"""
return _kTranslatedNameToFilterName.get(tname, tname)
_kDefaultFilters = {kPythonFilterName: (
(
(
filefilter.kMimeTypeSpec, mime.kPythonMimeType),
(
filefilter.kMimeTypeSpec, mime.kCythonMimeType)),
_kBaseExcludes[:]),
kCCPPFilterName: (
(
(
filefilter.kMimeTypeSpec, 'text/x-c-source'),
(
filefilter.kMimeTypeSpec, 'text/x-cpp-source')),
_kBaseExcludes[:]),
kHTMLXMLFilterName: (
(
(
filefilter.kMimeTypeSpec, 'text/html'),
(
filefilter.kMimeTypeSpec, 'text/xml'),
(
filefilter.kMimeTypeSpec, 'text/x-zope-pt')),
_kBaseExcludes[:]),
kNonGeneratedFilterName: (
(),
(
(
filefilter.kFileNameSpec, '*.o'),
(
filefilter.kFileNameSpec, '*.obj'),
(
filefilter.kFileNameSpec, '*.a'),
(
filefilter.kFileNameSpec, '*.lib'),
(
filefilter.kFileNameSpec, '*.so'),
(
filefilter.kFileNameSpec, '*.dll'),
(
filefilter.kFileNameSpec, '*.exe'),
(
filefilter.kFileNameSpec, '*.ilk'),
(
filefilter.kFileNameSpec, '*.pdb'),
(
filefilter.kFileNameSpec, '*.pyc'),
(
filefilter.kFileNameSpec, '*.pyo'),
(
filefilter.kFileNameSpec, '*.pyd'),
(
filefilter.kFileNameSpec, '*$py.class'),
(
filefilter.kFileNameSpec, '/core'),
(
filefilter.kFileNameSpec, '*.bak'),
(
filefilter.kFileNameSpec, '*.tmp'),
(
filefilter.kFileNameSpec, '*.temp'),
(
filefilter.kFileNameSpec, '*-old'),
(
filefilter.kFileNameSpec, '*.old'),
(
filefilter.kFileNameSpec, '*.wpr'),
(
filefilter.kFileNameSpec, '*.wpu'),
(
filefilter.kFileNameSpec, '*.zip'),
(
filefilter.kFileNameSpec, '*.tgz'),
(
filefilter.kFileNameSpec, '*.tar.gz'),
(
filefilter.kFileNameSpec, '*.dsp'),
(
filefilter.kFileNameSpec, '*.dsw'),
(
filefilter.kFileNameSpec, '*.sln'),
(
filefilter.kFileNameSpec, '*.suo'),
(
filefilter.kFileNameSpec, '*.vcproj'),
(
filefilter.kFileNameSpec, '*.user'),
(
filefilter.kFileNameSpec, '*.manifest'),
(
filefilter.kFileNameSpec, '*.ncb'),
(
filefilter.kFileNameSpec, '*.bsc'),
(
filefilter.kFileNameSpec, '*.sbr'),
(
filefilter.kFileNameSpec, '*.log')) + _kBaseExcludes),
kHiddenAndTempFilterName: (
(
(
filefilter.kFileNameSpec, '*.o'),
(
filefilter.kFileNameSpec, '*.obj'),
(
filefilter.kFileNameSpec, '*.a'),
(
filefilter.kFileNameSpec, '*.lib'),
(
filefilter.kFileNameSpec, '*.so'),
(
filefilter.kFileNameSpec, '*.dll'),
(
filefilter.kFileNameSpec, '*.exe'),
(
filefilter.kFileNameSpec, '*.ilk'),
(
filefilter.kFileNameSpec, '*.pdb'),
(
filefilter.kFileNameSpec, '*.pyc'),
(
filefilter.kFileNameSpec, '*.pyo'),
(
filefilter.kFileNameSpec, '*.pyd'),
(
filefilter.kFileNameSpec, '*$py.class'),
(
filefilter.kFileNameSpec, '/core'),
(
filefilter.kFileNameSpec, '*.bak'),
(
filefilter.kFileNameSpec, '*.tmp'),
(
filefilter.kFileNameSpec, '*.temp'),
(
filefilter.kFileNameSpec, '*-old'),
(
filefilter.kFileNameSpec, '*.old'),
(
filefilter.kFileNameSpec, '*.wpr'),
(
filefilter.kFileNameSpec, '*.wpu'),
(
filefilter.kFileNameSpec, '*.zip'),
(
filefilter.kFileNameSpec, '*.tgz'),
(
filefilter.kFileNameSpec, '*.tar.gz'),
(
filefilter.kFileNameSpec, '*.ncb'),
(
filefilter.kFileNameSpec, '*.bsc'),
(
filefilter.kFileNameSpec, '*.sbr')) + _kBaseExcludes,
())}
_kFilterPopupItems = [ (value, key) for key, value in filefilter.kFileFilterSpecTypes.items() ]
_kSpecItemGui1 = CEntryGroupGui(0, (_('Type'), _('Spec')), (CPopupChoiceGui(_kFilterPopupItems), CSmallTextGui()))
_kSpecItemGui2 = CEntryGroupGui(0, (_('Type'), _('Spec')), (CPopupChoiceGui(_kFilterPopupItems), CSmallTextGui()))
_kSpecGui1 = CSequenceGui(_kSpecItemGui1)
_kSpecGui2 = CSequenceGui(_kSpecItemGui2)
_kFilterGui = CEntryGroupGui(0, (_('Include'), _('Exclude')), (_kSpecGui1, _kSpecGui2))
_filters_doc = _('Defines file filters to apply to file names for inclusion and exclusion from a larger set (such as scanned disk files or all project files).\n\nEach filter is named and contains one list of inclusion patterns and one list of exclusion patterns.The patterns can be a wildcard on the file name, wildcard on a directory name, or a mime type name.\n\n Only a single pattern needs to be matched for inclusion or exclusion.Exclusion patterns take precedence over inclusion patterns, so any match on an exclusion pattern will always exclude a file from the selected set.Filters are used in constraining search, adding project files, and for other operations on collections of files.')
_filters_prefname = 'file-filters'
_filters_type = CFileFiltersType()
_defaults = CFileFilters()
for name, (inc, exc) in _kDefaultFilters.items():
_defaults = (
set(inc), set(exc))
_kDefaultFilters = _defaults
def _translate_filters(inout, values, key, value):
if inout == 'in':
xkey, xvalue = _FilterNameToTranslatedName(key), value
if xkey == key and xkey in _kTranslatedNameToFilterName and _kTranslatedNameToFilterName != xkey:
raise KeyError
else:
return (
xkey, xvalue)
else:
return (
_TranslatedNameToFilterName(key), value)
kFileFilters = CTextIOValueDef('main', _filters_prefname, _filters_doc, _kDefaultFilters, _filters_type, CDictGui((_('Name'), _('Specification')), CSmallTextGui(), _kFilterGui, dict_class=datatype.CFileFilters, translate_cb=_translate_filters))
kBreakOnCritical = CTextIOValueDef('main', 'debug-break-on-critical', _('If True and a gtk, gdk, or glib critical message is logged, Wing tries to start a C debugger and break at the current execution point'), False, CBoolean(), CBooleanGui())
kShowSplashScreen = CTextIOValueDef('main', 'show-splash-screen', _('Controls whether or not the splash screen is shown at startup.'), 1, CBoolean(), CBooleanGui())
_kInstanceReusePolicy = [
(
_('Reuse Existing Instance to Open Files'), None),
(
_('Always Reuse Existing Instance'), 'reuse'),
(
_('Always Launch New Instance'), 'new')]
kInstanceReusePolicy = CTextIOValueDef('main', 'instance-reuse-policy', _('Controls whether Wing tries to reuse an existing running instance of the IDE when it is launched again.'), None, CValue(*[ i for i in _kInstanceReusePolicy ]), CPopupChoiceGui(_kInstanceReusePolicy))
if config.kAvailRemoteSupport:
kAutoCheckRemoteAgentVersion = CTextIOValueDef('main', 'autocheck-remote-agent-version', _("When enabled, Wing will show a dialog offerring to update any remote agent that does not match Wing's version."), True, CBoolean(), CBooleanGui())
if sys.platform != 'win32':
_ssh_default_label = 'ssh'
else:
_ssh_default_label = 'plink.exe or ssh.exe'
kSSHExecutable = CTextIOValueDef('main', 'ssh-executable', _('The executable to use in order to run the SSH client on the host where Wing is running.This is used to establish secure SSH tunnels to remote hosts. You must configure SSH and a key server outside of Wing, since Wing assumes it can connect to remote hosts without entering a password.'), None, CNoneOr(CType('')), CDefaultsOrSpecifyGui(False, ((_('Find %s on PATH') % _ssh_default_label, None),), _('Use executable:'), CSmallTextGui()))
kSSHRemotePort = CTextIOValueDef('main', 'ssh-remote-port', _("The TCP/IP port number to use for the remote end of the SSH tunnel to Wing's remote agent.Using a random port should work in most cases and avoids collisions if there are multiple active sessions, but a fixed port is needed if the random port generated IDE-side is not also available on the remote host."), None, CNoneOr(CType(1)), CDefaultsOrSpecifyGui(False, ((_('Use Random Port'), None),), _('Use specified port:'), CNumberGui(1024, 65535, 1, 0, 50010)))
kSSHTimeout = CTextIOValueDef('main', 'ssh-timeout', _('The maximum time in seconds to wait for SSH tunnels to be established.'), 10, CType(1), CNumberGui(3, 60, 1, 0, 5))
kHungConnectionTimeout = CTextIOValueDef('main', 'hung-connection-threshold', _('The maximum time in seconds to wait if a connection to a remote host is not responding.Afterwards the connection is closed and retried.'), 15, CType(1), CNumberGui(3, 60, 1, 0, 5))
kShowRemoteConfigWarning = CTextIOValueDef('main', 'show-remote-config-warning', _('Controls whether to show a warning before editing a remote host configuration tha is currently in use.'), True, CBoolean(), CBooleanGui())
kHTTPProxy = CTextIOValueDef('main', 'http-proxy', _('Allows manual configuration of an http proxy to be used for feedback, bug reports, and license activation, all of which result in Wing connecting to wingware.com via http.Leave user name and password blank if not required.'), None, CNoneOr(CFixed(CType(''), CType(1), CType(''), CType(''))), CDefaultsOrSpecifyGui(False, ((_('No proxy server (or auto-detected)'), None),), _('Configure proxy server manually:'), CEntryGroupGui(False, (_('Host name'), _('Port'), _('User name'),
_('Password')), (
CSmallTextGui(), CNumberGui(1, 65535, 1, 0),
CSmallTextGui(), CSmallTextGui()))))
kSecureHTTPToWingware = CTextIOValueDef('main', 'secure-http-to-wingware', _('Whether to use secure https (port 443) when accessing wingware.com for license activation, update checks, and submitting feedback or bug reports.When disabled, http (port 80) is used instead.'), True, CBoolean(), CBooleanGui())
_kAutoRStripChoices = (
(
_('Never'), 'disabled'),
(
_('When saving files'), 'on-save'),
(
_('When saving files in project'), 'on-save-project'))
kAutoRStripOnSave = CTextIOValueDef('main', 'auto-rstrip-on-save', _('Controls whether to automatically strip trailing white space in the editor.May be enabled for any file or only files that are part of the current project.'), 'disabled', CFixed(CValue(*[ i for i in _kAutoRStripChoices ]), CType('')), CPopupChoiceGui(_kAutoRStripChoices))
_kPerspectiveStyles = (
(
_('Tools and Layout'), 'tools-only'),
(
_('Tools, Layout, and Editors'), 'tools-and-editors'),
(
_('All Visual State'), 'all'))
kPerspectiveSharedFile = CTextIOValueDef('main', 'perspective-shared-file', _("Selects the file to use for storing and retrieving shared perspectives. By default (when value is None) the file 'perspectives' in the user settings directory is used."), None, COneOf(CType(None), CType('')), CDefaultsOrSpecifyGui(0, ((_('Default'), None),), _('File:'), CFileSelectorGui(name_type=dialogs.kSaveAsFilename, hostname=None)))
_kPerspectiveAutoSaveOptions = (
(
_('Always'), 'always'),
(
_('Never'), 'never'),
(
_('Prompt'), 'prompt'),
(
_('Configured by Perspective'), 'choose'))
kPerspectiveAutoSave = CTextIOValueDef('main', 'perspective-auto-save', _('Selects whether to auto-save perspectives when switching to another perspective. Can always auto-save, never auto-save, prompt each time a perspective is left, or auto-save as configured on a per-perspective basis.'), 'always', CFixed(CValue(*[ i for i in _kPerspectiveAutoSaveOptions ]), CType('')), CPopupChoiceGui(_kPerspectiveAutoSaveOptions))
kFileSetSharedFile = CTextIOValueDef('main', 'fileset-shared-file', _("Selects the file to use for storing and retrieving shared named files sets. By default (when value is None) the file 'filesets' in the user settings directory is used."), None, COneOf(CType(None), CType('')), CDefaultsOrSpecifyGui(0, ((_('Default'), None),), _('File:'), CFileSelectorGui(name_type=dialogs.kSaveAsFilename, hostname=None)))
kPluginOverrides = CTextIOValueDef('main', 'plugin-overrides', _('Defines which plugins are enabled or disabled.'), {}, CDict(CType(''), CBoolean()), None)
kHelpFontZoom = CTextIOValueDef('main', 'help-font-zoom', _('The amount by which to zoom font sizes in or out in the documentation viewer.'), 1.0, CType(1.0), CNumberGui(0.7, 5.0, 0.1, 1, default=1.0))
kSourceAssistantUsePEP287 = CTextIOValueDef('main', 'sassist-tries-pep287', _('Whether to try parsing docstrings as ReST format for display in the Source Assistant.This may destroy formatting of some docstrings.'), True, CBoolean(), CBooleanGui())
_kPEP287ErrorLevels = [
(
_('Debug'), 0),
(
_('Informational'), 1),
(
_('Warning'), 2),
(
_('Error'), 3),
(
_('Severe'), 4)]
kSourceAssistantPEP287ErrorThreshold = CTextIOValueDef('main', 'sassist-pep287-error-level', _('The error level at or above which the source assistant will display parse errors in PEP287 docstrings (if showing PEP287 errors) or will fall back to showing plain text (if not showing PEP287 errors).For errors below this threshold, a best attempt is made to achieve a reasonable rendering.'), 2, CValue(0, 1, 2, 3, 4), CPopupChoiceGui(_kPEP287ErrorLevels))
kSourceAssistantAllowPEP287Errors = CTextIOValueDef('main', 'sassist-allow-pep287-errors', _('Whether to render docstrings even if they contain parse errors at or above the threshold set by Source Assistant PEP 287 Error Threshold.When disabled, failing docstrings are shown as plain text instead.When enabled, a best effort is made to display the formatted docstring while suppressing errors.'), False, CBoolean(), CBooleanGui())
kSourceAssistantRewrapsDocstrings = CTextIOValueDef('main', 'sassist-tries-rewrap', _('Whether to rewrap plain text docstrings for display in the Source Assistant.This may destroy formatting of some docstrings.'), True, CBoolean(), CBooleanGui())
kSourceAssistantAlwaysShowDocstrings = CTextIOValueDef('main', 'sassist-always-show-docstrings', _('Whether to always show docstrings in the Source Assistant.When disabled, only the docstring for the last displayed symbol is shown.'), False, CBoolean(), CBooleanGui())
kSourceAssistantShowValidity = CTextIOValueDef('main', 'sassist-show-validity', _('Whether show docstring type and validity in the Source Assistant.'), True, CBoolean(), CBooleanGui())
kShowOffers = CTextIOValueDef('main', 'show-offers', _('Controls whether Wing will periodically show discount offers.'), 1, CBoolean(), CBooleanGui())
kUpdateHistory = CTextIOValueDef('main', 'update-history', _('History of updates used diagnostically'), [], CType([]), None)
kLastPrefsPage = CTextIOValueDef('main', 'last-prefs-page', _('Used internally to select the most recently used prefs page.'), (-1,
-1), CFixed(CType(1), CType(1)), CHiddenGui())
kLastPropertiesPages = CTextIOValueDef('main', 'last-properties-pages', _('Used internally to select the most recently used properties dialog pages.'), {}, CDict(CType(''), CType(1)), CHiddenGui())
kPresentationMode = CTextIOValueDef('main', 'presentation-mode', _('Controls whether Wing runs in presentation mode, which magnifies the user interface.Wing must be restarted before this value takes effect.'), False, CBoolean(), CBooleanGui())
kPresentationScaleFactor = CTextIOValueDef('main', 'presentation-scale-factor', _('The amount by which to increase UI size when presentation mode is enabled.Wing must be restarted before this value takes effect.'), 2.0, CType(1.0), CNumberGui(1.1, 8.0, 0.1, 1, default=2.0))
kNonFontScaleFactor = CTextIOValueDef('main', 'non-font-scale-factor', _('Scale factor for icons, windows, and other graphical elements other than fonts.Can either be a single number or a ; (semicolon) separated list of per-screen scale factors in the format used by the QT_SCREEN_SCALE_FACTORS environment variable.This has no effect if the QT_SCREEN_SCALE_FACTORS environment variable is set before Wing is started Wing must be restarted before this value takes effect.'), '', CType(''), CSmallTextGui())
kSetAutoScreenScaleFactor = CTextIOValueDef('', config.Prefs.kSetAutoScreenScaleFactor, _('Automatically set scale factor based on screen dpi.'), config.Prefs.kSetAutoScreenScaleFactorDefault, CBoolean(), CBooleanGui())
kSuggestNonFontScaleFactor = CTextIOValueDef('main', 'suggest-non-font-scale-factor', _('Whether to suggest per-screen scale factors at startup, based on inspection of font size on each attached display.'), True, CBoolean(), CBooleanGui())
kLastDarkMode = CTextIOValueDef('main', 'last-dark-mode', _('Used internally to remember the most recently used dark mode'), (
'one-dark', True), CFixed(CType(''), CBoolean()), CHiddenGui())
kLastLightMode = CTextIOValueDef('main', 'last-light-mode', _('Used internally to select the most recently used light mode.'), (
'wing-classic', False), CFixed(CType(''), CBoolean()), CHiddenGui())
页:
[1]