rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
if self.selection: | if self.selection or self.multiSelection: | def OnControlSelect(self, event): """ Control is clicked. Either select it or add control from palette """ ctrl = self.senderMapper.getObject(event) |
if companion.container: parent = ctrl | selCtrl, selCompn, selPos = \ self.checkChildCtrlClick(ctrlName, ctrl, companion, evtPos) if event.ShiftDown(): if self.selection: if ctrl.GetParent().this != self.selection.selection.GetParent().this: return elif self.multiSelection: if ctrl.GetParent().this != self.multiSelection[0].selection.GetParent().this: re... | def OnControlSelect(self, event): """ Control is clicked. Either select it or add control from palette """ ctrl = self.senderMapper.getObject(event) |
parent = ctrl.GetParent() tbOffset = 0 if parent == self: tb = self.GetToolBar() if tb: tbOffset = tb.GetSize().y * -1 parRel, parRef = self.buildParentRelationship() if ctrl == self: children = parRef[''] else: children = parRef[ctrlName] for childName in children.keys(): childCompn, childCtrl = self.objects[child... | if self.multiSelection: for sel in self.multiSelection: if selCtrl == sel.selection: sel.moveCapture(selCtrl, selCompn, selPos) self.mainMultiDrag = selCtrl others = self.multiSelection[:] others.remove(sel) for capSel in others: capSel.moveCapture(capSel.selection, capSel.selCompn, selPos) return self.clearMultiSele... | def OnControlSelect(self, event): """ Control is clicked. Either select it or add control from palette """ ctrl = self.senderMapper.getObject(event) |
self.selection = None | self.selection = None elif self.multiSelection: for sel in self.multiSelection: sel.destroy() self.multiSelection = None | def OnCloseWindow(self, event): self.destroying = true if self.selection: self.selection.destroy() self.selection = None |
def OnAlignSelected(self, event): dlg = CtrlAlign.create(self) try: dlg.ShowModal() finally: dlg.Destroy() def OnSizeSelected(self, event): dlg = CtrlSize.create(self) try: dlg.ShowModal() finally: dlg.Destroy() def OnSelectParent(self, event): if self.selection: self.selectParent(self.selection.selection) elif self.... | def OnCtrlHelp(self, event): if self.inspector.selCmp: Help.showHelp(self, Help.wxWinHelpFrame, self.inspector.selCmp.wxDocs, None) | |
return '<%s %s>' % (`self.__class__`, self.whole_name()) | return '<%s %s, %s>' % (`self.__class__`, self.whole_name(), self.date) | def __repr__(self): return '<%s %s>' % (`self.__class__`, self.whole_name()) |
entries = filter(None, string.split(line[10:41], ' ')) | entries = filter(None, string.split(line[10:42], ' ')) | def read(self, line): try: self.perms = line[:10] entries = filter(None, string.split(line[10:41], ' ')) self.size = int(entries[3]) self.date = line[42:54] self.name = string.strip(line[55:]) except: print 'Could not read:', line |
self.date = line[42:54] | self.date = line[43:55] | def read(self, line): try: self.perms = line[:10] entries = filter(None, string.split(line[10:41], ' ')) self.size = int(entries[3]) self.date = line[42:54] self.name = string.strip(line[55:]) except: print 'Could not read:', line |
except: print 'Could not read:', line | except Exception, message: print 'Could not read:', line, message | def read(self, line): try: self.perms = line[:10] entries = filter(None, string.split(line[10:41], ' ')) self.size = int(entries[3]) self.date = line[42:54] self.name = string.strip(line[55:]) except: print 'Could not read:', line |
print self.path | def whole_name(self): print self.path if self.path == '/': return '/%s' % self.name else: return '%s/%s' % (self.path, self.name) | |
def destroy(self): self.faceDnClr = self.shadowPen = self.highlightPen = self.focusIndPen = None | def SetBestSize(self, size=None): """ Given the current font and bezel width settings, calculate and set a good size. """ if size is None: size = wxSize(-1,-1) if type(size) == type(()): size = wxSize(size[0], size[1]) | |
if no_sys_col: faceClr = wxColour(192, 192, 192) textClr = wxColour(0, 0, 0) else: faceClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE) textClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNTEXT) | faceClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE) textClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNTEXT) | def InitColours(self): |
if no_sys_col: shadowClr = wxColour(128, 128, 128) highlightClr = wxColour(228, 228, 228) else: shadowClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNSHADOW) highlightClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNHIGHLIGHT) | shadowClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNSHADOW) highlightClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNHIGHLIGHT) | def InitColours(self): |
wxWindow.SetBackgroundColour(self, colour) | wxControl.SetBackgroundColour(self, colour) | def SetBackgroundColour(self, colour): wxWindow.SetBackgroundColour(self, colour) |
self.ReleaseMouse() | def OnLeftUp(self, event): if not self.IsEnabled(): return if not self.up: # if the button was down when the mouse was released... self.Notify() self.up = true self.ReleaseMouse() self.Refresh() event.Skip() | |
def destroy(self): wxGenButton.destroy(self) self.bmpLabel = None self.bmpDisabled = None self.bmpFocus = None self.bmpSelected = None | def destroy(self): wxGenButton.destroy(self) self.bmpLabel = None self.bmpDisabled = None self.bmpFocus = None self.bmpSelected = None | |
class wxGenBitmapTextToggleButton(__ToggleMixin, wxGenBitmapTextButton): pass | def OnKeyUp(self, event): if self.hasFocus and event.KeyCode() == ord(" "): self.up = not self.up self.Notify() self.Refresh() event.Skip() | |
if conflict and len(ismerge) ==1: | if conflict and len(ismerge) == 1 or ismerge[0] == 'dummy timestamp': | def cvsFileLocallyModified(filename, timestamp): """ cvsFileLocallyModified -> modified, conflict """ ismerge = string.split(timestamp, '+') conflict = ismerge[0] == 'Result of merge' filets = time.asctime(time.gmtime(os.stat(filename)[stat.ST_MTIME])) if conflict and len(ismerge) ==1: filesegs, cvssegs = 1, 0 # conve... |
size=wxSize(561, 288), style=wxTRANSPARENT_WINDOW | wxCLIP_CHILDREN | wxSUNKEN_BORDER) | size=wxSize(561, 288), style=wxSUNKEN_BORDER) | def _init_ctrls(self, prnt): # generated method, don't edit wxPanel.__init__(self, id=wxID_IMAGEEDITORPANEL, name='ImageEditorPanel', parent=prnt, pos=wxPoint(466, 318), size=wxSize(586, 356), style=wxSUNKEN_BORDER | wxTAB_TRAVERSAL) self._init_utils() self.SetAutoLayout(true) self.SetClientSize(wxSize(578, 329)) |
EVT_SCROLL(self.editWindow, self.OnEditWindowScroll) | EVT_SCROLLWIN(self.editWindow, self.OnEditWindowScroll) | def _init_ctrls(self, prnt): # generated method, don't edit wxPanel.__init__(self, id=wxID_IMAGEEDITORPANEL, name='ImageEditorPanel', parent=prnt, pos=wxPoint(466, 318), size=wxSize(586, 356), style=wxSUNKEN_BORDER | wxTAB_TRAVERSAL) self._init_utils() self.SetAutoLayout(true) self.SetClientSize(wxSize(578, 329)) |
self.selDesgn.saveOnClose = true self.selDesgn.Close() | self.selDesgn.controllerView.saveOnClose = true self.selDesgn.controllerView.Close() | def OnPost(self, event): if self.selDesgn: self.selDesgn.saveOnClose = true self.selDesgn.Close() |
self.selDesgn.saveOnClose = false self.selDesgn.Close() | self.selDesgn.controllerView.saveOnClose = false self.selDesgn.controllerView.Close() | def OnCancel(self, event): if self.selDesgn: self.selDesgn.saveOnClose = false self.selDesgn.Close() |
if self.value == v: | if value == v: | def valueToIECValue(self): for k, v in self.defaults.items(): if self.value == v: return k objs = self.companion.designer.getObjectsOfClass(self.linkClass) for objName in objs.keys(): if objs[objName] and self.value and objs[objName].this == self.value.this: return objName return `None` |
objs = self.companion.designer.getObjectsOfClass(self.linkClass) | objs = self.companion.designer.getObjectsOfClass(LinkClass) | def valueToIECValue(self): for k, v in self.defaults.items(): if self.value == v: return k objs = self.companion.designer.getObjectsOfClass(self.linkClass) for objName in objs.keys(): if objs[objName] and self.value and objs[objName].this == self.value.this: return objName return `None` |
if objs[objName] and self.value and objs[objName].this == self.value.this: | if objs[objName] and value and objs[objName].this == value.this: | def valueToIECValue(self): for k, v in self.defaults.items(): if self.value == v: return k objs = self.companion.designer.getObjectsOfClass(self.linkClass) for objName in objs.keys(): if objs[objName] and self.value and objs[objName].this == self.value.this: return objName return `None` |
self.companion.designer, value) | self.companion.designer, self.value) | def getObjects(self): return getValidSizers(self.companion.parentCompanion.control, self.companion.designer, value) |
value = sizer.GetName() | value = self.getNameForValue(self.value, self.linkClass) | def getValues(self): if self.value is None: value = 'None' else: value = sizer.GetName() return getValidSizers(self.companion.control, self.companion.designer, value) |
else: return `propVal` == `ctrlVal` | elif isinstance(propVal, (types.StringType, types.UnicodeType)) and \ isinstance(ctrlVal, (types.StringType, types.UnicodeType)): return propVal == ctrlVal else: return propVal == ctrlVal | def isValuesEqual(self, propVal, ctrlVal): if isinstance(propVal, wxFontPtr) and isinstance(ctrlVal, wxFontPtr): return fontAsExpr(propVal) == fontAsExpr(ctrlVal) else: return `propVal` == `ctrlVal` |
class StringEnumPropEdit(EnumPropEdit): def getDisplayValue(self): return `self.value` | def getValue(self): if self.editorCtrl: strVal = self.editorCtrl.getValue() try: self.value = self.names[strVal] except KeyError: self.value = self.companion.eval(strVal) | |
wxFrame.__init__(self, size = (-1, -1), id = wxID_INSPECTORFRAME, title = 'Inspector', parent = prnt, name = '', style = wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS | wxCLIP_CHILDREN, pos = (-1, -1)) | wxFrame.__init__(self, size = (-1, -1), id = wxID_INSPECTORFRAME, title = 'Inspector', parent = prnt, name = '', style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN, pos = (-1, -1)) | def _init_ctrls(self, prnt): wxFrame.__init__(self, size = (-1, -1), id = wxID_INSPECTORFRAME, title = 'Inspector', parent = prnt, name = '', style = wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS | wxCLIP_CHILDREN, pos = (-1, -1)) self._init_utils() |
self.SetIcon(wxIcon(Preferences.toPyPath('Images/Icons/Inspector.ico'), wxBITMAP_TYPE_ICO)) | self.SetIcon(IS.load('Images/Icons/Inspector.ico')) | def __init__(self, parent): self._init_ctrls(parent) |
if (self.selCmp == compn) or self.vetoSelect: | if self.selCmp == compn or self.vetoSelect: | def selectObject(self, compn, selectInContainment = true): """ Select an object in the inspector by populating the property pages. This method is called from the InspectableObjectCollection derived classes """ |
nv = page.getNameValue(name) if nv: nv.initFromComponent() | nv = page.getNameValue(name) if nv: page.initFromComponent(name) | def pageUpdate(self, page, name): |
print 'directPositionUpdate', comp.name | def directPositionUpdate(self, comp): print 'directPositionUpdate', comp.name comp.persistProp('Position', 'SetPosition', `comp.control.GetPosition()`) | |
c = self.selCmp self.selCmp.updateZopeProps() | cmpn = self.selCmp cmpn.updateZopeProps() | def refreshZopeProps(self): c = self.selCmp self.selCmp.updateZopeProps() self.selCmp = None self.selectObject(c) |
self.selectObject(c) | self.selectObject(cmpn) def OnRevertItem(self, event): if self.selCmp and self.props.prevSel and self.props.prevSel.propEditor: propEdit = self.props.prevSel.propEditor propEdit.companion.propRevertToDefault(propEdit.name, propEdit.propWrapper.getSetterName()) self.props.prevSel.showPropNameModified() | def refreshZopeProps(self): c = self.selCmp self.selCmp.updateZopeProps() self.selCmp = None self.selectObject(c) |
editor = None, options = None, names = None): self.destr = false | editor = None, options = None, names = None, ownerPropEdit = None): self.destr = false | def __init__(self, inspector, nameParent, valueParent, companion, rootCompanion, name, propWrapper, idx, indent, editor = None, options = None, names = None): |
valueParent.GetSize().x+IECWidthFudge) self.expander = None if self.propEditor: self.propValue = self.propEditor.getValue() displayVal = self.propEditor.getDisplayValue() if self.propEditor.getStyle().count(PropertyEditors.esExpandable): mID = NewId() self.expander = wxCheckBox(nameParent, mID, '', wxPoint(8 * self.... | valueParent.GetSize().x + IECWidthFudge) self.expander = None if self.propEditor: self.propEditor.ownerPropEdit = ownerPropEdit self.updatePropValue() displayVal = self.propEditor.getDisplayValue() if PropertyEditors.esExpandable in self.propEditor.getStyle(): mID = NewId() self.expander = wxCheckBox(nameParent, mID... | def __init__(self, inspector, nameParent, valueParent, companion, rootCompanion, name, propWrapper, idx, indent, editor = None, options = None, names = None): |
style = wxCLIP_CHILDREN) | style = wxCLIP_CHILDREN | wxST_NO_AUTORESIZE) self.nameCtrl.SetToolTipString(name) | def __init__(self, inspector, nameParent, valueParent, companion, rootCompanion, name, propWrapper, idx, indent, editor = None, options = None, names = None): |
oiLineHeight -3), style = wxCLIP_CHILDREN) | oiLineHeight -3), style = wxCLIP_CHILDREN | wxST_NO_AUTORESIZE) | def __init__(self, inspector, nameParent, valueParent, companion, rootCompanion, name, propWrapper, idx, indent, editor = None, options = None, names = None): |
self.idx * oiLineHeight)) | self.idx * oiLineHeight + 2)) | def setPos(self, idx): self.idx = idx if self.expander: self.expander.SetPosition(wxPoint(8 * self.indent, self.idx * oiLineHeight)) self.nameCtrl.SetPosition(wxPoint(8 * self.indent + 16, idx * oiLineHeight +2)) self.value.SetPosition(wxPoint(2, idx * oiLineHeight +2)) self.separatorN.SetPosition(wxPoint(0, (idx +1) *... |
if (not cancel) and self.propEditor: self.propEditor.inspectorPost() self.value.SetLabel(self.propEditor.getDisplayValue()) self.value.SetSize(wxSize(self.separatorV.GetSize().x, self.value.GetSize().y)) | if self.propEditor: if cancel: self.propEditor.inspectorCancel() else: self.propEditor.inspectorPost() self.updateDisplayValue() self.value.SetSize(wxSize(self.separatorV.GetSize().x, oiLineHeight-3)) | def hideEditor(self, cancel = false): if (not cancel) and self.propEditor:# and (not self.destr): self.propEditor.inspectorPost() self.value.SetLabel(self.propEditor.getDisplayValue()) self.value.SetSize(wxSize(self.separatorV.GetSize().x, self.value.GetSize().y)) |
self.value.SetLabel(self.propEditor.getDisplayValue()) | self.updateDisplayValue() | def initFromComponent(self): """ Update Inspector after possible change to underlying control """ if self.propEditor: self.propEditor.initFromComponent() if not self.propEditor.editorCtrl: self.value.SetLabel(self.propEditor.getDisplayValue()) self.propEditor.persistValue(self.propEditor.valueAsExpr()) |
pass | def initFromComponent(self): """ Update Inspector after possible change to underlying control """ if self.propEditor: self.propEditor.initFromComponent() if not self.propEditor.editorCtrl: self.updateDisplayValue() def showPropNameModified(self): pass | def initFromComponent(self): """ Update Inspector after possible change to underlying control """ if self.propEditor: self.propEditor.initFromComponent() if not self.propEditor.editorCtrl: self.value.SetLabel(self.propEditor.getDisplayValue()) self.propEditor.persistValue(self.propEditor.valueAsExpr()) |
self.value.SetLabel(self.propEditor.getDisplayValue()) | self.updateDisplayValue() | def initFromComponent(self): if self.propEditor: self.propEditor.initFromComponent() if not self.propEditor.editorCtrl: self.value.SetLabel(self.propEditor.getDisplayValue()) |
style = wxSP_NOBORDER|wxSP_LIVE_UPDATE) | style = wxSP_NOBORDER|wxNO_3D|wxSP_LIVE_UPDATE) | def __init__(self, parent, inspector): wxSplitterWindow.__init__(self, parent, -1, style = wxSP_NOBORDER|wxSP_LIVE_UPDATE)#wxNO_3D|wxSP_3D) self.inspector = inspector self.categories = wxSplitterWindow(self, -1, style = wxNO_3D|wxSP_3D|wxSP_LIVE_UPDATE)#style = wxSP_NOBORDER) self.definitions = InspectorEventScrollWin... |
companion = self.inspector.selCmp | catClassName = self.categoryClasses.GetItemText(self.selCatClass) | def OnMacroSelect(self, event): if self.selMacClass > -1: companion = self.inspector.selCmp macName = self.categoryMacros.GetItemText(self.selMacClass) methName = self.macroNameToEvtName(macName) catClassName = self.categoryClasses.GetItemText(self.selCatClass) frameName = companion.designer.GetName() if catClassName i... |
methName = self.macroNameToEvtName(macName) catClassName = self.categoryClasses.GetItemText(self.selCatClass) frameName = companion.designer.GetName() if catClassName in commandCategories: wid = companion.getWinId() else: wid = None nv = self.getEvent(macName[4:]) if nv: self.addEvent(macName[4:], methName, wid) nv.i... | self.doAddEvent(catClassName, macName) | def OnMacroSelect(self, event): if self.selMacClass > -1: companion = self.inspector.selCmp macName = self.categoryMacros.GetItemText(self.selMacClass) methName = self.macroNameToEvtName(macName) catClassName = self.categoryClasses.GetItemText(self.selCatClass) frameName = companion.designer.GetName() if catClassName i... |
wxScrolledWindow.__init__(self, parent, -1, wxPoint(0, 0), wxPyDefaultSize, wxSUNKEN_BORDER) | wxScrolledWindow.__init__(self, parent, -1, wxPoint(0, 0), wxPyDefaultSize, wxSUNKEN_BORDER | wxTAB_TRAVERSAL) | def __init__(self, parent): wxScrolledWindow.__init__(self, parent, -1, wxPoint(0, 0), wxPyDefaultSize, wxSUNKEN_BORDER) |
wxDefaultPosition, wxSize(100, 1)) | wxDefaultPosition, wxSize(100, 1), style = wxTAB_TRAVERSAL) | def __init__(self, parent): wxScrolledWindow.__init__(self, parent, -1, wxPoint(0, 0), wxPyDefaultSize, wxSUNKEN_BORDER) |
self.panelValues = wxPanel(self.splitter, -1) | self.panelValues = wxPanel(self.splitter, -1, style = wxTAB_TRAVERSAL) | def __init__(self, parent): wxScrolledWindow.__init__(self, parent, -1, wxPoint(0, 0), wxPyDefaultSize, wxSUNKEN_BORDER) |
i.destroy() | i.destroy(true) | def cleanup(self): # XXX Does this always have to be inited here? self.prevSel = None #clean up for i in self.nameValues: i.destroy() self.nameValues = [] self.refreshSplitter() |
self.splitter.SetDimensions(0, 0, s.x, s.y) | wOffset, hOffset = self.GetViewStart() puw, puh = self.GetScrollPixelsPerUnit() if hOffset and len(self.nameValues) < s.y /hOffset: hOffset = 0 self.splitter.SetDimensions(wOffset * puw, hOffset * puh * -1, s.x, s.y) self.updateScrollbars(wOffset, hOffset) def updateScrollbars(self, wOffset, hOffset): height = len(sel... | def refreshSplitter(self): |
self.nameValues[idx].destroy(cancel) del self.nameValues[idx] deleted = deleted + 1 if idx + 1 < len(self.nameValues): | self.nameValues[idx].destroy(cancel) del self.nameValues[idx] deleted = deleted + 1 | def deleteNameValues(self, idx, count, cancel = false): # delete sub properties deleted = 0 if idx < len(self.nameValues): while (idx < len(self.nameValues)) and (deleted < count): if self.nameValues[idx] == self.prevSel: self.prevSel = None self.nameValues[idx].destroy(cancel) del self.nameValues[idx] deleted = delete... |
def OnEnter(self, event): for nv in self.nameValues: if nv.editing: nv.propEditor.inspectorPost(false) def OnUndo(self, event): pass def OnCrsUp(self, event): if len(self.nameValues) > 1: for idx in range(1, len(self.nameValues)): if self.nameValues[idx].editing: self.propertySelected(self.nameValues[idx-1]) break e... | def OnEnter(self, event): for nv in self.nameValues: if nv.editing: nv.propEditor.inspectorPost(false) | |
self.refreshSplitter() nameValue.propEditor.expanded = false def OnEnter(self, event): for nv in self.nameValues: if nv.editing: nv.propEditor.inspectorPost(false) def OnUndo(self, event): pass def OnCrsUp(self, event): if len(self.nameValues) > 1: for idx in range(1, len(self.nameValues)): if self.nameValues[i... | def collapse(self, nameValue): # delete all NameValues until the same indent, count them startIndent = nameValue.indent idx = nameValue.idx + 1 # Move deletion into method and use in removeEvent of EventWindow i = idx if i < len(self.nameValues): while (i < len(self.nameValues)) and \ (self.nameValues[i].indent > star... | |
def readObject(self, constrList): | def readObject(self, constrList): params = self.inspector.selCmp.constructor() paramNames = params.keys() paramNames.sort() compn = self.inspector.selCmp self.addParams(constrList, paramNames, compn, compn) self.refreshSplitter() def addParams(self, constrList, paramNames, compn, rootCompn, indent = 0, insIdx = -1): | def readObject(self, constrList): def findInConstrLst(name, constrList): for constr in constrList: if constr.name == name: return constr return None |
params = self.inspector.selCmp.constructor() paramNames = params.keys() paramNames.sort() | def findInConstrLst(name, constrList): for constr in constrList: if constr.name == name: return constr return None | |
self.addProp(param, propWrap) | self.addProp(param, compn, rootCompn, propWrap, indent) | def findInConstrLst(name, constrList): for constr in constrList: if constr.name == name: return constr return None |
self.addConstr(param) self.refreshSplitter() def addConstr(self, name): compn = self.inspector.selCmp | self.addConstr(param, compn, rootCompn, indent) def expand(self, nameValue): nv = self.nameValues[nameValue.idx] obj = nv.propValue compn = nv.propEditor.getSubCompanion()\ (nameValue.propName, self.inspector.selCmp.designer, self.inspector.selCmp, obj, nv.propEditor.propWrapper) propLst = compn.getPropList()['proper... | def findInConstrLst(name, constrList): for constr in constrList: if constr.name == name: return constr return None |
self.nameValues.insert(len(self.nameValues), ConstrNameValue(self, self.panelNames, self.panelValues, self.inspector.selCmp, self.inspector.selCmp, name, propWrap, len(self.nameValues), 0, | if insIdx == -1: insIdx = len(self.nameValues) self.nameValues.insert(insIdx, ConstrNameValue(self, self.panelNames, self.panelValues, compn, rootCompn, name, propWrap, insIdx, indent, | def addConstr(self, name): compn = self.inspector.selCmp props = compn.properties() if props.has_key(name): rType, getter, setter = props[name] propWrap = RTTI.PropertyWrapper(name, rType, getter, setter) else: propWrap = RTTI.PropertyWrapper(name, 'NoneRoute', None, None) self.nameValues.insert(len(self.nameValues), ... |
def addProp(self, name, propWrap): compn = self.inspector.selCmp self.nameValues.insert(len(self.nameValues), | def addProp(self, name, compn, rootCompn, propWrap, indent = 0, insIdx = -1, ownerPropEdit = None): if insIdx == -1: insIdx = len(self.nameValues) self.nameValues.insert(insIdx, | def addProp(self, name, propWrap): compn = self.inspector.selCmp self.nameValues.insert(len(self.nameValues), PropNameValue(self, self.panelNames, self.panelValues, compn, compn, name, propWrap, len(self.nameValues), 0, compn.getPropEditor(name), compn.getPropOptions(name), compn.getPropNames(name))) |
compn, compn, name, propWrap, len(self.nameValues), 0, | compn, rootCompn, name, propWrap, insIdx, indent, | def addProp(self, name, propWrap): compn = self.inspector.selCmp self.nameValues.insert(len(self.nameValues), PropNameValue(self, self.panelNames, self.panelValues, compn, compn, name, propWrap, len(self.nameValues), 0, compn.getPropEditor(name), compn.getPropOptions(name), compn.getPropNames(name))) |
compn.getPropNames(name))) | compn.getPropNames(name), ownerPropEdit)) | def addProp(self, name, propWrap): compn = self.inspector.selCmp self.nameValues.insert(len(self.nameValues), PropNameValue(self, self.panelNames, self.panelValues, compn, compn, name, propWrap, len(self.nameValues), 0, compn.getPropEditor(name), compn.getPropOptions(name), compn.getPropNames(name))) |
self.SetScrollbars(oiLineHeight, oiLineHeight, 0, height + 1) self.refreshSplitter() | self.refreshSplitter() | def readObject(self): |
sys.stdout = ShellEditor.PseudoFileOutStore() | sys.stdout = Utils.PseudoFileOutStore() | def getModelData(self): try: code = compile(self.model.data, self.model.filename, 'exec') except: oldOut = sys.stdout sys.stdout = ShellEditor.PseudoFileOutStore() try: print "''' Code does not compile\n\n Disassembly of Traceback:\n'''" try: dis.distb(sys.exc_info()[2]) except: print "''' Could not disassemble trac... |
def defaultAction(self): self.designer.inspector.props.getNameValue('Images').propEditor.edit(None) | def designTimeSource(self): return {'width': '16', 'height': '16'} | |
self.editors.update({'Bitmap': BitmapConstrPropEdit, 'Mask': BitmapConstrPropEdit}) | self.editors = {'Bitmap': BitmapConstrPropEdit, 'Mask': BitmapConstrPropEdit} | def __init__(self, name, designer, parentCompanion, ctrl): CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl) self.editors.update({'Bitmap': BitmapConstrPropEdit, 'Mask': BitmapConstrPropEdit}) from Views.CollectionEdit import ImageListCollectionEditor self.CollEditorFrame = ImageListCollectionEditor |
class AcceleratorTableDTC(ChoicesConstr, UtilityDTC): | class AcceleratorTableDTC(ChoicesConstr, NYIDTC): | def designTimeSource(self): return {} |
print 'ATCollectionDTC' | def SetName(self, oldName, newName): print 'ATCollectionDTC' CollectionDTC.SetName(self, oldName, newName) | |
class ImageListImagesCDTC(ImageListImagesConstr, CollectionDTC): wxDocs = HelpCompanions.wxImageListDocs propName = 'Images' displayProp = 'bitmap' indexProp = '(None)' insertionMethod = 'Add' deletionMethod = 'Remove' def __init__(self, name, designer, parentCompanion, ctrl): CollectionDTC.__init__(self, name, design... | def applyDesignTimeDefaults(self, params): return | |
print name, name[:4] | def designTimeDefaults(self, vals): dtd = {} for param in vals.keys(): if param == 'menu': name = vals[param] if name[:4] == 'self': dtd[param] = self.designer.objects[name[5:]][1] elif name == 'wxMenu()': dtd[param] = wxMenu() else: print name, name[:4] raise 'Invalid menu reference' else: try: dtd[param] = eval(vals[... | |
print 'MenuBarMenusCDTC.GetMenu' | def GetMenu(self): print 'MenuBarMenusCDTC.GetMenu' return self.textConstrLst[self.index].params['menu'] | |
print 'MenuBarMenusCDTC.SetMenu' | def SetMenu(self, value): print 'MenuBarMenusCDTC.SetMenu' self.textConstrLst[self.index].params['menu'] = value | |
print 'OwnedCollectionDTC' | def SetName(self, oldName, newName): print 'OwnedCollectionDTC' CollectionDTC.SetName(self, oldName, newName) | |
print 'redefined OwnedColl' | def SetName(self, oldName, newName): print 'OwnedCollectionDTC' CollectionDTC.SetName(self, oldName, newName) | |
print 'apply constraints', self.parentCompanion.control | def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons... | |
print 'appling constraints' | def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons... | |
print 'adtd', otherWin | def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons... | |
print 'setting attr', params | def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons... | |
print 'applied constraints' | def applyConstraints(self): nullConstr = ['wxUnconstrained'] print 'apply constraints', self.parentCompanion.control if self.inited and len(self.textConstrLst) >= 4: constraints = wxLayoutConstraints() validConstr = 0 for constrt in self.textConstrLst: if constrt.params['rel'] not in nullConstr: validConstr = validCons... | |
print 'append item' | def appendItem(self): print 'append item' if len(self.textConstrLst) == 4: raise 'Only 4 constraints allowed' ai = self.availableItems() if not ai: raise 'All constraints set' self.sourceObjName = '%s.%s'%(self.__class__.sourceObjName, ai[0]) OwnedCollectionDTC.appendItem(self) self.applyConstraints() | |
print 'applying', f, self.control | def deleteItem(self, idx): # remove from ctrl if self.deletionMethod != '(None)': f = RTTI.getFunction(self.control, self.deletionMethod) print 'applying', f, self.control apply(f, [self.control, idx]) del self.textConstrLst[idx] # renumber items following deleted one if self.indexProp != '(None)': for constr in self.... | |
print 'adtd', otherWin | def applyDesignTimeDefaults(self, params): return attr = getattr(self.constraints, string.split(self.textConstrLst[self.index].comp_name, '.')[1]) params = copy.copy(params) otherWin = params['otherWin'][5:] print 'adtd', otherWin if params['otherWin'] == 'None': params = self.designTimeDefaults(params) elif self.desi... | |
print 'setting attr', params | def applyDesignTimeDefaults(self, params): return attr = getattr(self.constraints, string.split(self.textConstrLst[self.index].comp_name, '.')[1]) params = copy.copy(params) otherWin = params['otherWin'][5:] print 'adtd', otherWin if params['otherWin'] == 'None': params = self.designTimeDefaults(params) elif self.desi... | |
print 'GetEdge', self.index, self.textConstrLst | def GetEdge(self): print 'GetEdge', self.index, self.textConstrLst return self.textConstrLst[self.index].comp_name | |
print 'INITCOLLECTION' | def initCollection(self): print 'INITCOLLECTION' self.inited = true self.applyConstraints() | |
otherApp = AppModel('', self.compareTo, '', self.model.editor, true) | otherApp = AppModel('', self.compareTo, '', self.model.editor, true, {}) | def refreshCtrl(self): ListCtrlView.refreshCtrl(self) from EditorModels import AppModel otherApp = AppModel('', self.compareTo, '', self.model.editor, true) otherApp.load() otherApp.readModules() i = 0 |
if not cmp(self.model.moduleFilename(module), otherFile): i = self.addReportItems(i, module, otherFile, 'changed') | try: if not cmp(self.model.moduleFilename(module), otherFile): i = self.addReportItems(i, module, otherFile, 'changed') except OSError: pass | def refreshCtrl(self): ListCtrlView.refreshCtrl(self) from EditorModels import AppModel otherApp = AppModel('', self.compareTo, '', self.model.editor, true) otherApp.load() otherApp.readModules() i = 0 |
'wxWidht', 'wxCentreX', 'wxCentreY'] | 'wxWidth', 'wxCentreX', 'wxCentreY'] | def reverseDict(dict): rev = {} for k in dict.keys(): rev[dict[k]] = k return rev |
('Attach to debugger', self.OnAttachToDebugger, '-', ''), | def actions(self, model): actions = [ ('-', None, '', ''), ('Import module into Shell', self.OnImportInShell, '-', ''), ('Reload module in Shell', self.OnReloadInShell, '-', ''), ('-', None, '', ''), ('Set command-line parameters', self.OnSetRunParams, '-', ''), ('Run application', self.OnRunApp, self.runAppBmp, 'RunAp... | |
actions.extend([ ('NDiff modules...', self.OnDiffModules, '-', ''), ('Run PyChecker', self.OnRunPyChecker, '-', ''), ('Configure PyChecker', self.OnConfigPyChecker, '-', '')]) | try: imp.find_module('pychecker') except ImportError: pass else: actions.extend([ ('Run PyChecker', self.OnRunPyChecker, '-', ''), ('Configure PyChecker', self.OnConfigPyChecker, '-', '')]) | def actions(self, model): actions = [ ('-', None, '', ''), ('Import module into Shell', self.OnImportInShell, '-', ''), ('Reload module in Shell', self.OnReloadInShell, '-', ''), ('-', None, '', ''), ('Set command-line parameters', self.OnSetRunParams, '-', ''), ('Run application', self.OnRunApp, self.runAppBmp, 'RunAp... |
wxMessageBox('Stats file date unchanged!') | wxLogError('Stats file date unchanged, check for errors in script.') | def OnProfile(self, event): model = self.getModel() if self.checkUnsaved(model): return |
wxMessageBox('Stats file not found') | wxLogError('Stats file not found, check for errors in script.') | def OnProfile(self, event): model = self.getModel() if self.checkUnsaved(model): return |
def OnDiffModules(self, event=None, filename=''): model = self.getModel() if model: if self.checkUnsaved(model): return if not filename: filename = self.editor.openFileDlg() if filename: filename = model.assertLocalFile(filename) tbName = 'Diff with : '+filename if not model.views.has_key(tbName): from Views.DiffView i... | def OnSwitchApp(self, event): model = self.getModel() if model and isinstance(model, PythonEditorModels.ModuleModel) and model.app: # does this ensure correct app is reconnected? appmodel, controller = self.editor.openOrGotoModule(model.app.filename) | |
import shutil shutil.copyfile(os.path.join(Preferences.pyPath, 'ExternalLib', 'PyChecker', 'pycheckrc'), appConfig) | from pychecker import Config open(appConfig, 'w').write(Config.outputRc(Config.Config())) | def OnConfigPyChecker(self, event): model = self.getModel() if model: home = os.environ.get('HOME') if home: appDir = home appConfig = home+'/.pycheckrc' else: filename = model.assertLocalFile() appDir = os.path.dirname(filename) appConfig = appDir+'/.pycheckrc' if not os.path.exists(appConfig): dlg = wxMessageDialog(s... |
def OnAttachToDebugger(self, event): from Debugger.RemoteDialog import create rmtDlg = create(self.editor) rmtDlg.ShowModal() rmtDlg.Destroy() | def OnTabNanny(self, event): model = self.getModel() if model: model.tabnanny() | |
Controllers.DefaultController = ModuleController Controllers.DefaultModel = PythonEditorModels.ModuleModel Controllers.defaultExt = PythonEditorModels.ModuleModel.ext | def OnSetupPy2Exe(self, event): self.runDistUtilsCmd('py2exe') | |
FileExplorer.PyFileNode.subExplorerReg['folder'].append( (FileExplorer.PyFileNode, isPackage, PythonEditorModels.PackageModel.imgIdx), | FileExplorer.FileSysNode.subExplorerReg['folder'].append( (FileExplorer.FileSysNode, isPackage, PythonEditorModels.PackageModel.imgIdx), | def isPackage(filename): return os.path.exists(os.path.join(filename, PythonEditorModels.PackageModel.pckgIdnt)) |
return FileExplorer.PyFileNode(os.path.basename(defaultDir), defaultDir, | return FileExplorer.FileSysNode(os.path.basename(defaultDir), defaultDir, | def newFileNode(self, defaultDir): return FileExplorer.PyFileNode(os.path.basename(defaultDir), defaultDir, None, EditorHelper.imgFolder, None, None) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.