MCPcopy Index your code
hub / github.com/python/cpython / SectionName

Class SectionName

Lib/idlelib/query.py:163–184  ·  view source on GitHub ↗

Get a name for a config file section name.

Source from the content-addressed store, hash-verified

161
162
163class SectionName(Query):
164 "Get a name for a config file section name."
165 # Used in ConfigDialog.GetNewKeysName, .GetNewThemeName (837)
166
167 def __init__(self, parent, title, message, used_names,
168 *, _htest=False, _utest=False):
169 super().__init__(parent, title, message, used_names=used_names,
170 _htest=_htest, _utest=_utest)
171
172 def entry_ok(self):
173 "Return sensible ConfigParser section name or None."
174 name = self.entry.get().strip()
175 if not name:
176 self.showerror('no name specified.')
177 return None
178 elif len(name)>30:
179 self.showerror('name is longer than 30 characters.')
180 return None
181 elif name in self.used_names:
182 self.showerror('name is already in use.')
183 return None
184 return name
185
186
187class ModuleName(Query):

Callers 2

get_new_theme_nameMethod · 0.90
get_new_keys_nameMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…