rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
cssWidgetType += 'Type' | cssWidgetType += u'Type' | def renderTag(tag, **kw): """Render the tag. Well, not all of it, as we may want to / it.""" attr_list = [] # special case handling for cssClass cssClass = '' if 'cssClass' in kw: if kw['cssClass']: cssClass = kw['cssClass'] del kw['cssClass'] # If the 'type' attribute is given, append this plus 'Type' as a # css cla... |
cssWidgetType = '' | cssWidgetType = u'' | def renderTag(tag, **kw): """Render the tag. Well, not all of it, as we may want to / it.""" attr_list = [] # special case handling for cssClass cssClass = '' if 'cssClass' in kw: if kw['cssClass']: cssClass = kw['cssClass'] del kw['cssClass'] # If the 'type' attribute is given, append this plus 'Type' as a # css cla... |
attr_list.append('class="%s"' % ' '.join(names)) | attr_list.append(u'class="%s"' % ' '.join(names)) | def renderTag(tag, **kw): """Render the tag. Well, not all of it, as we may want to / it.""" attr_list = [] # special case handling for cssClass cssClass = '' if 'cssClass' in kw: if kw['cssClass']: cssClass = kw['cssClass'] del kw['cssClass'] # If the 'type' attribute is given, append this plus 'Type' as a # css cla... |
if kw['style'] != '': attr_list.append('style=%s' % quoteattr(kw['style'])) | if kw['style'] != u'': attr_list.append(u'style=%s' % quoteattr(kw['style'])) | def renderTag(tag, **kw): """Render the tag. Well, not all of it, as we may want to / it.""" attr_list = [] # special case handling for cssClass cssClass = '' if 'cssClass' in kw: if kw['cssClass']: cssClass = kw['cssClass'] del kw['cssClass'] # If the 'type' attribute is given, append this plus 'Type' as a # css cla... |
extra = " " + kw['extra'] | extra = u" " + kw['extra'] | def renderTag(tag, **kw): """Render the tag. Well, not all of it, as we may want to / it.""" attr_list = [] # special case handling for cssClass cssClass = '' if 'cssClass' in kw: if kw['cssClass']: cssClass = kw['cssClass'] del kw['cssClass'] # If the 'type' attribute is given, append this plus 'Type' as a # css cla... |
attr_list.append('%s=%s' % (key, quoteattr(unicode(value)))) | attr_list.append(u'%s=%s' % (key, quoteattr(unicode(value)))) | def renderTag(tag, **kw): """Render the tag. Well, not all of it, as we may want to / it.""" attr_list = [] # special case handling for cssClass cssClass = '' if 'cssClass' in kw: if kw['cssClass']: cssClass = kw['cssClass'] del kw['cssClass'] # If the 'type' attribute is given, append this plus 'Type' as a # css cla... |
attr_str = " ".join(attr_list) return "<%s %s%s" % (tag, attr_str, extra) | attr_str = u" ".join(attr_list) return u"<%s %s%s" % (tag, attr_str, extra) | def renderTag(tag, **kw): """Render the tag. Well, not all of it, as we may want to / it.""" attr_list = [] # special case handling for cssClass cssClass = '' if 'cssClass' in kw: if kw['cssClass']: cssClass = kw['cssClass'] del kw['cssClass'] # If the 'type' attribute is given, append this plus 'Type' as a # css cla... |
return "<%s%s" % (tag, extra) | return u"<%s%s" % (tag, extra) | def renderTag(tag, **kw): """Render the tag. Well, not all of it, as we may want to / it.""" attr_list = [] # special case handling for cssClass cssClass = '' if 'cssClass' in kw: if kw['cssClass']: cssClass = kw['cssClass'] del kw['cssClass'] # If the 'type' attribute is given, append this plus 'Type' as a # css cla... |
return "%s>%s</%s>" % (renderTag(tag, **kw), contents, tag) | return u"%s>%s</%s>" % (renderTag(tag, **kw), contents, tag) | def renderElement(tag, **kw): if 'contents' in kw: contents = kw['contents'] del kw['contents'] return "%s>%s</%s>" % (renderTag(tag, **kw), contents, tag) else: return renderTag(tag, **kw) + " />" |
texttexttexttexttexttextexttexttexttexttext texttexttexttexttexttexttexttexttexttexttexttexttextte | texttexttexttexttexttextexttexttext\xE9\xE9\xE9\xE9\xE9\xE9\xE9\xE9\xE9 texttexttexttexttextte\xE9\xE9\xE9\xE9\xE9xttexttexttexttexttexttexttex | def testRender(self): value = u""" texttexttexttexttexttextexttexttexttexttext texttexttexttexttexttexttexttexttexttexttexttexttextte texttexttexttexttexttexttexttexttexttexttexttexttexttexttext """ self._widget.setRenderedValue(value) self.assert_(value, self._widget._toFieldValue(value)) self.verifyResult(self._widge... |
"""Validate the widget data. If there is no user input and the field is required, then a | """Returns a valid value from the widget. This method returns the data of the field in the native Python format. The value is also validated against the field's constraints. If the field is required and no input was found, a | def validate(): """Validate the widget data. |
If there is no user input and the field is not required, then the field default value will be returned. A ``WidgetInputError`` is returned in the case of one or more errors encountered, inputting, converting, or validating the data. | If the field is not required and no input was found, then return the ``missing_value`` of the field. If validation errors occurred, then they are all collected in a new ``WidgetInputError`` exception, which is raised. | def validate(): """Validate the widget data. |
See validate() for validation performed. | def getInputValue(): """Return value suitable for the widget's field. | |
"""View support for querying non-iterable vocabularies | """View support for querying non-iterable sources | def getValue(token): """Return a value for a given identifier token LookupError is raised if there isn't a value in the source. """ |
if force or not widget.hasInput(): | if force or not widget.hasInput() and value is not None: | def setUpWidget(view, name, field, value=None, prefix=None, force=False, vname=None, context=None): """Set up a single view widget The widget will be an attribute of the view. If there is already an attribute of the given name, it must be a widget and it will be initialized with the given value if not None. If there ... |
raise WidgetsError(*errors) | raise WidgetsError(errors) | def applyWidgetsChanges(view, schema, target=None, names=None): """Updates an object with values from a view's widgets. view contained the widgets that perform the update. By default, the widgets will update the view's context. target can be specified as an alternative object to update. schema contrains the values pr... |
queriables = ISourceQueriables(source, None) | def queryviews(self): queriables = ISourceQueriables(self.source, None) | def __init__(self, field, source, request): super(SourceInputWidget, self).__init__(field, request) self.source = source self.terms = zapi.getMultiAdapter( (source, self.request), zope.app.form.browser.interfaces.ITerms, ) |
queriables = ((self.name, source), ) else: base = self.name+'.' | queriables = ((self.name + '.query', self.source), ) else: | def __init__(self, field, source, request): super(SourceInputWidget, self).__init__(field, request) self.source = source self.terms = zapi.getMultiAdapter( (source, self.request), zope.app.form.browser.interfaces.ITerms, ) |
(base + | (self.name + '.' + | def __init__(self, field, source, request): super(SourceInputWidget, self).__init__(field, request) self.source = source self.terms = zapi.getMultiAdapter( (source, self.request), zope.app.form.browser.interfaces.ITerms, ) |
self.queryviews = [ (i, zapi.getMultiAdapter( (s, self.request), | return [ (name, zapi.getMultiAdapter( (source, self.request), | def __init__(self, field, source, request): super(SourceInputWidget, self).__init__(field, request) self.source = source self.terms = zapi.getMultiAdapter( (source, self.request), zope.app.form.browser.interfaces.ITerms, ) |
) for (i, s) in queriables] | ) for (name, source) in queriables] queryviews = property(queryviews) | def __init__(self, field, source, request): super(SourceInputWidget, self).__init__(field, request) self.source = source self.terms = zapi.getMultiAdapter( (source, self.request), zope.app.form.browser.interfaces.ITerms, ) |
result.append(queryview.render(name+'.query')) | result.append(queryview.render(name)) | def __call__(self): result = ['<div class="value">'] value = self._value() field = self.context |
qresults = queryview.results(name+'.query') | qresults = queryview.results(name) | def __call__(self): result = ['<div class="value">'] value = self._value() field = self.context |
raise ConversionError("Invalid integer data", v) | raise ConversionError("Invalid unicode data", v) | def _toFieldValue(self, value): value = super(TextAreaWidget, self)._toFieldValue(value) if value: value = decode_html(value) value = value.replace("\r\n", "\n") # Converting the value to unicode. try: value = unicode(value) except ValueError, v: raise ConversionError("Invalid integer data", v) |
token = self.request.get(self.name) | for name, queryview in self.queryviews: if name+'.apply' in self.request: token = self.request.form.get(name+'.selection') if token is not None: break else: token = self.request.get(self.name) | def getInputValue(self): token = self.request.get(self.name) field = self.context |
raise zope.app.form.interfacesMissingInputError( | raise zope.app.form.interfaces.MissingInputError( | def getInputValue(self): token = self.request.get(self.name) field = self.context |
return self.name+'.displayed' in self.request.form | if self.name in self.request: return True if (not self.context.required and self.name+'.displayed' in self.request): return True for name, queryview in self.queryviews: if name+'.apply' in self.request: token = self.request.form.get(name+'.selection') if token is not None: return True return False | def hasInput(self): return self.name+'.displayed' in self.request.form |
def _value(self): if self._renderedValueSet(): value = self._data else: tokens = self.request.form.get(self.name) for name, queryview in self.queryviews: if name+'.apply' in self.request: newtokens = self.request.form.get(name+'.selection') if newtokens: if tokens: tokens = tokens + newtokens else: tokens = newtokens ... | def _input_value(self): tokens = self.request.form.get(self.name) for name, queryview in self.queryviews: if name+'.apply' in self.request: newtokens = self.request.form.get(name+'.selection') if newtokens: if tokens: tokens = tokens + newtokens else: tokens = newtokens if tokens: remove = self.request.form.get(self.n... | def _value(self): if self._renderedValueSet(): value = self._data else: tokens = self.request.form.get(self.name) for name, queryview in self.queryviews: if name+'.apply' in self.request: newtokens = self.request.form.get(name+'.selection') if newtokens: if tokens: tokens = tokens + newtokens else: tokens = newtokens ... |
for token in tokens: try: v = self.terms.getValue(str(token)) except LookupError: pass else: value.append(v) | def _value(self): if self._renderedValueSet(): value = self._data else: tokens = self.request.form.get(self.name) for name, queryview in self.queryviews: if name+'.apply' in self.request: newtokens = self.request.form.get(name+'.selection') if newtokens: if tokens: tokens = tokens + newtokens else: tokens = newtokens ... | |
tokens = self.request.get(self.name) field = self.context if not tokens: if field.required: raise zope.app.form.interfacesMissingInputError( field.__name__, self.label, ) return field.missing_value value = [] for token in tokens: try: v = self.terms.getValue(str(token)) except LookupError: err = zope.schema.interface... | value = self._input_value() | def getInputValue(self): tokens = self.request.get(self.name) field = self.context |
field.validate(value) | self.context.validate(value) | def getInputValue(self): tokens = self.request.get(self.name) field = self.context |
value=self.vocabulary.getTerm( self._getFormValue()).token, | value=form_value, | def hidden(self): return renderElement(u'input', type='hidden', name=self.name, id=self.name, value=self.vocabulary.getTerm( self._getFormValue()).token, cssClass=self.cssClass, extra=self.extra) |
unittest.main(default='test_suite') | unittest.main(defaultTest='test_suite') | def test_suite(): return unittest.TestSuite(( doctest.DocFileSuite('../form.txt', setUp=setUp, tearDown=placelesssetup.tearDown, globs={'pprint': doctestunit.pprint}, optionflags=doctest.NORMALIZE_WHITESPACE), )) |
self.assertEqual(view.description_widget(), u'description: ') | self.assertEqual(view.description_widget(), u'description: No description') | def test_setupWidgets(self): c = C() request = TestRequest() view = BrowserView(c, request) setUpWidgets(view, I) self.assertEqual(view.title_widget(), u'title: ') self.assertEqual(view.description_widget(), u'description: ') |
self.assertEqual(view.description_widget(), u'description: ') | self.assertEqual(view.description_widget(), u'description: No description') | def test_setupEditWidgets_w_other_data(self): c = C() c2 = C() c2.title = u'ct' c2.description = u'cd' request = TestRequest() view = BrowserView(c, request) setUpEditWidgets(view, I) self.assertEqual(view.title_widget(), u'title: ') self.assertEqual(view.description_widget(), u'description: ') setUpEditWidgets(view, I... |
for key, data in obj.__annotations__.items(): if key.startswith('schoolbell'): obj.__annotations__['schooltool'+key[10:]] = data | items = list(obj.__annotations__.items()) for key, data in items: old_key = 'schoolbell' if key.startswith(old_key): obj.__annotations__['schooltool'+key[len(old_key):]] = data | def fixAnnotations(obj): if not hasattr(obj, '__annotations__'): return for key, data in obj.__annotations__.items(): if key.startswith('schoolbell'): obj.__annotations__['schooltool'+key[10:]] = data del obj.__annotations__[key] |
app['persons']['manager'] = manager manager = app['persons']['manager'] | app['persons'][MANAGER_USERNAME] = manager manager = app['persons'][MANAGER_USERNAME] | def restoreManagerUser(self, app): """Ensure there is a manager user |
roles.assignRoleToPrincipal('zope.Manager', 'sb.person.manager') | roles.assignRoleToPrincipal( 'zope.Manager', 'sb.person.' + MANAGER_USERNAME) | def restoreManagerUser(self, app): """Ensure there is a manager user |
"""Returns True if the date is within the range, otherwise False. | """Return True if the date is within the range, otherwise False. | def __contains__(date): """Returns True if the date is within the range, otherwise False. |
"""Returns whether the date is a schoolday. | """Return whether the date is a schoolday. | def isSchoolday(date): """Returns whether the date is a schoolday. |
"""Marks the day as a schoolday. | """Mark the day as a schoolday. | def add(day): """Marks the day as a schoolday. |
"""Marks the day as a holiday. | """Mark the day as a holiday. | def remove(day): """Marks the day as a holiday. |
raise KeyError, key | else: raise KeyError(key) | def __getitem__(self, key): """See interface `IReadContainer`""" try: return self._data[key] except KeyError: for base in self.bases: if key in base: return InheritedRequirement(base[key], self, key) raise KeyError, key |
pass return default | return default | def get(self, key, default=None): """See interface `IReadContainer`""" try: return self[key] except KeyError: pass return default |
return key in self.keys() | return key in self._data | def __contains__(self, key): """See interface `IReadContainer`""" return key in self.keys() |
wxMessageBox(_("Could not submit the roll call: %s") % e, | wxMessageBox(_("Could not update the timetable: %s") % e, | def OnOk(self, event=None): """Save the edited timetable to the server.""" try: period, schema = self.key self.client.putSchooltoolTimetable(period, schema, self.tt) except SchoolToolError, e: wxMessageBox(_("Could not submit the roll call: %s") % e, self.title, wxICON_ERROR|wxOK) else: self.Close(True) |
title=u"Primary Email Address", required=False, description=u"Email address.") | title=u"Primary Email", required=False) | def setPassword(password): """Set the password in a hashed form, so it can be verified later. |
title=u"Secondary Email Address", required=False, description=u"Email address.") | title=u"Secondary Email", required=False) | def setPassword(password): """Set the password in a hashed form, so it can be verified later. |
title=u"Primary phone number", required=False, description=u"Phone number.") | title=u"Primary phone", required=False, description=u"Recommended telephone number.") | def setPassword(password): """Set the password in a hashed form, so it can be verified later. |
title=u"Secondary phone number", required=False, description=u"Phone number.") secondary_phone = TextLine( title=u"Secondary phone number", required=False, description=u"Phone number.") | title=u"Secondary phone", required=False, description=u"Secondary telephone number.") home_page = TextLine( title=u"Website", required=False, description=u"Website or weblog.") | def setPassword(password): """Set the password in a hashed form, so it can be verified later. |
required=False, description=u"Mailing address.") home_page = TextLine( title=u"Website", required=False, description=u"Website or weblog.") | required=False) | def setPassword(password): """Set the password in a hashed form, so it can be verified later. |
AddView and EditView api does not match so some wraping is needed. | AddView and EditView API does not match so some wrapping is needed. | def keyword_arguments(self): """Wraps fieldNames under another name. |
"""Event wraper for display in booking view. | """Event wrapper for display in booking view. | def bookingURL(self, date=None): """Returns link to the booking view of the newly created event. |
format = self.preferences.dateformat +' - '+ self.preferences.timeformat | format = '%s - %s' % (self.preferences.dateformat, self.preferences.timeformat) | def __init__(self, context, request): CalendarEventView.__init__(self, context, request) |
for obj in itertools.chain(writer, self._added_during_commit): | def chain(writer, _added_during_commit): """Iterate over all objects in writer and _added_during_commit XXX This is used here instead of itertools.chain because the latter causes failures in SchoolTool functional tests. A proper fix would entail figuring why the problem occurs and writing a unit test for it. """ done ... | def _store_objects(self, writer, transaction): self._added_during_commit = [] for obj in itertools.chain(writer, self._added_during_commit): oid = obj._p_oid serial = getattr(obj, "_p_serial", z64) |
help="do not test the po file by checking if compilation" | help="do not test the PO file by checking if compilation" | def parseOptions(): """Parse the arguments. Save the old args. >>> import sys >>> old_args = sys.argv Defaults: >>> sys.argv = ['myprog'] >>> (options, locales) = parseOptions() >>> options.test False >>> options.baseurl is None True >>> options.filepattern is None True >>> options.loglevel 'INFO' >>> options.testcom... |
help="do not test the po file by checking if the new no" " of lines are less than 20% of the old") | help="do not test the PO file by checking if the new no" " of lines are less than 50% of the old") | def parseOptions(): """Parse the arguments. Save the old args. >>> import sys >>> old_args = sys.argv Defaults: >>> sys.argv = ['myprog'] >>> (options, locales) = parseOptions() >>> options.test False >>> options.baseurl is None True >>> options.filepattern is None True >>> options.loglevel 'INFO' >>> options.testcom... |
" extended by @locale@/po to get the po file.") | " extended by @locale@/po to get the PO file.") | def parseOptions(): """Parse the arguments. Save the old args. >>> import sys >>> old_args = sys.argv Defaults: >>> sys.argv = ['myprog'] >>> (options, locales) = parseOptions() >>> options.test False >>> options.baseurl is None True >>> options.filepattern is None True >>> options.loglevel 'INFO' >>> options.testcom... |
group_id = self.groupTreeCtrl.GetPyData(item) | group_href = self.groupTreeCtrl.GetPyData(item)[0] | def DoSelectGroup(self, event): """Update member and relationship lists for the selected group. |
info = self.client.getGroupInfo(group_id) | info = self.client.getGroupInfo(group_href) | def DoSelectGroup(self, event): """Update member and relationship lists for the selected group. |
group_id) | group_href) | def compare(x, y): return cmp(self.personListData[x], self.personListData[y]) |
old_selection_full_id = None root = self.groupTreeCtrl.GetRootItem() | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) | |
old_selection = self.groupTreeCtrl.GetPyData(item) old_selection_full_id = [] while item != root: id = self.groupTreeCtrl.GetPyData(item) old_selection_full_id.append(id) item = self.groupTreeCtrl.GetItemParent(item) old_selection_full_id.reverse() old_selection_full_id = tuple(old_selection_full_id) | old_selection = self.groupTreeCtrl.GetPyData(item)[1] | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) |
stack = [] | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) | |
expanded.add(self.groupTreeCtrl.GetPyData(item)) | expanded.add(self.groupTreeCtrl.GetPyData(item)[1]) | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) |
if next.IsOk(): | while next.IsOk(): | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) |
next = self.groupTreeCtrl.GetNextSibling(item) if next.IsOk(): stack.append(next) | next, cookie = self.groupTreeCtrl.GetNextChild(item, cookie) | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) |
stack = [(root, None)] selected_item = None | self.groupTreeCtrl.SetPyData(root, (None, None)) stack = [(root, None)] item_to_select = None | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) |
self.groupTreeCtrl.SetPyData(item, href) if selected_item is None and href == old_selection: full_id = [h for i, h in stack[1:]] full_id = tuple(full_id + [href]) if old_selection_full_id == full_id: selected_item = item stack.append((item, href)) | id = tuple([parent[1] for parent in stack[1:]] + [href]) self.groupTreeCtrl.SetPyData(item, (href, id)) if id == old_selection: item_to_select = item stack.append((item, id)) | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) |
if selected_item is None: | if item_to_select is None: | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) |
self.groupTreeCtrl.SelectItem(selected_item) self.groupTreeCtrl.EnsureVisible(selected_item) | self.groupTreeCtrl.SelectItem(item_to_select) self.groupTreeCtrl.EnsureVisible(item_to_select) | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) |
group_id = self.groupTreeCtrl.GetPyData(item) | group_href = self.groupTreeCtrl.GetPyData(item)[0] | def DoRollCall(self, event=None): """Open the roll call dialog. |
rollcall = self.client.getRollCall(group_id) | rollcall = self.client.getRollCall(group_href) | def DoRollCall(self, event=None): """Open the roll call dialog. |
self.client.submitRollCall(group_id, rollcall) | self.client.submitRollCall(group_href, rollcall) | def DoRollCall(self, event=None): """Open the roll call dialog. |
group_id = self.groupTreeCtrl.GetPyData(item) | group_href = self.groupTreeCtrl.GetPyData(item)[0] | def DoGroupAbsenceTracker(self, event=None): """Open the absences window for the currently selected group. |
kwds["style"] = wxDIALOG_MODAL|wxCAPTION | kwds["style"] = wxDIALOG_MODAL|wxCAPTION|wxSYSTEM_MENU | def __init__(self, *args, **kwds): if len(args) < 1: kwds.setdefault('parent', None) if len(args) < 2: kwds.setdefault('id', -1) if len(args) < 3: kwds.setdefault('title', 'Server Settings') |
style=wxDIALOG_MODAL|wxCAPTION) | style=wxDIALOG_MODAL|wxCAPTION|wxSYSTEM_MENU) | def __init__(self, parent, title, show_resolved): wxDialog.__init__(self, parent, -1, title, style=wxDIALOG_MODAL|wxCAPTION) self.show_resolved = show_resolved |
style=wxDIALOG_MODAL|wxCAPTION|wxRESIZE_BORDER|wxTHICK_FRAME) | style=wxDIALOG_MODAL|wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER| wxTHICK_FRAME) | def __init__(self, parent, group_title, group_path, rollcall, client): title = "Roll Call for %s" % group_title wxDialog.__init__(self, parent, -1, title, style=wxDIALOG_MODAL|wxCAPTION|wxRESIZE_BORDER|wxTHICK_FRAME) self.title = title self.group_title = group_title self.group_path = group_path self.client = client |
class AbsenceFrame(wxFrame): | class AbsenceFrame(wxDialog): | def OnOk(self, event): """Verify that all data is entered before closing the dialog.""" rollcall = [] for (entry, present_btn) in self.items: if entry.presence is Unchanged: present_btn.SetFocus() wxBell() return show_resolved = not entry.item.present and entry.presence == True if show_resolved and entry.resolved is Un... |
wxFrame.__init__(self, parent, id, title, size=wxSize(600, 400)) | wxDialog.__init__(self, parent, id, title, size=wxSize(600, 400), style=wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxTHICK_FRAME) | def __init__(self, client, path, title, parent=None, id=-1, detailed=True, persons=True, absence_data=None): """Create an absence list window. |
EVT_RIGHT_UP(self.groupTreeCtrl, self.DoTreePopup) EVT_COMMAND_RIGHT_CLICK(self.groupTreeCtrl, ID_GROUP_TREE, self.DoTreePopup) | setupPopupMenu(self.groupTreeCtrl, self.treePopupMenu) | def submenu(title, *items, **kw): description = kw.get('description', '') id = kw.get('id', None) if not id: id = wxNewId() submenu, title = menu(title, items) return ('AppendMenu', id, title, submenu, description) |
style=wxSUNKEN_BORDER|wxLC_SINGLE_SEL) | style=wxSUNKEN_BORDER|wxLC_LIST|wxLC_SINGLE_SEL) | def submenu(title, *items, **kw): description = kw.get('description', '') id = kw.get('id', None) if not id: id = wxNewId() submenu, title = menu(title, items) return ('AppendMenu', id, title, submenu, description) |
EVT_RIGHT_UP(self.personListCtrl, self.DoPersonPopup) EVT_COMMAND_RIGHT_CLICK(self.personListCtrl, ID_PERSON_LIST, self.DoPersonPopup) | setupPopupMenu(self.personListCtrl, self.personPopupMenu) | def submenu(title, *items, **kw): description = kw.get('description', '') id = kw.get('id', None) if not id: id = wxNewId() submenu, title = menu(title, items) return ('AppendMenu', id, title, submenu, description) |
EVT_RIGHT_UP(self.relationshipListCtrl, self.DoRelationshipPopup) EVT_COMMAND_RIGHT_CLICK(self.relationshipListCtrl, ID_RELATIONSHIP_LIST, self.DoRelationshipPopup) | setupPopupMenu(self.relationshipListCtrl, self.relationshipPopupMenu) | def submenu(title, *items, **kw): description = kw.get('description', '') id = kw.get('id', None) if not id: id = wxNewId() submenu, title = menu(title, items) return ('AppendMenu', id, title, submenu, description) |
def DoTreePopup(self, event): """Show the popup menu for the group tree control. Called when the right mouse buton released on the group tree control. """ self.groupTreeCtrl.PopupMenu(self.treePopupMenu, event.GetPosition()) | def DoTreePopup(self, event): """Show the popup menu for the group tree control. | |
def DoPersonPopup(self, event): """Show the popup menu for the person list control. Called when the right mouse buton released on the person list control. """ self.personListCtrl.PopupMenu(self.personPopupMenu, event.GetPosition()) | def DoPersonPopup(self, event): """Show the popup menu for the person list control. | |
def DoRelationshipPopup(self, event): """Show the popup menu for the relationship list control. Called when the right mouse buton released on the relationship list control. """ self.relationshipListCtrl.PopupMenu(self.relationshipPopupMenu, event.GetPosition()) | def DoRelationshipRightDown(self, event): """Select the relationship under mouse cursor. | |
self.groupTreeCtrl.SetPyData(root, (None, None)) | def _refresh(self): # Get the tree from the server try: group_tree = self.client.getGroupTree() except SchoolToolError, e: self.SetStatusText(str(e)) group_tree = [] else: self.SetStatusText(self.client.status) | |
wxApp.__init__(self) | wxApp.__init__(self, 0) | def __init__(self, client): self.client = client wxApp.__init__(self) |
DocFileCase_classes = (doctest.DocFileCase,) | if hasattr(doctest, 'DocFileCase'): DocFileCase_classes = (doctest.DocFileCase,) else: DocFileCase_classes = () | def import_module(filename, cfg, tracer=None): """Import and return a module.""" filename = os.path.splitext(filename)[0] if filename.startswith(cfg.basedir): filename = filename[len(cfg.basedir):] modname = filename.replace(os.path.sep, '.') if modname.startswith('.'): modname = modname[1:] if tracer is not None: mod ... |
self._open(location) | return self._open(location) | def _open(self, url, data=None): self.url = url opener = URLOpener() for name, value in self._cookies.items(): # Quick and dirty hack opener.addheader('Cookie', '%s=%s' % (name, value)) fp = opener.open(url, data=data) self.content = fp.read() self.headers = fp.info() self.status = fp.status self.message = fp.message f... |
if util is None: return util if util.__parent__ is default: | if util is None or util.__parent__ is default: | def getLocalUtility(default, spec): util = queryUtility(spec.iface, name=spec.utility_name, default=None) if util is None: return util if util.__parent__ is default: return util else: return None |
>>> tables[0].text '2005-07-01, Friday' | >>> print tables[0].text 2005-07-01, Friday | def doctest_WeeklyPDFCalendarView(): r"""Tests for WeeklyPDFCalendarView. >>> from schooltool.app.browser.pdfcal import WeeklyPDFCalendarView >>> calendar = ISchoolToolCalendar(Person()) >>> request = TestRequest(form={'date': '2005-07-01'}) >>> view = WeeklyPDFCalendarView(calendar, request) >>> view.getCalendars = l... |
>>> tables[2].text '2005-07-03, Sunday' | >>> print tables[2].text 2005-07-03, Sunday | def doctest_WeeklyPDFCalendarView(): r"""Tests for WeeklyPDFCalendarView. >>> from schooltool.app.browser.pdfcal import WeeklyPDFCalendarView >>> calendar = ISchoolToolCalendar(Person()) >>> request = TestRequest(form={'date': '2005-07-01'}) >>> view = WeeklyPDFCalendarView(calendar, request) >>> view.getCalendars = l... |
>>> tables[0].text '2005-07-01, Friday' | >>> print tables[0].text 2005-07-01, Friday | def doctest_MonthlyPDFCalendarView(): r"""Tests for MonthlyPDFCalendarView. >>> from schooltool.app.browser.pdfcal import MonthlyPDFCalendarView >>> calendar = ISchoolToolCalendar(Person()) >>> request = TestRequest(form={'date': '2005-07-01'}) >>> view = MonthlyPDFCalendarView(calendar, request) >>> view.getCalendars... |
>>> tables[2].text '2005-07-31, Sunday' | >>> print tables[2].text 2005-07-31, Sunday | def doctest_MonthlyPDFCalendarView(): r"""Tests for MonthlyPDFCalendarView. >>> from schooltool.app.browser.pdfcal import MonthlyPDFCalendarView >>> calendar = ISchoolToolCalendar(Person()) >>> request = TestRequest(form={'date': '2005-07-01'}) >>> view = MonthlyPDFCalendarView(calendar, request) >>> view.getCalendars... |
def setUpLibxml2(self): pass | def setUpLibxml2(self): pass | |
>>> tzinfo = list(walk_ics(path)) | >>> tzinfo = sorted(list(walk_ics(path))) | def doctest_walk_ics(): """Tests for walk_ics. >>> from schooltool.calendar.generate_vcal_dict import walk_ics >>> import schooltool.calendar.tests as tests >>> import os >>> path = os.path.dirname(tests.__file__) >>> tzinfo = list(walk_ics(path)) Timezone 'sample' was not found There are 2 timezone files in the test... |
class IServiceAPI(Interface): """Service API. There are a number of global services stored in the object database. This API lets the code access those services. The context argument passed to each of the functions in this API is an object connected to the containment hierarchy. Looking up a service entails traversi... | def getRelativePath(child): """Return the path of child relative to self. | |
class IApplicationObjectContainer(ILocation, ITraversable): """A collection of application objects.""" def __getitem__(name): """Return the contained object that has the given name.""" def new(__name__=None, **kw): """Create and return a new contained object. If __name__ is None, a name is chosen for the object. Oth... | def keys(): """List the names of application object containers.""" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.