rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
def removeFromContainer(self, childToRemove): | def removeFromContainer(self, parent, child): | def removeFromContainer(self, childToRemove): pass |
self.wxParent = parent self.wxParentWindow = parentWindow | sizer = wxBoxSizer(wxHORIZONTAL) panel = wxPanel(parentWindow, -1) panel.SetSizer(sizer) self.getParentBlock(parentWindow).addToContainer(parent, panel, 1, self.Calculate_wxFlag(), self.Calculate_wxBorder()) | def renderOneBlock (self, parent, parentWindow): self.wxParent = parent self.wxParentWindow = parentWindow newChild = Globals.repository.find (self.contentSpec.data) if newChild: return newChild.render (parent, parentWindow) return None, None, None |
return newChild.render (parent, parentWindow) | newChild.parentBlock = self return panel, sizer, panel | def renderOneBlock (self, parent, parentWindow): self.wxParent = parent self.wxParentWindow = parentWindow newChild = Globals.repository.find (self.contentSpec.data) if newChild: return newChild.render (parent, parentWindow) return None, None, None |
def OnSwitchEmbeddedChildEvent (self, notification): | def OnSelectionChangedEvent (self, notification): return node = notification.data['node'] name = node.treeList.GetItemText(node.nodeId) | def OnSwitchEmbeddedChildEvent (self, notification): oldChild = Globals.repository.find (self.contentSpec.data) wxOldChild = Globals.association[oldChild.getUUID()] self.getParentBlock(self.wxParentWindow).removeFromContainer(self.wxParent, wxOldChild) self.contentSpec.data = notification.event.choice newChild = Globa... |
wxOldChild = Globals.association[oldChild.getUUID()] self.getParentBlock(self.wxParentWindow).removeFromContainer(self.wxParent, wxOldChild) self.contentSpec.data = notification.event.choice | wxOldChild = Globals.association [oldChild.getUUID()] parent = wxOldChild.GetContainingSizer () parentWindow = wxOldChild.GetParent() self.removeFromContainer(parent, wxOldChild) oldChild.parentBlock = None if name == "Demo": self.contentSpec.data = 'parcels/OSAF/views/demo/TabBox' else: self.contentSpec.data = 'parc... | def OnSwitchEmbeddedChildEvent (self, notification): oldChild = Globals.repository.find (self.contentSpec.data) wxOldChild = Globals.association[oldChild.getUUID()] self.getParentBlock(self.wxParentWindow).removeFromContainer(self.wxParent, wxOldChild) self.contentSpec.data = notification.event.choice newChild = Globa... |
newChild.render (self.wxParent, self.wxParentWindow) | newChild.parentBlock = self newChild.render (parent, parentWindow) | def OnSwitchEmbeddedChildEvent (self, notification): oldChild = Globals.repository.find (self.contentSpec.data) wxOldChild = Globals.association[oldChild.getUUID()] self.getParentBlock(self.wxParentWindow).removeFromContainer(self.wxParent, wxOldChild) self.contentSpec.data = notification.event.choice newChild = Globa... |
def removeFromContainer(self, childToRemove): | def removeFromContainer(self, parent, child): | def removeFromContainer(self, childToRemove): # @@@ Must be implemented pass |
children = window.GetChildren() | assert (len (self.childrenToAdd) == 2) | def handleChildren(self, window): children = window.GetChildren() width, height = window.GetSizeTuple() assert self.splitPercentage >= 0.0 and self.splitPercentage < 1.0 if self.orientationEnum == "Horizontal": window.SplitHorizontally(children[0], children[1], int (round (height * self.splitPercentage))) else: window.... |
window.SplitHorizontally(children[0], children[1], | window.SplitHorizontally(self.childrenToAdd[0], self.childrenToAdd[1], | def handleChildren(self, window): children = window.GetChildren() width, height = window.GetSizeTuple() assert self.splitPercentage >= 0.0 and self.splitPercentage < 1.0 if self.orientationEnum == "Horizontal": window.SplitHorizontally(children[0], children[1], int (round (height * self.splitPercentage))) else: window.... |
window.SplitVertically(children[0], children[1], | window.SplitVertically(self.childrenToAdd[0], self.childrenToAdd[1], | def handleChildren(self, window): children = window.GetChildren() width, height = window.GetSizeTuple() assert self.splitPercentage >= 0.0 and self.splitPercentage < 1.0 if self.orientationEnum == "Horizontal": window.SplitHorizontally(children[0], children[1], int (round (height * self.splitPercentage))) else: window.... |
assert (len (self.childrenToAdd) == 2) if self.orientationEnum == "Horizontal": window.SplitVertically(self.childrenToAdd[0], self.childrenToAdd[1]) else: window.SplitHorizontally(self.childrenToAdd[0], self.childrenToAdd[1]) | def handleChildren(self, window): children = window.GetChildren() width, height = window.GetSizeTuple() assert self.splitPercentage >= 0.0 and self.splitPercentage < 1.0 if self.orientationEnum == "Horizontal": window.SplitHorizontally(children[0], children[1], int (round (height * self.splitPercentage))) else: window.... | |
mainViewRoot = template.copy (parent = self.UIRepositoryView.findPath ("//userdata"), | mainViewRoot = template.copy (parent = schema.Item.getDefaultParent (self.UIRepositoryView), | def deleteAllTrunkCaches (block): for child in block.childrenBlocks: deleteAllTrunkCaches (child) import osaf.framework.blocks.Trunk as Trunk if isinstance (block, Trunk.BranchPointBlock): block.trunkDelegate.deleteCache() |
print "Doing make " + dbgStr + clean + "install\n" log.write("Doing make " + dbgStr + clean + "install\n") | print "Doing make " + dbgStr + clean + "install strip\n" log.write("Doing make " + dbgStr + clean + "install strip\n") | def doInstall(buildmode, workingDir, log, cleanFirst=False): # for our purposes, we do not really do a build # we will update chandler from CVS, and grab new tarballs when they appear if buildmode == "debug": dbgStr = "DEBUG=1" else: dbgStr = "" if cleanFirst: clean = " clean " else: clean = " " moduleDir = os.path.j... |
[buildenv['make'], dbgStr, clean, "install" ]) | [buildenv['make'], dbgStr, clean, "install", "strip" ]) | def doInstall(buildmode, workingDir, log, cleanFirst=False): # for our purposes, we do not really do a build # we will update chandler from CVS, and grab new tarballs when they appear if buildmode == "debug": dbgStr = "DEBUG=1" else: dbgStr = "" if cleanFirst: clean = " clean " else: clean = " " moduleDir = os.path.j... |
style = wx.NO_BORDER if '__WXMAC__' in wx.PlatformInfo: style |= wx.TE_MULTILINE style |= wx.TE_NO_VSCROLL elif '__WXGTK__' in wx.PlatformInfo: style |= wx.TE_MULTILINE style |= wx.TE_NO_VSCROLL else: style |= wx.TE_PROCESS_ENTER | style = wx.NO_BORDER | wx.TE_PROCESS_ENTER | wx.TE_NO_VSCROLL if '__WXMSW__' not in wx.PlatformInfo: style |= wx.TE_MULTILINE | def __init__(self, parent, defocusCallback=None, *arguments, **keywords): # Windows and Mac add an extra vertical scrollbar for TE_MULTILINE, # and GTK does not. Further, if GTK is not multiline, then the single # line mode looks really wonky with a huge cursor. The undocumented # flag TE_NO_VSCROLL solves the former ... |
if notification.threadid != id(threading.currentThread()): | if notification.threadid != self.threadid: | def post(self, notification): if notification.threadid != None: if notification.threadid != id(threading.currentThread()): return self.callback(notification) |
exception = \ | explanation = \ | def makeValue(self, item, attributeName, attributeTypePath, value): """ Creates a value from a string, based on the type of the attribute. """ if attributeTypePath: attributeType = self.repository.findPath(attributeTypePath) if attributeType is None: explanation = \ "Attribute type doesn't exist '%s'" % attributeTypePa... |
item = self.getItemClass()(name, parent, self) if self._kind is self: superKind = self._kind.itsParent.getItemChild('Item') item.addValue('superKinds', superKind) return item | return self.getItemClass()(name, parent, self) | def newItem(self, name, parent): """Create an item of this kind. |
try: return self.getAttributeValue('superKinds', _attrDict=self._references) except AttributeError: raise ValueError, 'No superKind for %s' %(self.itsPath) | superKinds = self.getAttributeValue('superKinds', default=None, _attrDict=self._references) if not superKinds: self.getRepository().logger.warn('No superKinds for %s', self.itsPath) return [ self._kind.itsParent['Item'] ] return superKinds | def _getSuperKinds(self): |
splitter.widget.MoveSash( splitter.size.height * splitter.splitPercentage ) | position = int (splitter.size.height * splitter.splitPercentage + 0.5) splitter.widget.SetSashPosition(position) splitter.widget.adjustSplit(position) | def wxSynchronizeWidget(self): super (wxBoxContainer, self).wxSynchronizeWidget () |
template_child_attrs = [] | template_child_attrs = () | def __repr__(self): return "ItemRoot%r" % self.parts |
self.childAttributeNames = childAttributeNames | self.childAttributeNames = tuple(childAttributeNames) def __repr__(self): return "ItemTemplate(%s, %r, %r, **%r)" % ( self.target_class.__name__, self.itsName, self.childAttributeNames, self.attrs ) | def __init__(self, target_class, itsName, childAttributeNames, **attrs): self.attrs = attrs self.itsName = itsName self.target_class = target_class self.childAttributeNames = childAttributeNames |
startDay = datetime.today() | today = datetime.today() startDay = datetime.combine(today, time(0)) | def wxSynchronizeWidget(self): # We now want the preview area to always appear. If the calendar is visible, however, we always want the # preview area to describe today, rather than the currently selected day. minical = Block.Block.findBlockByName("MiniCalendar") if isMainCalendarVisible() or not minical: startDay = d... |
index.insertKey(key, index.getLastKey()) | if key not in index: index.insertKey(key, index.getLastKey()) | def _collectionChanged(self, op, other): |
index.removeKey(key) | if key in index: index.removeKey(key) | def _collectionChanged(self, op, other): |
self.SetPage (self.blockItem.getHTMLText (self.blockItem.selection)) | self.SetPage (self.blockItem.getHTMLText (self.blockItem.contents)) | def wxSynchronizeWidget(self, useHints=False): if self.blockItem.selection is not None: self.SetPage (self.blockItem.getHTMLText (self.blockItem.selection)) else: self.SetPage('<html><body></body></html>') |
[buildenv['make'], dbgStr, "install" ]) | [buildenv['make'], dbgStr, "clean", "install" ]) | def doInstall(buildmode, workingDir, log): |
sizer.Add((3,3), 0, wx.EXPAND) | sizer.Add((5,5), 0, wx.EXPAND) | def OnInit(self): self.SetBackgroundColour(self.parent.bgColor) |
self.colorSelect = colourselect.ColourSelect(self, -1) | self.colorSelect = colourselect.ColourSelect(self, -1, size=wx.Size(30,15)) | def OnInit(self): self.SetBackgroundColour(self.parent.bgColor) |
navigationRow.Add(self.colorSelect, 0, wx.EXPAND) | navigationRow.Add((5,5), 0, wx.EXPAND) navigationRow.Add(self.colorSelect, 0, wx.CENTER) | def OnInit(self): self.SetBackgroundColour(self.parent.bgColor) |
navigationRow.Add(self.prevButton, 0, wx.EXPAND) | navigationRow.Add(self.prevButton, 0, wx.CENTER) | def OnInit(self): self.SetBackgroundColour(self.parent.bgColor) |
navigationRow.Add(self.nextButton, 0, wx.EXPAND) | navigationRow.Add(self.nextButton, 0, wx.CENTER) | def OnInit(self): self.SetBackgroundColour(self.parent.bgColor) |
CreateControl(False, readOnly, parentWidget, id, parentBlock, font) | CreateControl(False, True, parentWidget, id, parentBlock, font) | def CreateControl(self, forEditing, readOnly, parentWidget, id, parentBlock, font): return super(StaticStringAttributeEditor, self).\ CreateControl(False, readOnly, parentWidget, id, parentBlock, font) |
try: self.hoverRow except AttributeError: | if not hasattr (self, 'hoverRow'): | def OnHover (self, x, y, dragResult): hoverRow = self.YToRow(y) try: self.hoverRow except AttributeError: # If it's our first time hovering then set previous state to be NOT_FOUND self.hoverRow = wx.NOT_FOUND |
try: self.hoverRow except AttributeError: return else: | hoverRow = getattr (self, 'hoverRow', None) if hoverRow is not None: | def OnLeave (self): # check if we had a hover row try: self.hoverRow except AttributeError: return else: # Clear the selection colour if necessary self.SetRowHighlight(self.hoverRow, False) self.hoverRow = wx.NOT_FOUND |
self.SetCellBackgroundColour(row, 0, wx.LIGHT_GREY) else: self.SetCellBackgroundColour(row, 0, wx.WHITE) | color = wx.LIGHT_GREY else: color = wx.WHITE self.SetCellBackgroundColour(row, 0, color) | def SetRowHighlight (self, row, highlightOn): if highlightOn: self.SetCellBackgroundColour(row, 0, wx.LIGHT_GREY) else: self.SetCellBackgroundColour(row, 0, wx.WHITE) # Just invalidate the changed rect |
names = [displayName, str(date)] node.AddChildNode(child, names, hasKids) | def _addChildNode(self, node, child, hasKids): displayName = child.getAttributeValue('displayName', default='<Untitled>') date = child.getAttributeValue('date', default='') if date != '': date = date.Format('%B %d, %Y %I:%M %p') names = [displayName, str(date)] node.AddChildNode(child, names, hasKids) | |
def GetTreeData(self, node): item = node.GetData() | return [displayName, str(date)] | def GetTreeData(self, node): item = node.GetData() |
if item == None: node.AddRootNode(Globals.repository, ['//'], True) return | def ElementHasChildren(self, element): if element.kind == RSSData.ZaoBaoParcel.getRSSChannelKind(): return len(element.getAttributeValue('items', default=[])) != 0 return False | def GetTreeData(self, node): item = node.GetData() |
repository = self.getRepository() try: cs = self.contentSpec.data.split('.') channel = repository.find(str(cs[0])) items = channel.getAttributeValue(str(cs[1]), default=[]) except: print 'error getting items' return for item in items: self._addChildNode(node, item, False) def OnGoToURI(self, notification): wxTreeWind... | def NeedsUpdate(self, notification): return True | def GetTreeData(self, node): item = node.GetData() |
class ZaoBaoTree(Tree): def _addChildNode(self, node, child, hasKids): displayName = child.getAttributeValue('displayName', default='<Untitled>') date = child.getAttributeValue('date', default='') | class ZaoBaoTreeDelegate: def ElementParent(self, element): chanKind = RSSData.ZaoBaoParcel.getRSSChannelKind() if element == chanKind: return None if element.kind == chanKind: return chanKind return element.channel def ElementChildren(self, element): chanKind = RSSData.ZaoBaoParcel.getRSSChannelKind() if element == ... | def OnGoToURI(self, notification): wxTreeWindow = Globals.association[self.getUUID()] wxTreeWindow.GoToURI(notification.data['URI']) |
def GetTreeData(self, node): item = node.GetData() if item: chanKind = RSSData.ZaoBaoParcel.getRSSChannelKind() | return [displayName, str(date)] | def GetTreeData(self, node): item = node.GetData() if item: chanKind = RSSData.ZaoBaoParcel.getRSSChannelKind() |
if item.getUUID() == Globals.repository.getUUID(): for child in KindQuery().run([chanKind]): self._addChildNode(node, child, child.hasAttributeValue('items')) | def ElementHasChildren(self, element): chanKind = RSSData.ZaoBaoParcel.getRSSChannelKind() if element == chanKind: return True | def GetTreeData(self, node): item = node.GetData() if item: chanKind = RSSData.ZaoBaoParcel.getRSSChannelKind() |
elif item.kind == chanKind: for child in item.items: self._addChildNode(node, child, False) | if element.kind == chanKind: return len(element.getAttributeValue('items', default=[])) != 0 | def GetTreeData(self, node): item = node.GetData() if item: chanKind = RSSData.ZaoBaoParcel.getRSSChannelKind() |
else: node.AddRootNode(Globals.repository, ['//'], True) | return False | def GetTreeData(self, node): item = node.GetData() if item: chanKind = RSSData.ZaoBaoParcel.getRSSChannelKind() |
def OnGoToURI(self, notification): wxTreeWindow = Globals.association[self.getUUID()] wxTreeWindow.GoToURI(notification.data['URI']) | def NeedsUpdate(self, notification): return True | def OnGoToURI(self, notification): wxTreeWindow = Globals.association[self.getUUID()] wxTreeWindow.GoToURI(notification.data['URI']) |
def OnEnterPressedEvent(self, notification): url = notification.GetData()['text'] if len(url) < 5: return | def OnEnterPressedEvent(self, notification): url = notification.GetData()['text'] if len(url) < 5: return | |
Globals.repository.commit() chan = RSSData.NewChannelFromURL(url, True) Globals.repository.commit() | def OnEnterPressedEvent(self, notification): url = notification.GetData()['text'] if len(url) < 5: return Globals.repository.commit() chan = RSSData.NewChannelFromURL(url, True) Globals.repository.commit() | def OnEnterPressedEvent(self, notification): url = notification.GetData()['text'] if len(url) < 5: return |
for checkedItem in sidebar.checkedItems: | for checkedItem in list(sidebar.checkedItems): | def wxSynchronizeWidget(self): sidebar = self.blockItem for checkedItem in sidebar.checkedItems: if checkedItem not in sidebar.contents: sidebar.checkedItems.remove (checkedItem) super (wxSidebar, self).wxSynchronizeWidget() |
return false | return False | def GiveFeedback (self, effect): windowX, windowY = wxGetMousePosition() x, y = self.drawableObject.canvas.ScreenToClientXY (windowX, windowY) self.drawableObject.dragImage.Move((x, y)) return false |
self.visible = true self.selected = false | self.visible = True self.selected = False | def __init__(self, canvas): wxEvtHandler.__init__ (self) self.bounds = wxRect () self.canvas = canvas self.visible = true self.selected = false self.dragStartPos = None EVT_MOUSE_EVENTS (self, self.OnMouseEvent) |
return true | return True | def OnMouseEvent (self, event): x, y = event.GetPositionTuple() if event.ButtonDown(1) and self.SelectedHitTest (x, y) : self.canvas.DeSelectAll() self.SetSelected() self.canvas.Update() if self.DragHitTest (x, y): self.dragStartPos = (x, y) elif event.ButtonUp(1): self.dragStartPos = None elif event.Dragging() and eve... |
return false | return False | def OnMouseEvent (self, event): x, y = event.GetPositionTuple() if event.ButtonDown(1) and self.SelectedHitTest (x, y) : self.canvas.DeSelectAll() self.SetSelected() self.canvas.Update() if self.DragHitTest (x, y): self.dragStartPos = (x, y) elif event.ButtonUp(1): self.dragStartPos = None elif event.Dragging() and eve... |
if show: show = true | show = bool(show) | def Show (self, show): """ Python doesn't have logical exclusive or, so we need to first make sure show is true if not equal to zero """ if show: show = true |
self.dragImage.BeginDrag(wxPoint (x,y), self.canvas, true) | self.dragImage.BeginDrag(wxPoint (x,y), self.canvas, True) | def DoDrag(self, x, y): """ Implement all the drag and drop functionality: """ |
assert (false) | assert (False) | def Draw (self, dc): """ You must implement this routine to do draw """ assert (false) |
assert (false) | assert (False) | def DragHitTest (self, x, y): """ You must implement this routine to do hit testing for dragable region of drawable object """ assert (false) |
assert (false) | assert (False) | def ConvertDrawableObjectToDataObject (self, x, y): """ You must implement this routine to create data object for drag and drop """ assert (false) |
assert (false) def SetSelected(self, selected=true): | assert (False) def SetSelected(self, selected=True): | def SelectedHitTest (self, x, y): """ You must implement this routine to do hit testing to identify the region for selecting the object. """ assert (false) |
if selected: selected = true | selected = bool(selected) | def SetSelected(self, selected=true): """ Sets the selected bit for this object. Does a canvas refresh on the object if it has changed state. Does not call Update on the canvas. """ # Use the same trick as Show() if selected: selected = true |
return true | return True | def OnMouseEvent (self, event): x, y = event.GetPositionTuple() x, y = self.CalcUnscrolledPosition (x, y) for drawableObject in self.zOrderedDrawableObjects: if drawableObject.bounds.Inside ((x, y)): event.m_x = x - drawableObject.bounds.GetX() event.m_y = y - drawableObject.bounds.GetY() if drawableObject.ProcessEvent... |
self.dragCreateDrawableObject.selected = true | self.dragCreateDrawableObject.selected = True | def OnMouseEvent (self, event): x, y = event.GetPositionTuple() x, y = self.CalcUnscrolledPosition (x, y) for drawableObject in self.zOrderedDrawableObjects: if drawableObject.bounds.Inside ((x, y)): event.m_x = x - drawableObject.bounds.GetX() event.m_y = y - drawableObject.bounds.GetY() if drawableObject.ProcessEvent... |
return true return false | return True return False | def OnMouseEvent (self, event): x, y = event.GetPositionTuple() x, y = self.CalcUnscrolledPosition (x, y) for drawableObject in self.zOrderedDrawableObjects: if drawableObject.bounds.Inside ((x, y)): event.m_x = x - drawableObject.bounds.GetX() event.m_y = y - drawableObject.bounds.GetY() if drawableObject.ProcessEvent... |
drawableObject = self.ConvertDataObjectToDrawableObject (dataObject, x, y) x = drawableObject.bounds.GetLeft() y = drawableObject.bounds.GetTop() | def OnData (self, dataObject, x, y, result): """ Handle default behavior of copy and move """ drawableObject = self.ConvertDataObjectToDrawableObject (dataObject, x, y) x = drawableObject.bounds.GetLeft() y = drawableObject.bounds.GetTop() if result == wxDragMove or result == wxDragCopy: if (self.internalDnDItem != Non... | |
return true | return True | def CreateHitTest (self, x, y): """ Set self.autoCreateDistance to some value other than zero to enable dragging autoCreateDistance pixels to automatically create new drawable objects. By default, drawable objects are created if you click and drag in the canvas anwhere there isn't a drawable object. You can restrict th... |
def ConvertDataObjectToDrawableObject (self, dataObject, x, y): | def ConvertDataObjectToDrawableObject (self, dataObject, x, y, move): | def ConvertDataObjectToDrawableObject (self, dataObject, x, y): """ You must implement this routine to convert a dataobject, used in drag and drop into a drawable object. """ assert (false) |
assert (false) | assert (False) | def ConvertDataObjectToDrawableObject (self, dataObject, x, y): """ You must implement this routine to convert a dataobject, used in drag and drop into a drawable object. """ assert (false) |
assert (false) | assert (False) | def CreateNewDrawableObject (self, dragRect, startDrag, endDrag): """ You must implement this routine to create new drawable objects by dragging on the blank canvas. """ assert (false) |
masterOccurrences = event.getMaster().occurrences or [] | master = event.getMaster() master.getFirstOccurrence() masterOccurrences = master.occurrences or [] | def mergeFunction(code, item, attribute, value): # 'value' is the one from the *this* view # getattr(item, attribute) is the value from a different view |
logger.info("No kinds found locally for %s" % classNameList) | logger.error("No kinds found locally for %s" % classNameList) | def _importElement(self, contentView, element, item=None, updateCallback=None, stats=None): |
clearSelectionMethod = getattr(type(self), "ClearSelection", None) if clearSelectionMethod is not None: clearSelectionMethod(self) | self.postEventByName("SelectItemsBroadcast", {'items': [], 'collection': selectedCollection }) | def removeItem(item): item.removeFromCollection(selectedCollection) |
clearSelectionMethod = getattr(type(self), "ClearSelection", None) if clearSelectionMethod is not None: clearSelectionMethod(self) | self.postEventByName("SelectItemsBroadcast", {'items': [], 'collection': selectedCollection }) | def deleteItem(item): item.addToCollection(trash) |
getMasterMethod = getattr(type(item), 'getMaster', None) | getMasterMethod = getattr(item, 'getMaster', None) | def GetAttributeValue(self, item, attributeName): # Only a recurrence master appears 'in' the collection (for 0.6, anyway) # so if this item lets us get its master, do so and use that instead. getMasterMethod = getattr(type(item), 'getMaster', None) if getMasterMethod is not None: item = getMasterMethod(item) |
item = getMasterMethod(item) | item = getMasterMethod() | def GetAttributeValue(self, item, attributeName): # Only a recurrence master appears 'in' the collection (for 0.6, anyway) # so if this item lets us get its master, do so and use that instead. getMasterMethod = getattr(type(item), 'getMaster', None) if getMasterMethod is not None: item = getMasterMethod(item) |
storage = Storage("_CHANDLER_APP_") | def __InitDatabase(self): """Sets up the persistence dictionary so that we can resume the state that we were in when we quit. The main thing that we are persisting for now is the window manager. It has references to any windows that had been open.""" self._storage = Storage("_CHANDLER_APP_") # This section should use... | |
if (cutting or (proxiedEvent == master) or (proxiedEvent == master.getFirstOccurrence())): | if cutting or (proxiedEvent == master): | def removeFromCollection(self, collection, cutting = False): """ Remove self from the given collection, or queue the removal. """ proxiedEvent = EventStamp(self.proxiedItem) if proxiedEvent.rruleset is None: collection.remove(EventStamp(proxiedEvent).getMaster().itsItem) else: change = dict(method=self.propagateDelete,... |
app = schema.ns('osaf.app', self.view) sidebarCollection = app.sidebarCollection for collection in [app.inCollection, app.outCollection]: if collection not in sidebarCollection: sidebarCollection.add (collection) | if sharing.isInboundMailSetUp (self.view): app = schema.ns('osaf.app', self.view) sidebarCollection = app.sidebarCollection for collection in [app.inCollection, app.outCollection]: if collection not in sidebarCollection: sidebarCollection.add (collection) | def OnOk(self, evt): if self.__Validate(): self.__ApplyChanges() self.__ApplyDeletions() app = schema.ns('osaf.app', self.view) sidebarCollection = app.sidebarCollection for collection in [app.inCollection, app.outCollection]: if collection not in sidebarCollection: sidebarCollection.add (collection) self.EndModal(True... |
attribute = self.base_GetAttr (row, column, kind) | attribute = super(wxTableData, self).GetAttr (row, column, kind) | def GetAttr (self, row, column, kind): attribute = self.base_GetAttr (row, column, kind) if attribute is None: type = self.GetTypeName (row, column) delegate = AttributeEditors.getSingleton (type) attribute = self.defaultROAttribute grid = self.GetView() assert (row < self.GetNumberRows() and column < self.GetNumberCol... |
self.SelectFirstField() | def RenderSelectedForm(self): section = self.listbox.GetStringSelection() formElements = self.preferencesMetadata[section] # allocate a gridSizer to contain the form elements self.ResetForm() # for this first implementation, we ignore the type for element in formElements: labelValue = element.label + ':' if element.t... | |
selection = schema.One(schema.Item, initialValue = None) schema.addClouds( copying = schema.Cloud(byRef=[selection]) ) | def installParcel(parcel, oldVersion=None): # Declare our attribute editors at repository-init time # # If you modify this list, please keep it in alphabetical order by type string. # Also, note that there are more attribute editors custom to the detail # view; they're declared in its installParcel method. aeList = { '... | |
logger.debug("DetailRoot.onSetContentsEvent: %s", event.arguments['item']) self.__changeSelection(event.arguments['item']) def onSelectItemEvent (self, event): """ A DetailTrunk is an event boundary; this keeps all the events sent between blocks of the Detail View to ourselves. """ logger.debug("DetailRoot.onSelectIte... | item = event.arguments['item'] logger.debug("DetailRoot.onSetContentsEvent: %s", item) if item is not None and (len(self.contents.inclusions) != 1 or \ self.contents.inclusions.first() is not item): self.contents.inclusions.clear() self.contents.add(item) def selectedItem(self): try: item = self.contents.inclusions... | def onSetContentsEvent (self, event): logger.debug("DetailRoot.onSetContentsEvent: %s", event.arguments['item']) self.__changeSelection(event.arguments['item']) |
def __changeSelection(self, item): self.selection = item if item is not None and (len(self.contents.inclusions) != 1 or \ self.contents.inclusions.first() is not item): self.contents.inclusions.clear() self.contents.add(item) def selectedItem(self): return self.selection | def __changeSelection(self, item): self.selection = item # Make sure the itemcollection that we monitor includes only the selected item. if item is not None and (len(self.contents.inclusions) != 1 or \ self.contents.inclusions.first() is not item): self.contents.inclusions.clear() self.contents.add(item) | |
endTime = value + (item.endTime - item.getEffectiveStartTime()) | endTime = value + (item.endTime - item.startTime) | def SetAttributeValue(self, item, attributeName, valueString): newValueString = valueString.replace('?','').strip() if len(newValueString) == 0: # Attempting to remove the start date field will set its value to the # "previous value" when the value is committed (removing focus or # "enter"). Attempting to remove the en... |
try: | if view.repository.isOpen(): | def stopRepository(view): try: try: view.commit() except VersionConflictError, e: logger.exception(e) finally: view.repository.close() |
view.commit() except VersionConflictError, e: logger.exception(e) finally: view.repository.close() | try: if view.isOpen(): view.commit() except VersionConflictError, e: logger.exception(e) finally: view.repository.close() | def stopRepository(view): try: try: view.commit() except VersionConflictError, e: logger.exception(e) finally: view.repository.close() |
def onSetContentsEvent(self, event): event.arguments['collection']) | def onSetContentsEvent(self, event): self.setContentsOnBlock(event.arguments['item'], event.arguments['collection']) | def onSetContentsEvent(self, event): #logger.debug("%s: onSetContentsEvent: %s, %s", debugName(self), #event.arguments['item'], event.arguments['collection'] self.setContentsOnBlock(event.arguments['item'], event.arguments['collection']) |
getNextKey = self.getPrevKey | getNextKey = self.getPreviousKey | def iterkeys(self, firstKey=None, lastKey=None, backwards=False): |
event.arguments['Enable'] = (self.selection is not None) | event.arguments['Enable'] = self.RemoveIsAllowed() | def onRemoveEventUpdateUI(self, event): event.arguments['Enable'] = (self.selection is not None) event.arguments['Text'] = _(u"Delete from '%(collectionName)s'") % {'collectionName': self.contents.collectionList[0].displayName} |
necessary as python calls this method, via L{__delattr__}. | necessary as python calls this method via the corresponding attribute descriptor. This method only deletes a local value. A value inherited via C{defaultValue} or C{inheritFrom} cannot be deleted and causes this method to do nothing. | def removeAttributeValue(self, name, _attrDict=None, _attrID=None): """ Remove a value for a Chandler attribute. |
if hasattr(self, name): return | def removeAttributeValue(self, name, _attrDict=None, _attrID=None): """ Remove a value for a Chandler attribute. | |
try: | if name in _attrDict: | def removeAttributeValue(self, name, _attrDict=None, _attrID=None): """ Remove a value for a Chandler attribute. |
except KeyError: | self.setDirty(Item.VDIRTY, name, _attrDict, True) elif hasattr(self, name): return else: | def removeAttributeValue(self, name, _attrDict=None, _attrID=None): """ Remove a value for a Chandler attribute. |
self.setDirty(Item.VDIRTY, name, _attrDict, True) | def removeAttributeValue(self, name, _attrDict=None, _attrID=None): """ Remove a value for a Chandler attribute. | |
except KeyError: | otherName = self._kind.getOtherName(name, _attrID, self) _attrDict._removeValue(name, value, otherName) elif hasattr(self, name): return else: | def removeAttributeValue(self, name, _attrDict=None, _attrID=None): """ Remove a value for a Chandler attribute. |
otherName = self._kind.getOtherName(name, _attrID, self) _attrDict._removeValue(name, value, otherName) | def removeAttributeValue(self, name, _attrDict=None, _attrID=None): """ Remove a value for a Chandler attribute. | |
outlineColor = tintedColor(0.5) | outlineColor = tintedColor(0.6) | def demangledTupleGetter(self): return tuple([val.fget(self) for val in args]) |
selectedOutlineColor = tintedColor(0.5) | selectedOutlineColor = tintedColor(0.6) | def demangledTupleGetter(self): return tuple([val.fget(self) for val in args]) |
timeBottomMargin = 1 | timeBottomMargin = 0 | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
timeBottomMargin = 3 | timeBottomMargin = 2 | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
y += self.timeHeight dc.SetPen(wx.Pen(outlineColor)) dc.DrawLine(itemRect.x, y + 1, itemRect.x + itemRect.width, y + 1) y += timeBottomMargin | y += self.timeHeight + timeBottomMargin | def Draw(self, dc, styles, brushOffset, selected, rightSideCutOff=False): # @@@ add a general cutoff parameter? item = self._item if item.isDeleted(): return |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.