rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
if node.__class__ == dri.DRIConfig:
elif node.__class__ == dri.DRIConfig:
def selectionChangedSignal (self, data): node = self.getSelection (allowNone=TRUE) if not node: driver = None app = None elif node.__class__ == dri.AppConfig: app = node try: driver = app.device.getDriver (dpy) except dri.XMLError, problem: driver = None dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_...
type, config = self.node_get_row_data (node)
type, obj = self.node_get_row_data (node)
def doReloadConfig (self, reallyReload="dunno"): if reallyReload == "No": return try: node = self.getSelection() except SelectionError: return type, config = self.node_get_row_data (node) if type == "app": config = config.device type = "device" if type == "device": config = config.config type = "config" if reallyReload...
config = config.device type = "device" if type == "device": config = config.config type = "config"
config = obj.device.config elif type == "device": config = obj.config
def doReloadConfig (self, reallyReload="dunno"): if reallyReload == "No": return try: node = self.getSelection() except SelectionError: return type, config = self.node_get_row_data (node) if type == "app": config = config.device type = "device" if type == "device": config = config.config type = "config" if reallyReload...
self.adjConn = self.adjustment.connect ("value_changed", self.callback)
self.adjConn = self.adjustment.connect ("value-changed", self.callback)
def setValue (self, value): self.adjustment.disconnect (self.adjConn) self.adjustment.set_value (value) self.adjConn = self.adjustment.connect ("value_changed", self.callback)
def __init__ (self, label, justify=gtk.JUSTIFY_LEFT, wrap=TRUE,
def __init__ (self, label, justify=gtk.JUSTIFY_LEFT, wrap=True,
def __init__ (self, label, justify=gtk.JUSTIFY_LEFT, wrap=TRUE, width=-1, height=-1): """ Constructor. """ gtk.CheckButton.__init__ (self) checkHBox = gtk.HBox() self.text = escapeMarkup (label) self.label = gtk.Label(label) self.label.set_justify (justify) self.label.set_line_wrap (wrap) self.label.set_size_request (w...
checkHBox.pack_start (self.label, FALSE, FALSE, 0)
checkHBox.pack_start (self.label, False, False, 0)
def __init__ (self, label, justify=gtk.JUSTIFY_LEFT, wrap=TRUE, width=-1, height=-1): """ Constructor. """ gtk.CheckButton.__init__ (self) checkHBox = gtk.HBox() self.text = escapeMarkup (label) self.label = gtk.Label(label) self.label.set_justify (justify) self.label.set_line_wrap (wrap) self.label.set_size_request (w...
wrap=TRUE, width=-1, height=-1):
wrap=True, width=-1, height=-1):
def __init__ (self, optValList, callback, justify=gtk.JUSTIFY_LEFT, wrap=TRUE, width=-1, height=-1): """ Constructor. """ gtk.Button.__init__ (self) self.callback = callback self.optDict = {} self.valDict = {} for opt,val in optValList: self.optDict[opt] = val self.valDict[val] = opt firstOpt,firstVal = optValList[len(...
hbox.pack_start (self.label, TRUE, FALSE, 5) hbox.pack_start (arrow, FALSE, FALSE, 0)
hbox.pack_start (self.label, True, False, 5) hbox.pack_start (arrow, False, False, 0)
def __init__ (self, optValList, callback, justify=gtk.JUSTIFY_LEFT, wrap=TRUE, width=-1, height=-1): """ Constructor. """ gtk.Button.__init__ (self) self.callback = callback self.optDict = {} self.valDict = {} for opt,val in optValList: self.optDict[opt] = val self.valDict[val] = opt firstOpt,firstVal = optValList[len(...
return TRUE else: return FALSE
return True else: return False
def buttonPress (self, widget, event): """ Popup the menu. """ if event.type == gtk.gdk.BUTTON_PRESS: self.menu.popup(None, None, None, event.button, event.time) return TRUE else: return FALSE
self.spinner.set_numeric (TRUE)
self.spinner.set_numeric (True)
def __init__ (self, callback, lower, upper, integer): gtk.VBox.__init__ (self) diff = upper - lower self.isInteger = integer if integer: step = 1 page = (diff+4) / 5 self.digits = 0 else: self.digits = -int(math.floor(math.log10(diff) + 0.5)) + 3 step = math.pow(10, -self.digits + 1) page = step * 10 if self.digits < 0...
self.pack_start (self.spinner, FALSE, FALSE, 0)
self.pack_start (self.spinner, False, False, 0)
def __init__ (self, callback, lower, upper, integer): gtk.VBox.__init__ (self) diff = upper - lower self.isInteger = integer if integer: step = 1 page = (diff+4) / 5 self.digits = 0 else: self.digits = -int(math.floor(math.log10(diff) + 0.5)) + 3 step = math.pow(10, -self.digits + 1) page = step * 10 if self.digits < 0...
self.slider.set_draw_value (FALSE)
self.slider.set_draw_value (False)
def __init__ (self, callback, lower, upper, integer): gtk.VBox.__init__ (self) diff = upper - lower self.isInteger = integer if integer: step = 1 page = (diff+4) / 5 self.digits = 0 else: self.digits = -int(math.floor(math.log10(diff) + 0.5)) + 3 step = math.pow(10, -self.digits + 1) page = step * 10 if self.digits < 0...
self.pack_start (self.slider, FALSE, FALSE, 0)
self.pack_start (self.slider, False, False, 0)
def __init__ (self, callback, lower, upper, integer): gtk.VBox.__init__ (self) diff = upper - lower self.isInteger = integer if integer: step = 1 page = (diff+4) / 5 self.digits = 0 else: self.digits = -int(math.floor(math.log10(diff) + 0.5)) + 3 step = math.pow(10, -self.digits + 1) page = step * 10 if self.digits < 0...
self.isValid = FALSE
self.isValid = False
def __init__ (self, page, i, opt): """ Constructor. """ self.page = page self.opt = opt typeString = opt.type if opt.valid: typeString = typeString+" ["+ \ reduce(lambda x,y: x+','+y, map(str,opt.valid))+"]" # a check button with an option description desc = opt.getDesc([lang]) if desc != None: desc = desc.text else: d...
self.isValid = TRUE
self.isValid = True
def __init__ (self, page, i, opt): """ Constructor. """ self.page = page self.opt = opt typeString = opt.type if opt.valid: typeString = typeString+" ["+ \ reduce(lambda x,y: x+','+y, map(str,opt.valid))+"]" # a check button with an option description desc = opt.getDesc([lang]) if desc != None: desc = desc.text else: d...
self.widget.set_use_stock (TRUE)
self.widget.set_use_stock (True)
def initWidget (self, opt, value): """ Initialize the option widget.
opt.valid[0].end, TRUE)
opt.valid[0].end, True)
def initWidget (self, opt, value): """ Initialize the option widget.
opt.valid[0].end, FALSE)
opt.valid[0].end, False)
def initWidget (self, opt, value): """ Initialize the option widget.
self.widget.set_sensitive (TRUE) self.resetButton.set_sensitive (TRUE) else: self.widget.set_sensitive (FALSE) self.resetButton.set_sensitive (FALSE)
self.widget.set_sensitive (True) self.resetButton.set_sensitive (True) else: self.widget.set_sensitive (False) self.resetButton.set_sensitive (False)
def checkOpt (self, widget): """ Handler for 'check button (maybe) toggled'. """ if self.check.get_active(): self.widget.set_sensitive (TRUE) self.resetButton.set_sensitive (TRUE) else: self.widget.set_sensitive (FALSE) self.resetButton.set_sensitive (FALSE) if not self.isValid: self.highlightInvalid() self.page.doVali...
self.updateWidget (self.opt.default, TRUE)
self.updateWidget (self.opt.default, True)
def resetOpt (self, widget): """ Reset to default value. """ self.updateWidget (self.opt.default, TRUE) self.page.optionModified (self)
self.doValidate (init=TRUE)
self.doValidate (init=True)
def __init__ (self, optSection, app): """ Constructor. """ gtk.ScrolledWindow.__init__ (self) self.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.optSection = optSection self.app = app self.tooltips = gtk.Tooltips() self.table = gtk.Table (len(optSection.optList), 3) self.optLines = [] for i in range (len...
def doValidate (self, init=FALSE):
def doValidate (self, init=False):
def doValidate (self, init=FALSE): """ Validate the widget settings.
valid = TRUE
valid = True
def doValidate (self, init=FALSE): """ Validate the widget settings.
valid = FALSE
valid = False
def doValidate (self, init=FALSE): """ Validate the widget settings.
self.view.set_rules_hint (TRUE)
self.view.set_rules_hint (True)
def __init__ (self, driver, app): """ Constructor. """ gtk.VBox.__init__ (self) scrolledWindow = gtk.ScrolledWindow () scrolledWindow.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.app = app self.driver = driver # copy options (dict function does not exist in Python 2.1 :( ) opts = {} for name,val in app....
0, str(name), 1, str(val), 2, TRUE)
0, str(name), 1, str(val), 2, True)
def __init__ (self, driver, app): """ Constructor. """ gtk.VBox.__init__ (self) scrolledWindow = gtk.ScrolledWindow () scrolledWindow.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.app = app self.driver = driver # copy options (dict function does not exist in Python 2.1 :( ) opts = {} for name,val in app....
self.pack_start (scrolledWindow, TRUE, TRUE, 0)
self.pack_start (scrolledWindow, True, True, 0)
def __init__ (self, driver, app): """ Constructor. """ gtk.VBox.__init__ (self) scrolledWindow = gtk.ScrolledWindow () scrolledWindow.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.app = app self.driver = driver # copy options (dict function does not exist in Python 2.1 :( ) opts = {} for name,val in app....
buttonBox.set_child_secondary (helpButton, TRUE)
buttonBox.set_child_secondary (helpButton, True)
def __init__ (self, driver, app): """ Constructor. """ gtk.VBox.__init__ (self) scrolledWindow = gtk.ScrolledWindow () scrolledWindow.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.app = app self.driver = driver # copy options (dict function does not exist in Python 2.1 :( ) opts = {} for name,val in app....
self.pack_start (buttonBox, FALSE, FALSE, 0)
self.pack_start (buttonBox, False, False, 0)
def __init__ (self, driver, app): """ Constructor. """ gtk.VBox.__init__ (self) scrolledWindow = gtk.ScrolledWindow () scrolledWindow.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.app = app self.driver = driver # copy options (dict function does not exist in Python 2.1 :( ) opts = {} for name,val in app....
return TRUE
return True
def validate (self): """ These options can't be validated. """ return TRUE
self.store.set (self.store.append(), 0, str(name), 1, str(val), 2, TRUE)
self.store.set (self.store.append(), 0, str(name), 1, str(val), 2, True)
def newSetting (self, widget): """ Create a new setting. Choose a unique option name, that is unknown to the driver. """ name = "option" val = "" i = 0 while self.app.options.has_key(name) or \ self.driverOpts.has_key(name): i = i + 1 name = "option%d" % i self.app.options[name] = val self.opts.append (name) self.store...
self.store.set (cursor, 0, str(name), 1, str(newVal), 2, TRUE)
self.store.set (cursor, 0, str(name), 1, str(newVal), 2, True)
def editedSignal (self, widget, row, newVal, value): row = int(row) name = self.opts[row] cursor = self.store.get_iter_first() for i in range(row): cursor = self.store.iter_next (cursor) if value: if self.app.options[name] == newVal: return self.app.options[name] = newVal self.store.set (cursor, 0, str(name), 1, str(ne...
self.store.set (cursor, 0, str(name), 1, str(val), 2, TRUE)
self.store.set (cursor, 0, str(name), 1, str(val), 2, True)
def editedSignal (self, widget, row, newVal, value): row = int(row) name = self.opts[row] cursor = self.store.get_iter_first() for i in range(row): cursor = self.store.iter_next (cursor) if value: if self.app.options[name] == newVal: return self.app.options[name] = newVal self.store.set (cursor, 0, str(name), 1, str(ne...
self.execCheck.set_active (TRUE)
self.execCheck.set_active (True)
def __init__ (self, driver, app): """ Constructor. """ gtk.Frame.__init__ (self) frameLabel = gtk.Label() frameLabel.set_markup ("<b>" + escapeMarkup( _("Application")+": "+app.name) + "</b>") frameLabel.show() self.set_label_widget (frameLabel) self.driver = driver self.app = app tooltips = gtk.Tooltips() table = gtk....
allValid = TRUE
allValid = True
def validate (self): """ Validate the configuration.
commentLabel.set_line_wrap (TRUE)
commentLabel.set_line_wrap (True)
def __init__ (self, title, callback, name, data): gtk.Dialog.__init__ (self, title, mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_MODAL, (gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) self.callback = callback self.data = data self.connect ("response", self.responseSignal) table = gtk.Ta...
self.vbox.pack_start (table, TRUE, TRUE, 5)
self.vbox.pack_start (table, True, True, 5)
def __init__ (self, title, callback, name, data): gtk.Dialog.__init__ (self, title, mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_MODAL, (gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) self.callback = callback self.data = data self.connect ("response", self.responseSignal) table = gtk.Ta...
commentLabel.set_line_wrap (TRUE)
commentLabel.set_line_wrap (True)
def __init__ (self, title, callback, data): gtk.Dialog.__init__ (self, title, mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_MODAL, (gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) self.callback = callback self.data = data self.connect ("response", self.responseSignal) table = gtk.Table (2...
self.vbox.pack_start (table, TRUE, TRUE, 5)
self.vbox.pack_start (table, True, True, 5)
def __init__ (self, title, callback, data): gtk.Dialog.__init__ (self, title, mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_MODAL, (gtk.STOCK_OK, gtk.RESPONSE_OK, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) self.callback = callback self.data = data self.connect ("response", self.responseSignal) table = gtk.Table (2...
def nodeModified (self, node, b=TRUE):
def nodeModified (self, node, b=True):
def nodeModified (self, node, b=TRUE): if node.__class__ == dri.DRIConfig: config = node elif node.__class__ == dri.DeviceConfig: config = node.config elif node.__class__ == dri.AppConfig: config = node.device.config if config.isModified != b: config.isModified = b curNode = mainWindow.configTree.getSelection (allowNon...
curNode = mainWindow.configTree.getSelection (allowNone=TRUE)
curNode = mainWindow.configTree.getSelection (allowNone=True)
def nodeModified (self, node, b=TRUE): if node.__class__ == dri.DRIConfig: config = node elif node.__class__ == dri.DeviceConfig: config = node.config elif node.__class__ == dri.AppConfig: config = node.device.config if config.isModified != b: config.isModified = b curNode = mainWindow.configTree.getSelection (allowNon...
node.isModified = FALSE
node.isModified = False
def initNode (self, node): node.modified = self.nodeModified if node.__class__ == dri.DRIConfig: node.isModified = FALSE for device in node.devices: self.initNode (device) elif node.__class__ == dri.DeviceConfig: for app in node.apps: self.initNode (app) elif node.__class__ == dri.AppConfig: self.validateAppNode (node)
app.isValid = FALSE else: app.isValid = TRUE
app.isValid = False else: app.isValid = True
def validateAppNode (self, app): try: driver = app.device.getDriver(dpy) except dri.XMLError: driver = None if driver and not driver.validate (app.options): app.isValid = FALSE else: app.isValid = TRUE
self.set_headers_visible (FALSE)
self.set_headers_visible (False)
def __init__ (self, configList): self.model = ConfigTreeModel (configList) gtk.TreeView.__init__ (self, self.model) self.model.renderIcons (self) self.connect ("style-set", lambda widget, prevStyle: self.model.renderIcons (widget)) self.set_size_request (200, -1) self.set_headers_visible (FALSE) self.expand_all() self....
column.pack_start (renderPixbuf, expand=FALSE)
column.pack_start (renderPixbuf, expand=False)
def __init__ (self, configList): self.model = ConfigTreeModel (configList) gtk.TreeView.__init__ (self, self.model) self.model.renderIcons (self) self.connect ("style-set", lambda widget, prevStyle: self.model.renderIcons (widget)) self.set_size_request (200, -1) self.set_headers_visible (FALSE) self.expand_all() self....
column.pack_start (renderText, expand=TRUE)
column.pack_start (renderText, expand=True)
def __init__ (self, configList): self.model = ConfigTreeModel (configList) gtk.TreeView.__init__ (self, self.model) self.model.renderIcons (self) self.connect ("style-set", lambda widget, prevStyle: self.model.renderIcons (widget)) self.set_size_request (200, -1) self.set_headers_visible (FALSE) self.expand_all() self....
def getSelection (self, allowNone=FALSE):
def getSelection (self, allowNone=False):
def getSelection (self, allowNone=FALSE): model, iter = self.get_selection().get_selected() assert iter or allowNone if iter: path = self.model.get_path (iter) return self.model.getNodeFromPath (path) else: return None
self.scroll_to_cell (path=path, use_align=FALSE)
self.scroll_to_cell (path=path, use_align=False)
def selectFirstWritableApp (self): app = self.model.findFirstWritableApp() if app: path = self.model.getPathFromNode (app) self.get_selection().select_path (path) self.scroll_to_cell (path=path, use_align=FALSE)
node = self.getSelection (allowNone=TRUE)
node = self.getSelection (allowNone=True)
def selectionChangedSignal (self, data): node = self.getSelection (allowNone=TRUE) if not node: driver = None app = None elif node.__class__ == dri.AppConfig: app = node try: driver = app.device.getDriver (dpy) except dri.XMLError, problem: driver = None dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_...
assert FALSE
assert False
def removeItem (self, widget): node = self.getSelection() if node.__class__ == dri.AppConfig: parent = node.device dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("Really delete application \"%s\"?") % node.name) elif node.__class__ == dri.DeviceConfi...
self.scroll_to_cell (path=path, use_align=FALSE)
self.scroll_to_cell (path=path, use_align=False)
def removeItem (self, widget): node = self.getSelection() if node.__class__ == dri.AppConfig: parent = node.device dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("Really delete application \"%s\"?") % node.name) elif node.__class__ == dri.DeviceConfi...
valid = TRUE
valid = True
def saveConfig (self, widget): node = self.getSelection() if node.__class__ == dri.AppConfig: config = node.device.config elif node.__class__ == dri.DeviceConfig: config = node.config elif node.__class__ == dri.DRIConfig: config = node valid = TRUE for device in config.devices: try: driver = device.getDriver (dpy) exce...
config.modified(config, FALSE)
config.modified(config, False)
def saveConfig (self, widget): node = self.getSelection() if node.__class__ == dri.AppConfig: config = node.device.config elif node.__class__ == dri.DeviceConfig: config = node.config elif node.__class__ == dri.DRIConfig: config = node valid = TRUE for device in config.devices: try: driver = device.getDriver (dpy) exce...
self.expand_row (path, TRUE)
self.expand_row (path, True)
def reloadConfig (self, widget): node = self.getSelection() if node.__class__ == dri.AppConfig: config = node.device.config elif node.__class__ == dri.DeviceConfig: config = node.config else: config = node dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO,...
self.scroll_to_cell (path=path, use_align=FALSE)
self.scroll_to_cell (path=path, use_align=False)
def reloadConfig (self, widget): node = self.getSelection() if node.__class__ == dri.AppConfig: config = node.device.config elif node.__class__ == dri.DeviceConfig: config = node.config else: config = node dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO,...
assert FALSE
assert False
def moveItem (self, inc): node = self.getSelection() if node.__class__ == dri.AppConfig: parent = node.device siblings = parent.apps elif node.__class__ == dri.DeviceConfig: parent = node.config siblings = parent.devices else: assert FALSE index = siblings.index (node) newIndex = index+inc if newIndex < 0 or newIndex >...
self.scroll_to_cell (path=path, use_align=FALSE)
self.scroll_to_cell (path=path, use_align=False)
def moveItem (self, inc): node = self.getSelection() if node.__class__ == dri.AppConfig: parent = node.device siblings = parent.apps elif node.__class__ == dri.DeviceConfig: parent = node.config siblings = parent.devices else: assert FALSE index = siblings.index (node) newIndex = index+inc if newIndex < 0 or newIndex >...
self.expand_row (self.model.getPathFromNode(device), TRUE)
self.expand_row (self.model.getPathFromNode(device), True)
def newAppCallback (self, name, device): app = dri.AppConfig (device, name) self.model.addNode (app) if len(device.apps) == 1: self.expand_row (self.model.getPathFromNode(device), TRUE) device.modified(device) path = self.model.getPathFromNode (app) self.get_selection().select_path (path) self.scroll_to_cell (path=path...
self.scroll_to_cell (path=path, use_align=FALSE)
self.scroll_to_cell (path=path, use_align=False)
def newAppCallback (self, name, device): app = dri.AppConfig (device, name) self.model.addNode (app) if len(device.apps) == 1: self.expand_row (self.model.getPathFromNode(device), TRUE) device.modified(device) path = self.model.getPathFromNode (app) self.get_selection().select_path (path) self.scroll_to_cell (path=path...
self.scroll_to_cell (path=path, use_align=FALSE)
self.scroll_to_cell (path=path, use_align=False)
def newDeviceCallback (self, screen, driver, config): device = dri.DeviceConfig (config, screen, driver) self.model.addNode (device) config.modified(config) path = self.model.getPathFromNode (device) self.get_selection().select_path (path) self.scroll_to_cell (path=path, use_align=FALSE)
self.vbox.pack_start (self.toolbar, FALSE, TRUE, 0) self.vbox.pack_start (self.paned, TRUE, TRUE, 0)
self.vbox.pack_start (self.toolbar, False, True, 0) self.vbox.pack_start (self.paned, True, True, 0)
def __init__ (self, configList): gtk.Window.__init__ (self) self.set_title ("DRIconf") self.connect ("destroy", lambda dummy: gtk.main_quit()) self.connect ("delete_event", self.exitHandler) self.vbox = gtk.VBox() self.paned = gtk.HPaned() self.configTree = ConfigTreeView (configList) self.configTree.show() scrolledWin...
self.saveButton .set_sensitive (FALSE) self.reloadButton .set_sensitive (FALSE) self.newButton .set_sensitive (FALSE) self.removeButton .set_sensitive (FALSE) self.upButton .set_sensitive (FALSE) self.downButton .set_sensitive (FALSE) self.propertiesButton.set_sensitive (FALSE)
self.saveButton .set_sensitive (False) self.reloadButton .set_sensitive (False) self.newButton .set_sensitive (False) self.removeButton .set_sensitive (False) self.upButton .set_sensitive (False) self.downButton .set_sensitive (False) self.propertiesButton.set_sensitive (False)
def deactivateButtons (self): self.saveButton .set_sensitive (FALSE) self.reloadButton .set_sensitive (FALSE) self.newButton .set_sensitive (FALSE) self.removeButton .set_sensitive (FALSE) self.upButton .set_sensitive (FALSE) self.downButton .set_sensitive (FALSE) self.propertiesButton.set_...
self.reloadButton .set_sensitive (TRUE)
self.reloadButton .set_sensitive (True)
def activateConfigButtons (self, config): writable = config.writable modified = config.isModified self.saveButton .set_sensitive (writable and modified) self.reloadButton .set_sensitive (TRUE) self.newButton .set_sensitive (writable) self.removeButton .set_sensitive (FALSE) self.upButton .set_se...
self.removeButton .set_sensitive (FALSE) self.upButton .set_sensitive (FALSE) self.downButton .set_sensitive (FALSE) self.propertiesButton.set_sensitive (FALSE)
self.removeButton .set_sensitive (False) self.upButton .set_sensitive (False) self.downButton .set_sensitive (False) self.propertiesButton.set_sensitive (False)
def activateConfigButtons (self, config): writable = config.writable modified = config.isModified self.saveButton .set_sensitive (writable and modified) self.reloadButton .set_sensitive (TRUE) self.newButton .set_sensitive (writable) self.removeButton .set_sensitive (FALSE) self.upButton .set_se...
self.reloadButton .set_sensitive (TRUE)
self.reloadButton .set_sensitive (True)
def activateDeviceButtons (self, device): writable = device.config.writable modified = device.config.isModified self.saveButton .set_sensitive (writable and modified) self.reloadButton .set_sensitive (TRUE) self.newButton .set_sensitive (writable) self.removeButton .set_sensitive (writable) self.upButt...
self.reloadButton .set_sensitive (TRUE)
self.reloadButton .set_sensitive (True)
def activateAppButtons (self, app): writable = app.device.config.writable modified = app.device.config.isModified self.saveButton .set_sensitive (writable and modified) self.reloadButton .set_sensitive (TRUE) self.newButton .set_sensitive (writable) self.removeButton .set_sensitive (writable) self.upBu...
modified = FALSE
modified = False
def exitHandler (self, widget, event=None): modified = FALSE for config in self.configTree.getConfigList(): if config.isModified: modified = TRUE break if modified: dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("There are unsaved mo...
modified = TRUE
modified = True
def exitHandler (self, widget, event=None): modified = FALSE for config in self.configTree.getConfigList(): if config.isModified: modified = TRUE break if modified: dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("There are unsaved mo...
return TRUE
return True
def exitHandler (self, widget, event=None): modified = FALSE for config in self.configTree.getConfigList(): if config.isModified: modified = TRUE break if modified: dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("There are unsaved mo...
return FALSE
return False
def exitHandler (self, widget, event=None): modified = FALSE for config in self.configTree.getConfigList(): if config.isModified: modified = TRUE break if modified: dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("There are unsaved mo...
self.re_header_name_comment = re.compile(r"^\s*//\s*boost\s+(mpl(/\w+)+\.hpp)\s+header\s+file\s*$")
self.re_header_name_comment = re.compile(r"^\s*//\s+\+\s+file:\s+(boost/mpl(/\w+)+\.hpp)s*$")
def __init__(self, name): self.output = open(name, "w") self.prev_line = ''
"// preprocessed version of 'boost/%s' header\n"\
"// preprocessed version of '%s' header\n"\
def process(self, line):
self.re_templ_args = re.compile(r'(\s*)(, | {2})((\s*(\w+)(\s+|::)\w+\s*.*?,?)+)\s*$')
self.re_templ_args = re.compile(r'^(\s*)(, | {2})((\s*(\w+)(\s+|::)\w+\s*.*?,?)+)\s*$')
self.re_typedef = re.compile(r'^\s+typedef\s+.*?;$')
self.re_header_name_comment = re.compile( r'^\s*//\s+\$[S]ource: /cvsroot/boost/boost/(.*),v\s*\$$' )
self.re_header_name_comment = re.compile( r'^\s*//\s+\$[S]ource: /cvsroot/boost/boost/(.*?%s\.hpp),v\s*\$$' % os.path.splitext( name )[0] )
def __init__(self, name): self.output = open(name, "w") self.prev_line = ''
if not self.header_was_written and self.re_header_name_comment.match( line ): self.header_was_written = 1 match = self.re_header_name_comment.match( line ) self.output.write( \ '\n%s\n' \ '// Preprocessed version of "%s" header\n' \ '// -- DO NOT modify by hand!\n\n' \ % ( self.copyright, match.group(1) ) )
if not self.header_was_written: if self.re_header_name_comment.match( line ): self.header_was_written = 1 match = self.re_header_name_comment.match( line ) self.output.write( \ '\n%s\n' \ '// Preprocessed version of "%s" header\n' \ '// -- DO NOT modify by hand!\n\n' \ % ( self.copyright, match.group(1) ) )
def process(self, line): if self.reading_copyright: if not self.re_copyright_end.match( line ): self.copyright += line return
self.re_assign = re.compile(r'([^<|^!|^>])\s*(=+)\s*')
self.re_assign = re.compile(r'(\S+[^<|^!|^>])\s*(=+)\s*(\S+)')
def __init__(self, name): self.output = open(name, "w") self.prev_line = ''
self.re_static_const = re.compile(r'(\s*)((static\s+.*?|enum\s*\w*\s*{\s*)value\s*=)(.*?)(}?;)$')
self.re_static_const = re.compile(r'(\s*)((BOOST_STATIC_CONSTANT\(\s*\w+,\s*|enum\s*\w*\s*{\s*)value\s*=)(.*?)([}|\)];)$')
self.re_typedef = re.compile(r'^\s+typedef\s+.*?;$')
line = self.re_assign.sub( r'\1 \2 ', line )
line = self.re_assign.sub( r'\1 \2 \3', line )
def process(self, line): if self.reading_copyright: if not self.re_copyright_end.match( line ): self.copyright += line return
["msvc60", "msvc70", "bcc", "bcc551", "gcc", "mwcw", "no_ctps", "plain"]
["bcc", "bcc551", "gcc", "msvc60", "msvc70", "mwcw", "no_ctps", "no_ttp", "plain"]
def main( all_modes, src_dir, dst_dir ): if len( sys.argv ) < 2: print "\nUsage:\n\t %s <mode> <boost_root> [<source_file>]" % os.path.basename( sys.argv[0] ) print "\nPurpose:\n\t updates preprocessed version(s) of the header(s) in \"%s\" directory" % dst_dir print "\nExample:\n\t the following command will re-generat...
atom_counts[ val ] += 1
atom_counts[ int( val ) ] += 1
def run( ts_fnames, out_dir, format, align_count, atom_mapping, mapping, modname, modorder ): samp_size_collapse = 30 samp_size_expand = 10 if mpi: # Startup pypar and get some info about what node we are import pypar nodes = pypar.size() node_id = pypar.rank() print "I am node %d of %d" % ( node_id, nodes ) # Modif...
global mpi
global mpi, node_id
def message( *args ): """ Write a message to stderr (but only on the master node if we are using pypar) """ global mpi if not mpi or node_id == 0: sys.stderr.write( ' '.join( map( str, args ) ) ) sys.stderr.write( '\n' ) sys.stderr.flush()
import pypar
pypar = __import__( 'pypar' )
def run( ts_fnames, out_dir, format, align_count, atom_mapping, mapping, modname, modorder ): samp_size_collapse = 30 samp_size_expand = 10 if mpi: # Startup pypar and get some info about what node we are import pypar nodes = pypar.size() node_id = pypar.rank() print "I am node %d of %d" % ( node_id, nodes ) # Modif...
msg = _(u'Tools successullfy renamed.')
msg = _(u'Tools successfully renamed.')
def update(self): """ """ msg = u'' if "INSTALL-SUBMIT" in self.request: self.install() msg = _(u'Tools successufully installed.') if "UNINSTALL-SUBMIT" in self.request: self.uninstall() msg = _(u'Tools successufully uninstalled.') if "ADD-TOOL-SUBMIT" in self.request: self.action(self.request['type_name'], self.reques...
... if path.startswith('zope.app.layers') and \ ... hasattr(layers, 'layer1') or \ ... path == 'zope.app.component.fields.layer1':
... if '..' in path: ... raise ValueError('Empty module name') ... if (path.startswith('zope.app.layers') and ... hasattr(layers, 'layer1') or ... path == 'zope.app.component.fields.layer1' or ... path == '.fields.layer1'):
... def resolve(self, path):
except ConfigurationError, v:
except (ConfigurationError, ValueError), v:
def fromUnicode(self, u): name = str(u.strip())
class SiteManagementView(adding.Adding):
class SiteManagementView(browser.ComponentAdding):
def __init__(self, interface, title, description=None, unique=False, folder='tools'): self.interface = interface self.title = title self.description = description self.unique = unique self.folder = folder
regManager = self.context[tool.folder].registrationManager
regManager = self.getSiteManagementFolder(tool).registrationManager
def getToolInstances(self, tool): """Find every registered utility for a given tool configuration.""" regManager = self.context[tool.folder].registrationManager return [ {'name': reg.name, 'url': zapi.absoluteURL(reg.component, self.request), 'rename': tool is self.activeTool and reg.name in self.renameList, 'active': ...
for iface in for_: if iface is not None: _context.action( discriminator = None, callable = provideInterface, args = ('', iface) )
_context.action( discriminator = None, callable = provideInterface, args = ('', for_) )
def defaultView(_context, type, name, for_): _context.action( discriminator = ('defaultViewName', for_, type, name), callable = handler, args = (zapi.servicenames.Adapters, 'register', (for_, type), IDefaultViewName, '', name, _context.info) ) _context.action( discriminator = None, callable = provideInterface, args =...
siteinfo.services = None
services = serviceManager
def setSite(site=None): if site is None: siteinfo.services = None else: siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager())
siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager())
site = trustedRemoveSecurityProxy(site) services = site.getSiteManager()
def setSite(site=None): if site is None: siteinfo.services = None else: siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager())
try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return None return services.__parent__
return siteinfo.site
def getSite(): try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return None return services.__parent__
try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return serviceManager return services
return siteinfo.services
def getServices_hook(context=None): if context is None: try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return serviceManager return services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service ma...
return interfaces.ActiveStatus return interfaces.InactiveStatus
return ActiveStatus return InactiveStatus
def __get__(self, inst, klass): registration = inst if registration is None: return self
if value == interfaces.ActiveStatus:
if value == ActiveStatus:
def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.')
elif value == interfaces.InactiveStatus:
elif value == InactiveStatus:
def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.')
if (interfaces.IComponentRegistration.providedBy(reg) and
if (IComponentRegistration.providedBy(reg) and
def registrations(self): rm = zapi.getParent(self.registerable).registrationManager return [reg for reg in rm.values() if (interfaces.IComponentRegistration.providedBy(reg) and reg.component is self.registerable)]
>>> interfaces
>>> list(interfaces)
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor...
>>> interfaces = utilities.getUtilitiesFor(IContentType)
>>> interfaces = list(utilities.getUtilitiesFor(IContentType))
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor...
['zope.app.component.interface.I']
[u'zope.app.component.interface.I']
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor...
>>> interfaces1 = utilities.getUtilitiesFor(IContentType)
>>> interfaces = list(utilities.getUtilitiesFor(IContentType))
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces impor...