rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self.gnbd_ip = self.fence_xml.get_widget('entry6') | def process_widgets(self): ##Fence Instance Form Fields self.apc_port = self.fence_xml.get_widget('entry1') self.apc_switch = self.fence_xml.get_widget('entry2') self.wti_port = self.fence_xml.get_widget('entry3') self.brocade_port = self.fence_xml.get_widget('entry4') self.vixel_port = self.fence_xml.get_widget('entry... | |
self.gnbd_fd_server = self.fence_xml.get_widget('entry27') | self.gnbd_fd_servers = self.fence_xml.get_widget('entry27') | def process_widgets(self): ##Fence Instance Form Fields self.apc_port = self.fence_xml.get_widget('entry1') self.apc_switch = self.fence_xml.get_widget('entry2') self.wti_port = self.fence_xml.get_widget('entry3') self.brocade_port = self.fence_xml.get_widget('entry4') self.vixel_port = self.fence_xml.get_widget('entry... |
rectify_fence_name = FALSE | self.validateNCName(self.gnbd_fd_name) | def val_gnbd_fd(self, name): rectify_fence_name = FALSE if self.gnbd_fd_name.get_text() == "": raise ValidationError('FATAL', FD_PROVIDE_NAME) self.validateNCName(self.gnbd_fd_name) if name != self.gnbd_fd_name.get_text(): res = self.check_unique_fd_name(self.gnbd_fd_name.get_text()) if res == FALSE: #name is already ... |
self.validateNCName(self.gnbd_fd_name) | rectify_fence_name = FALSE | def val_gnbd_fd(self, name): rectify_fence_name = FALSE if self.gnbd_fd_name.get_text() == "": raise ValidationError('FATAL', FD_PROVIDE_NAME) self.validateNCName(self.gnbd_fd_name) if name != self.gnbd_fd_name.get_text(): res = self.check_unique_fd_name(self.gnbd_fd_name.get_text()) if res == FALSE: #name is already ... |
if self.gnbd_fd_server.get_text() == "": raise ValidationError('FATAL', FD_PROVIDE_SERVER) | servers_new = self.gnbd_fd_servers.get_text().strip() if servers_new == "": raise ValidationError('FATAL', FD_PROVIDE_SERVERS) for ch in ':;,': if ch in servers_new: raise ValidationError('FATAL', FD_PROVIDE_SERVERS) | def val_gnbd_fd(self, name): rectify_fence_name = FALSE if self.gnbd_fd_name.get_text() == "": raise ValidationError('FATAL', FD_PROVIDE_NAME) self.validateNCName(self.gnbd_fd_name) if name != self.gnbd_fd_name.get_text(): res = self.check_unique_fd_name(self.gnbd_fd_name.get_text()) if res == FALSE: #name is already ... |
fields["server"] = self.gnbd_fd_server.get_text() | fields["servers"] = servers_new | def val_gnbd_fd(self, name): rectify_fence_name = FALSE if self.gnbd_fd_name.get_text() == "": raise ValidationError('FATAL', FD_PROVIDE_NAME) self.validateNCName(self.gnbd_fd_name) if name != self.gnbd_fd_name.get_text(): res = self.check_unique_fd_name(self.gnbd_fd_name.get_text()) if res == FALSE: #name is already ... |
if self.gnbd_ip.get_text() == "": raise ValidationError('FATAL', FI_PROVIDE_IPADDRESS) fields = {} fields["ipaddress"] = self.gnbd_ip.get_text() | fields = {} fields["nodename"] = "real value will be set at ModelBuilder.perform_final_check()" | def val_gnbd(self): if self.gnbd_ip.get_text() == "": raise ValidationError('FATAL', FI_PROVIDE_IPADDRESS) |
if self.model_builder.exportModel(CLUSTER_CONF_PATH) == False: | if self.model_builder.exportModel(CLUSTER_CONF_PATH) == True: self.configtab.prepare_tree(TRUE) else: | def propagate(self, button): retval = MessageLibrary.warningMessage(CONFIRM_PROPAGATE) if retval == gtk.RESPONSE_NO: return #1 save file to /etc/cluster/cluster.conf if self.model_builder.exportModel(CLUSTER_CONF_PATH) == False: return #2 call ccs_tool try: self.command_handler.propagateConfig(CLUSTER_CONF_PATH) except... |
if svc_title == "" or svc_title == None: return commandstring = "clusvcadm -q -R \"" + svc_name + "\"" | svc_state = model.get_value(iter, S_STATE_COL) if '<span' in svc_state: svc_state = svc_state.replace('</span>', '') svc_state = svc_state.replace(svc_state[svc_state.find('<span'):svc_state.find('>')+1], '').strip() if svc_title == "" or svc_title == None or svc_name == '' or svc_name == None or svc_state == '' or svc... | def on_svc_restart(self, button): selection = self.servicetree.get_selection() model,iter = selection.get_selected() if iter == None: return svc_name = model.get_value(iter, S_NAME_COL) svc_title = model.get_value(iter,S_TITLE_COL) if svc_title == "" or svc_title == None: return commandstring = "clusvcadm -q -R \"" + s... |
logger.debug( "for %s skipping %s of %s" % \ (item.getItemDisplayName(), attrName, value)) | def __importNode(self, node, item=None): | |
if os.getenv('CHANDLER_PERFORMANCE_TEST', 'no').lower() == 'yes': targets = ['install', 'strip', 'cats'] else: targets = ['install', 'strip'] | targets = ['install', 'strip'] | def doInstall(buildmode, workingDir, log, cleanFirst=False): # for our purposes, we do not really do a build # we will update chandler from SVN, 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... |
if isDead(self.proxiedItem) and isFirst and not isDead(master): | if isDead(self.proxiedItem) and isFirst and not isDead(master.itsItem): | def propagateChange(self, name, value): proxiedEvent = EventStamp(self.proxiedItem) master = proxiedEvent.getMaster() isFirst = (proxiedEvent != master and proxiedEvent.recurrenceID == master.effectiveStartTime) table = {'this' : proxiedEvent.changeThis, 'thisandfuture' : proxiedEvent.changeThisAndFuture} t... |
logger.info("Imported collection in", time() - before, "seconds") | logger.info("Imported collection in %s seconds" % (time() - before)) | def importFile(self): fullpath = self.filechooser.GetValue() if not os.path.isfile(fullpath): self.fail(_(u"File does not exist, import cancelled.")) return False (dir, filename) = os.path.split(fullpath) schema.ns("osaf.sharing", self.view).prefs.import_dir = dir share = osaf.sharing.OneTimeFileSystemShare( dir, fil... |
if (sidebar.filterKind is self.findPath ("//parcels/osaf/contentmodel/calendar/CalendarEventMixin")): | if (sidebar.filterKind is self.findPath ("//parcels/osaf/contentmodel/calendar/CalendarEventMixin") and keyItem.displayName == u"All filtered by Calendar Event Mixin Kind"): | def _makeTrunkForCacheKey(self, keyItem): if isinstance (keyItem, ItemCollection.ItemCollection): sidebar = Block.Block.findBlockByName ("Sidebar") if (sidebar.filterKind is self.findPath ("//parcels/osaf/contentmodel/calendar/CalendarEventMixin")): templatePath = self.calendarTemplatePath else: templatePath = self.tab... |
DB = os.environ['DB'] | PREFIX = os.environ['PREFIX'] | def main(): DB = os.environ['DB'] extensions = [] modules = ['chandlerdb.__init__', 'chandlerdb.util.__init__', 'chandlerdb.schema.__init__', 'chandlerdb.item.__init__', 'chandlerdb.item.ItemError', 'chandlerdb.persistence.__init__'] extensions.append(Extension('chandlerdb.util.uuid', sources=['chandlerdb/util/uuid.... |
extensions.append(Extension('chandlerdb.persistence.container', sources=['chandlerdb/persistence/container.c'], library_dirs=[os.path.join(DB, 'lib')], include_dirs=[os.path.join(DB, 'include')], libraries=['db-4.3'])) | if os.name == 'nt': ext = Extension('chandlerdb.persistence.container', sources=['chandlerdb/persistence/container.c'], include_dirs=[os.path.join(PREFIX, 'include', 'db')], library_dirs=[os.path.join(PREFIX, 'lib')], libraries=['libdb43', 'ws2_32']) else: ext = Extension('chandlerdb.persistence.container', sources=['c... | def main(): DB = os.environ['DB'] extensions = [] modules = ['chandlerdb.__init__', 'chandlerdb.util.__init__', 'chandlerdb.schema.__init__', 'chandlerdb.item.__init__', 'chandlerdb.item.ItemError', 'chandlerdb.persistence.__init__'] extensions.append(Extension('chandlerdb.util.uuid', sources=['chandlerdb/util/uuid.... |
else: reactor.callFromThread(self.stop) | def _run(self): """This should only be called from a pool thread""" self.runlock.acquire() try: if self.subject.run(): reactor.callFromThread(self.reschedule_if_running) else: # task can stop by returning false reactor.callFromThread(self.stop) finally: self.runlock.release() | |
if mode == "debug": dashT = '-dvt' else: dashT = '-vrt' try: | try: | def doTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): testDir = os.path.join(workingDir, "chandler") os.chdir(testDir) if mode == "debug": dashT = '-dvt' else: dashT = '-vrt' try: # test print "Testing " + mode log.write(separator) log.write("Testing " + mode + " ...\n") print "hardhatScript [... |
print "hardhatScript [%s]" % hardhatScript outputList = hardhatutil.executeCommandReturnOutput( [hardhatScript, dashT]) | cmd = ['./tools/do_tests.sh', '-u', '-m %s' % mode] outputList = hardhatutil.executeCommandReturnOutput(cmd) | def doTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): testDir = os.path.join(workingDir, "chandler") os.chdir(testDir) if mode == "debug": dashT = '-dvt' else: dashT = '-vrt' try: # test print "Testing " + mode log.write(separator) log.write("Testing " + mode + " ...\n") print "hardhatScript [... |
Load the Repository after the path has ben altered, but before | Load the Repository after the path has been altered, but before | def OnInit(self): """ Main application initialization. Open the persistent object tore, lookup of the application's persitent model counterpart, or create it if it doesn't exist. """ self.applicationResources=None self.association={} self.chandlerDirectory=None self.parcels={} self.storage=None self.model=None self.ja... |
return '%s:%s:%s:%s' % (self.hour, self.minute, self.second, self.microsecond) | return '%s:%s:%0.2f' % (self.hour, self.minute, self.second +( 0.000001 * self.microsecond)) | def __str__(self): """Method to return more parsable datetime string""" return '%s:%s:%s:%s' % (self.hour, self.minute, self.second, self.microsecond) |
self.printOut(u'Ending Suite ""%s"" :: EndTime %s :: Total Time %s' % (self.currentSuite['name'], self.currentSuite['endtime'], self.currentSuite['totaltime']), level=3) | self.printOut(u'Ending Suite ""%s"" :: EndTime %s :: Total Time %0.2f seconds' % (self.currentSuite['name'], self.currentSuite['endtime'], self._inSeconds(self.currentSuite['totaltime'])), level=3) | def endSuite(self): """Method to end current running suite. Encapsulates test list.""" self.currentSuite['endtime'] = datetime.now() self.currentSuite['totaltime'] = self.currentSuite['endtime'] - self.currentSuite['starttime'] self.printOut(u'Ending Suite ""%s"" :: EndTime %s :: Total Time %s' % (self.currentSuite['... |
self.printOut(u'Ending Test ""%s"" :: EndTime %s :: Total Time %s' % (self.currentTest['name'], self.currentTest['endtime'], self.currentTest['totaltime']), level=2) | self.printOut(u'Ending Test ""%s"" :: EndTime %s :: Total Time %0.2f seconds' % (self.currentTest['name'], self.currentTest['endtime'], self._inSeconds(self.currentTest['totaltime'])), level=2) | def endTest(self, comment=None): """Method to end individual test class run. Encapsulates action list.""" self.checkForStderrOutput() self.currentTest['endtime'] = datetime.now() self.currentTest['totaltime'] = self.currentTest['endtime'] - self.currentTest['starttime'] self.currentTest['comment'] = '%s\n%s' % (self.c... |
accel = platform_delete, | accel = _(u'Ctrl+D'), | def makeVisibleHourMenuItems(parcel): """ Create the 'Visible Hours' submenu. Should look like: Automatic --------- 5 hours 6 hours |
if gridWindow.HasCapture(): gridWindow.ReleaseMouse() | gridWindow.ReleaseMouse() | def OnMouseEvents (self, event): """ This code is tricky, tred with care -- DJA """ event.Skip() #Let the grid also handle the event gridWindow = self.GetGridWindow() |
raise ImportError, (sys.exc_value, sys.exc_traceback) | raise ImportError, sys.exc_value, sys.exc_traceback | def loadClass(cls, name, module=None): |
if (x + width > rect.x + rect.width): | if (x != rect.x and x + width > rect.x + rect.width): | def DrawWrappedText(self, dc, text, rect): # Simple wordwrap, next step is to not overdraw the rect lines = text.splitlines() y = rect.y for line in lines: x = rect.x wrap = 0 words = line.split(' ') for word in words: width, height = dc.GetTextExtent(word) if (x + width > rect.x + rect.width): y += height x = rect.x |
if ((y + height > rect.y + rect.height) or (x + width > rect.x + rect.width)): | if (y + height > rect.y + rect.height): | def DrawWrappedText(self, dc, text, rect): # Simple wordwrap, next step is to not overdraw the rect lines = text.splitlines() y = rect.y for line in lines: x = rect.x wrap = 0 words = line.split(' ') for word in words: width, height = dc.GetTextExtent(word) if (x + width > rect.x + rect.width): y += height x = rect.x |
"default": 143 | "default": 143, "required" : True, | def IMAPSaveHandler(item, fields, values): newAddressString = values['IMAP_EMAIL_ADDRESS'] newFullName = values['IMAP_FULL_NAME'] newUsername = values['IMAP_USERNAME'] newServer = values['IMAP_SERVER'] # If either the host or username changes, we need to set this account item # to inactive and create a new one. if (it... |
"default": 25 | "default": 25, "required" : True, | def IMAPSaveHandler(item, fields, values): newAddressString = values['IMAP_EMAIL_ADDRESS'] newFullName = values['IMAP_FULL_NAME'] newUsername = values['IMAP_USERNAME'] newServer = values['IMAP_SERVER'] # If either the host or username changes, we need to set this account item # to inactive and create a new one. if (it... |
"linkedTo" : ("SMTP_PORT", { True:"25", False:"25" } ) | def IMAPSaveHandler(item, fields, values): newAddressString = values['IMAP_EMAIL_ADDRESS'] newFullName = values['IMAP_FULL_NAME'] newUsername = values['IMAP_USERNAME'] newServer = values['IMAP_SERVER'] # If either the host or username changes, we need to set this account item # to inactive and create a new one. if (it... | |
"default": 80 | "default": 80, "required" : True, | def IMAPSaveHandler(item, fields, values): newAddressString = values['IMAP_EMAIL_ADDRESS'] newFullName = values['IMAP_FULL_NAME'] newUsername = values['IMAP_USERNAME'] newServer = values['IMAP_SERVER'] # If either the host or username changes, we need to set this account item # to inactive and create a new one. if (it... |
val = int(control.GetValue().strip()) | try: val = int(control.GetValue().strip()) except: continue | def __StoreFormData(self, panelType, panel, data): for field in PANELS[panelType]['fields'].keys(): control = wx.xrc.XRCCTRL(panel, field) fieldInfo = PANELS[panelType]['fields'][field] valueType = fieldInfo['type'] valueRequired = fieldInfo.get('required', False) if valueType == "string": val = control.GetValue().stri... |
result += "<td valign=top>%s</td>\n" % (attribute.initialValue) | result += "<td valign=top>%s</td>\n" % (attribute.initialValue,) | def RenderItem(item, urlRoot): result = "" # For Kinds, display their attributes (except for the internal ones # like notFoundAttributes): isKind = \ (item.itsKind and "//Schema/Core/Kind" == str(item.itsKind.itsPath)) path = "<a href=%s>[top]</a>" % toLink(urlRoot, "/") i = 2 for part in item.itsPath[1:-1]: path +=... |
EVT_UPDATE_UI(self, XRCID ('EditMenu0'), self.OnEditMenu0UIUpdate) | EVT_UPDATE_UI(self, XRCID ('EditMenu0'), self.OnEditMenu0UpdateUI) | def OnInit(self): """ General initialization goes here, e.g. wiring up menus, etc. """ EVT_RADIOBOX(self, XRCID ('RadioBox'), self.OnRadioBox) |
EVT_UPDATE_UI(self, XRCID ('EditMenu1'), self.OnEditMenu1UIUpdate) | EVT_UPDATE_UI(self, XRCID ('EditMenu1'), self.OnEditMenu1UpdateUI) | def OnInit(self): """ General initialization goes here, e.g. wiring up menus, etc. """ EVT_RADIOBOX(self, XRCID ('RadioBox'), self.OnRadioBox) |
def OnEditMenu0UIUpdate(self, event): | def OnEditMenu0UpdateUI(self, event): | def OnEditMenu0UIUpdate(self, event): if self.model.radioSelection == 0: event.SetText (_('Set to Dinner')) elif self.model.radioSelection == 1: event.SetText (_('Set to Lunch')) |
def OnEditMenu1UIUpdate(self, event): | def OnEditMenu1UpdateUI(self, event): | def OnEditMenu1UIUpdate(self, event): event.Enable (self.model.radioSelection == 0) |
return DAVConnection(self.url) | acct = osaf.framework.sharing.Sharing.getWebDavAccount() if acct.useSSL: return SSLDAVConnection(self.url, acct) return DAVConnection(self.url, acct) | def newConnection(self): return DAVConnection(self.url) |
def __init__(self, url): | def __init__(self, url, acct): | def __init__(self, url): host = url.host port = url.port or 80 |
acct = osaf.framework.sharing.Sharing.getWebDavAccount() | def __init__(self, url): host = url.host port = url.port or 80 | |
self._makeGeneralChange() | newfirst._makeGeneralChange() | def changeThis(self, attr=None, value=None): """Make this event a modification, don't modify future events. Without arguments, change self appropriately to make it a THIS modification. One edge case does have an effect on other events. Moving an event's startTime so it begins in a different rule will ........FIXME ... |
self.contentsCollection = collection | def setContentsOnBlock (self, item, collection): """ A utility routine for onSetContents handlers that sets the contents of a block and updates the contents subscribers """ oldContents = getattr (self, 'contents', None) if oldContents is item: return if oldContents is not None: oldSubscribers = getattr(oldContents, 'su... | |
if self.IsVisible (id): self.Expand(id) | self.Expand(id) | def ExpandContainer (self, openedContainers, id): try: expand = openedContainers [self.GetItemData(id).GetData()] except KeyError: pass else: self.LoadChildren(id) |
def __init__(self, *arguments, **keywords): super (wxTree, self).__init__ (*arguments, **keywords) | pass | def __init__(self, *arguments, **keywords): super (wxTree, self).__init__ (*arguments, **keywords) |
def __init__(self, *arguments, **keywords): super (wxTreeList, self).__init__ (*arguments, **keywords) | pass | def __init__(self, *arguments, **keywords): super (wxTreeList, self).__init__ (*arguments, **keywords) |
def __init__(self, *arguments, **keywords): super (Tree, self).__init__ (*arguments, **keywords) self.openedContainers = {} self.rootPath = None self.selection = None | def __init__(self, *arguments, **keywords): super (Tree, self).__init__ (*arguments, **keywords) self.openedContainers = {} self.rootPath = None self.selection = None | |
if (absDeltaMinutes > 1440): | if (absDeltaMinutes >= 2880): | def RelativeDateTimeMessage(self, delta): deltaMinutes = delta.minutes if 1 > deltaMinutes >= 0: return _("Now") absDeltaMinutes = abs(deltaMinutes) if (absDeltaMinutes > 1440): format = _("%d day%s %s") scale = 1440 elif (absDeltaMinutes >= 60): format = _("%d hour%s %s") scale = 60 else: format = _("%d minute%s %s")... |
elif (absDeltaMinutes >= 60): | elif (absDeltaMinutes >= 120): | def RelativeDateTimeMessage(self, delta): deltaMinutes = delta.minutes if 1 > deltaMinutes >= 0: return _("Now") absDeltaMinutes = abs(deltaMinutes) if (absDeltaMinutes > 1440): format = _("%d day%s %s") scale = 1440 elif (absDeltaMinutes >= 60): format = _("%d hour%s %s") scale = 60 else: format = _("%d minute%s %s")... |
for columnIndex in xrange (newColumns): | widthMinusLastColumn = 0 for columnIndex in xrange (newColumns - 1): widthMinusLastColumn += self.blockItem.columnWidths[columnIndex] | def wxSynchronizeWidget(self): """ A Grid can't easily redisplay its contents, so we write the following helper function to readjust everything after the contents change """ #Trim/extend the control's rows and update all values |
for i in list: if i not in serverList: item.removeValue(attrName, i) log.info('removing %s from list %s' % (i, item)) | def mergeList(item, attrName, nodes, nodesAreItemRefs): list = item.getAttributeValue(attrName, default=[]) serverList = [] for node in nodes: if nodesAreItemRefs: try: value = Dav.DAV(node.content).get() except Dav.NotFound: value = None else: value = node.content if value: serverList.append(value) try: log.info('... | |
for i in item: if i not in serverCollectionResults: item.remove(i) log.debug('removing %s from collection %s' % (i, item)) | def syncFromServer(item, davItem): kind = davItem.itsKind for (name, attr) in kind.iterAttributes(True): value = davItem.getAttribute(attr) if not value: continue log.info('Getting: %s (%s)' % (name, attr.type.itsName)) # see if its an ItemRef or not if isinstance(attr.type, Kind): # time for some xml parsing! yum!... | |
self.Refresh() | def OnSize(self, event): self._doDrawingCalculations() self.RebuildCanvasItems() #self.Refresh() #event.Skip() | |
useSSL=False, port=80, | useSSL=True, port=443, | def installParcel(parcel, oldVersion=None): curDav = Reference.update(parcel, 'currentWebDAVAccount') curMail = Reference.update(parcel, 'currentMailAccount') curSmtp = Reference.update(parcel, 'currentSMTPAccount') curCon = Reference.update(parcel, 'currentContact') sharing = schema.ns("osaf.sharing", parcel) model ... |
(options, args) = parser.parse_args() | if sys.platform == 'darwin': args = [arg for arg in sys.argv[1:] if not arg.startswith('-psn_')] (options, args) = parser.parse_args(args=args) else: (options, args) = parser.parse_args() | def initOptions(**kwds): """ Load and parse the command line options, with overrides in **kwds. Returns options """ #XXX i18n parcelPath, profileDir could have non-ascii paths # option name, (value, short cmd, long cmd, type flag, default, environment variable, help text) _configItems = { 'parcelPath': ('-p', '--pa... |
- verbose: 0 for quiet, > 0 for messages displayed to stdout | - verbosity: 0 for quiet, > 0 for messages displayed to stdout | def init(buildenv): """ Initialize the build environment, which is a dictionary containing various values for OS type, PATH, compiler, debug/release setting, etc. Parameters: root: fully qualified path to the top of the build hierarchy Returns: buildenv: a dictionary containing the following environment settings: - ro... |
if os.path.isfile(match) and not match in excludes: if not os.path.exists(destdir): _mkdirs(destdir) if os.path.islink(match): linkto = os.readlink(match) os.symlink(linkto, os.path.join(destdir,match)) else: shutil.copy(match, destdir) | if os.path.isfile(match) and not match in excludesMatch: try: if not os.path.exists(destdir): _mkdirs(destdir) if os.path.islink(match): linkto = os.readlink(match) os.symlink(linkto, os.path.join(destdir,match)) else: shutil.copy(match, destdir) except (IOError, os.error), why: print "Can't copy %s to %s: %s" % (match... | def _copyTree(srcdir, destdir, recursive, patterns, excludes): os.chdir(srcdir) for pattern in patterns: matches = glob.glob(pattern) for match in matches: if os.path.isfile(match) and not match in excludes: if not os.path.exists(destdir): _mkdirs(destdir) if os.path.islink(match): linkto = os.readlink(match) os.symlin... |
if os.path.isfile(match) and not match in excludes: if not os.path.exists(destdir): _mkdirs(destdir) shutil.copy(match, destdir) | if os.path.isfile(match) and not match in excludesMatch: try: if not os.path.exists(destdir): _mkdirs(destdir) if os.path.islink(match): linkto = os.readlink(match) os.symlink(linkto, os.path.join(destdir,match)) else: shutil.copy(match, destdir) except (IOError, os.error), why: print "Can't copy %s to %s: %s" % (match... | def copyTree(srcdir, destdir, patterns, excludes): for pattern in patterns: matches = glob.glob(os.path.join(srcdir, pattern)) for match in matches: if os.path.isfile(match) and not match in excludes: if not os.path.exists(destdir): _mkdirs(destdir) shutil.copy(match, destdir) for name in os.listdir(srcdir): fullpath =... |
if os.path.isdir(fullpath) and not name in excludes: | if os.path.isdir(fullpath) and not fnmatch.fnmatch(name, excludes): | def copyTree(srcdir, destdir, patterns, excludes): for pattern in patterns: matches = glob.glob(os.path.join(srcdir, pattern)) for match in matches: if os.path.isfile(match) and not match in excludes: if not os.path.exists(destdir): _mkdirs(destdir) shutil.copy(match, destdir) for name in os.listdir(srcdir): fullpath =... |
wxDefaultPosition, [400,-1], wx.TE_PASSWORD) | wx.DefaultPosition, [400,-1], wx.TE_PASSWORD) | def __init__(self, parent, ID, title, item, attrList, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE): |
wxDefaultPosition, [400,-1]) | wx.DefaultPosition, [400,-1]) | def __init__(self, parent, ID, title, item, attrList, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE): |
rootdir = os.environ['CHANDLER_HOME'] schemaPack = os.path.join(rootdir, 'Chandler', 'repository', | rootdir = os.environ['CHANDLERDIR'] schemaPack = os.path.join(rootdir, 'repository', | def setUp(self): rootdir = os.environ['CHANDLER_HOME'] schemaPack = os.path.join(rootdir, 'Chandler', 'repository', 'packs', 'schema.pack') cineguidePack = os.path.join(rootdir, 'Chandler', 'repository', 'tests', 'data', 'packs', 'cineguide.pack') self.rep = XMLRepository('TextUnitTest-Repository') self.rep.create() se... |
cineguidePack = os.path.join(rootdir, 'Chandler', 'repository', | cineguidePack = os.path.join(rootdir, 'repository', | def setUp(self): rootdir = os.environ['CHANDLER_HOME'] schemaPack = os.path.join(rootdir, 'Chandler', 'repository', 'packs', 'schema.pack') cineguidePack = os.path.join(rootdir, 'Chandler', 'repository', 'tests', 'data', 'packs', 'cineguide.pack') self.rep = XMLRepository('TextUnitTest-Repository') self.rep.create() se... |
rootdir = os.environ['CHANDLER_HOME'] largeText = os.path.join(rootdir, 'Chandler', 'repository', | rootdir = os.environ['CHANDLERDIR'] largeText = os.path.join(rootdir, 'repository', | def testBZ2Compressed(self): khepburn = self.rep.find('//CineGuide/KHepburn') movie = khepburn.movies.first() self.assert_(movie is not None) |
description = event.getChildValue('summary') | description = event.getChildValue('description') | def importProcess(self, text, extension=None, item=None, changes=None, previousView=None, updateCallback=None): # the item parameter is so that a share item can be passed in for us # to populate. |
minimumSize=SizeType(30, 17)) | minimumSize=SizeType(30, 18)) | def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Each button just sends this event to itself. buttonPressed = BlockEvent.template('ButtonPressed', 'SendToSender').install(parcel) # The buttons. mailMessageButton = \ MailMessageButtonBlock.template('MailMessageButton', title=messages.STAMP_MAIL, ... |
toolSize=SizeType(30, 17), | toolSize=SizeType(30, 18), | def makeMarkupBar(parcel, oldVersion): """ Build the markup bar. """ # Each button just sends this event to itself. buttonPressed = BlockEvent.template('ButtonPressed', 'SendToSender').install(parcel) # The buttons. mailMessageButton = \ MailMessageButtonBlock.template('MailMessageButton', title=messages.STAMP_MAIL, ... |
parcel = application.Parcel.Manager.getParentParcel(directory) parcelDir = os.path.dirname(parcel.file) docRoot = os.path.join(parcelDir, directory.path) logger.info(u" Hooking up /%s to directory %s" % \ (directory.location, docRoot)) | module = schema.importString(directory.module) moduleDir = os.path.dirname(module.__file__) docRoot = os.path.join(moduleDir, directory.path) logger.info(u" Hooking up /%s to directory %s" % (directory.location, docRoot)) | def startup(self): docRoot = self.path root = static.File(docRoot) |
of "/images" and path of /path/to/your/images/ and set its server attribute to a web server item. | of "/images" and path of relativepath/to/your/images/ and set its server attribute to a web server item. | def loginPage(self, request): """ A generic login page, which you'll probably want to override... """ |
htmlWindow = wxHtmlWindow(parentWindow, Block.getwxID(self), wxDefaultPosition, (self.minimumSize.width, self.minimumSize.height)) | htmlWindow = wxHTML(parentWindow, Block.getwxID(self), wxDefaultPosition, (self.minimumSize.width, self.minimumSize.height)) | def renderOneBlock (self, parent, parentWindow): htmlWindow = wxHtmlWindow(parentWindow, Block.getwxID(self), wxDefaultPosition, (self.minimumSize.width, self.minimumSize.height)) if self.url: htmlWindow.LoadPage(self.url) self.getParentBlock(parentWindow).addToContainer(parent, htmlWindow, self.stretchFactor, self.Ca... |
self.getParentBlock(parentWindow).addToContainer(parent, htmlWindow, self.stretchFactor, self.Calculate_wxFlag(), self.Calculate_wxBorder()) | parentBlock = self.getParentBlock(parentWindow) parentBlock.addToContainer(parent, htmlWindow, self.stretchFactor, self.Calculate_wxFlag(), self.Calculate_wxBorder()) | def renderOneBlock (self, parent, parentWindow): htmlWindow = wxHtmlWindow(parentWindow, Block.getwxID(self), wxDefaultPosition, (self.minimumSize.width, self.minimumSize.height)) if self.url: htmlWindow.LoadPage(self.url) self.getParentBlock(parentWindow).addToContainer(parent, htmlWindow, self.stretchFactor, self.Ca... |
def onImportContactsEvent(self, notification): x=OutlookContacts.OutlookContacts().processFile() | def onGenerateContactsEvent(self, notification): GenerateItems.GenerateContacts(10) Globals.repository.commit() | |
def updatePLists(self): | def updatePList(self): | def updatePLists(self): bundleDir = os.path.join(self.chandlerDir, 'distrib', 'osx', 'bundle') plist = 'Info.plist' rel = os.path.join(bundleDir, 'release', plist) deb = os.path.join(bundleDir, 'debug', plist) searchLong = r'(Milestone|Release) \d\.\d\.\d+ ' searchShort = r'>\d\.\d\.\d+<' if self.release: longVersion =... |
plist = 'Info.plist' rel = os.path.join(bundleDir, 'release', plist) deb = os.path.join(bundleDir, 'debug', plist) | plist = os.path.join(bundleDir, 'Info.plist') | def updatePLists(self): bundleDir = os.path.join(self.chandlerDir, 'distrib', 'osx', 'bundle') plist = 'Info.plist' rel = os.path.join(bundleDir, 'release', plist) deb = os.path.join(bundleDir, 'debug', plist) searchLong = r'(Milestone|Release) \d\.\d\.\d+ ' searchShort = r'>\d\.\d\.\d+<' if self.release: longVersion =... |
updateSmallFile(rel, | updateSmallFile(plist, | def updatePLists(self): bundleDir = os.path.join(self.chandlerDir, 'distrib', 'osx', 'bundle') plist = 'Info.plist' rel = os.path.join(bundleDir, 'release', plist) deb = os.path.join(bundleDir, 'debug', plist) searchLong = r'(Milestone|Release) \d\.\d\.\d+ ' searchShort = r'>\d\.\d\.\d+<' if self.release: longVersion =... |
updateSmallFile(rel, searchShort, shortVersion) updateSmallFile(deb, searchLong, longVersion + ' ') updateSmallFile(deb, | updateSmallFile(plist, | def updatePLists(self): bundleDir = os.path.join(self.chandlerDir, 'distrib', 'osx', 'bundle') plist = 'Info.plist' rel = os.path.join(bundleDir, 'release', plist) deb = os.path.join(bundleDir, 'debug', plist) searchLong = r'(Milestone|Release) \d\.\d\.\d+ ' searchShort = r'>\d\.\d\.\d+<' if self.release: longVersion =... |
self.updatePLists() | self.updatePList() | def cvsChanges(self): self.checkoutMinimal() self.updateWelcome() self.updatePLists() |
(filteredCollection, rerender) = sidebarTPB.trunkDelegate._mapItemToCacheKeyItem(item) | (filteredCollection, rerender) = sidebarTPB.trunkDelegate._mapItemToCacheKeyItem(item, False) | def drawButton (name): imagePrefix = "Sidebar" + name imageSuffix = ".png" if (row == getattr (grid, 'hoverImageRow', wx.NOT_FOUND) and name != "SharingIcon"): imagePrefix += "MouseOver" if grid.buttonState[name]['screenChecked']: imageSuffix = "Checked" + imageSuffix else: imageSuffix = sidebar.getButtonState (name, i... |
sidebar = grid.blockItem | def drawButton (name): imagePrefix = "Sidebar" + name imageSuffix = ".png" if (row == getattr (grid, 'hoverImageRow', wx.NOT_FOUND) and name != "SharingIcon"): imagePrefix += "MouseOver" if grid.buttonState[name]['screenChecked']: imageSuffix = "Checked" + imageSuffix else: imageSuffix = sidebar.getButtonState (name, i... | |
sidebar = Block.Block.findBlockByName ("Sidebar") | def drawButton (name): imagePrefix = "Sidebar" + name imageSuffix = ".png" if (row == getattr (grid, 'hoverImageRow', wx.NOT_FOUND) and name != "SharingIcon"): imagePrefix += "MouseOver" if grid.buttonState[name]['screenChecked']: imageSuffix = "Checked" + imageSuffix else: imageSuffix = sidebar.getButtonState (name, i... | |
def _mapItemToCacheKeyItem(self, item): | def _mapItemToCacheKeyItem(self, item, includeCheckedItems=True): | def _mapItemToCacheKeyItem(self, item): key = item rerender = False sidebar = Block.Block.findBlockByName ("Sidebar") """ collectionList should be in the order that the source items are overlayed in the Calendar view """ collectionList = [theItem for theItem in sidebar.contents if (theItem in sidebar.checkedItems) and ... |
collectionList = [theItem for theItem in sidebar.contents if (theItem in sidebar.checkedItems) and (theItem is not item)] | if includeCheckedItems: collectionList = [theItem for theItem in sidebar.contents if (theItem in sidebar.checkedItems) and (theItem is not item)] else: collectionList = [] | def _mapItemToCacheKeyItem(self, item): key = item rerender = False sidebar = Block.Block.findBlockByName ("Sidebar") """ collectionList should be in the order that the source items are overlayed in the Calendar view """ collectionList = [theItem for theItem in sidebar.contents if (theItem in sidebar.checkedItems) and ... |
if dt.tzinfo: dt = dt.astimezone(tz) | if getattr(dt, 'tzinfo', None): dt = dt.astimezone(tz) | def convertToMX(dt, tz=None): """Convert the given datetime into an mxDateTime. Convert dt to local time if it has a timezone. >>> import datetime, mx.DateTime >>> dt = datetime.datetime(2004, 12, 20, 18, tzinfo=utc) >>> mxdt = convertToMX(dt, pacific) >>> print mxdt 2004-12-20 10:00:00.00 >>> type(mxdt) <type 'DateT... |
continue | duration = event.duration[0].value | def importICalendar(cal, rep, parent=None): """Import the given vobject vcalendar into rep at the given parent. Currently only grabs vevents, ignores duration, ignores rdates with extra duration information. Also, vobject 0.1 has a bug (argh) that completely ignores recurrence information. Fortunately, this offsets ... |
test = getattr(event, 'description', []) if len(test) > 0: newevent.body = textkind.makeValue(test[0].value) | def importICalendar(cal, rep, parent=None): """Import the given vobject vcalendar into rep at the given parent. Currently only grabs vevents, ignores duration, ignores rdates with extra duration information. Also, vobject 0.1 has a bug (argh) that completely ignores recurrence information. Fortunately, this offsets ... | |
if item and widget: | if item is not None and widget: | def saveTextValue (self, validate=False): # save the user's edits into item's attibute item = self.selectedItem() widget = self.widget if item and widget: self.saveAttributeFromWidget(item, widget, validate=validate) |
if not item: | if item is None: | def loadTextValue (self, item): # load the edit text from our attribute into the field if not item: item = self.selectedItem() if item: widget = self.widget self.loadAttributeIntoWidget(item, widget) |
if item: | if item is not None: | def loadTextValue (self, item): # load the edit text from our attribute into the field if not item: item = self.selectedItem() if item: widget = self.widget self.loadAttributeIntoWidget(item, widget) |
previousKey, nextKey, alias = self._loadRef(key) self._dict[key] = CLink(self, child, previousKey, nextKey, alias) if alias is not None: self._aliases[alias] = key | if key not in self._dict: previousKey, nextKey, alias = self._loadRef(key) self._dict[key] = CLink(self, child, previousKey, nextKey, alias) if alias is not None: self._aliases[alias] = key else: self._dict[key]._value = child | def _loadChild(self, key, child): |
if running_status == IDLE: return | def interrupt(graceful=True): """ Stop sync operations; if graceful=True, then the Share being synced at the moment is allowed to complete. If graceful=False, stop the current Share in the middle of whatever it's doing. """ global interrupt_flag if running_status == IDLE: return if graceful: interrupt_flag = GRACEFU... | |
fraction = busyFractions.get(offset, 0.25) | fraction = busyFractions.get(offset, 0.0) fraction = max(fraction, 0.25) | def updateBusy(event, start): # Broken out into a separate function because we're going # to call it for each non-recurring events, and for each # individual occurrence of all the recurring events. # In the case of the latter, event may be the master, or # a modification; we're trying to avoid creating all the # items ... |
def itemsToFreeBusy(view, start, end): | def itemsToFreeBusy(view, start, end, calname = None): | def itemsToFreeBusy(view, start, end): """ Create FREEBUSY components corresponding to all events between start and end. """ # eventsInRange defaults to all events, which is what we want normal = Calendar.eventsInRange(view, start, end) recurring = Calendar.recurringEventsInRange(view, start, end) events = Calendar... |
start + FREEBUSY_WEEKS_EXPORTED * 7 * oneDay) | start + FREEBUSY_WEEKS_EXPORTED * 7 * oneDay, calname = self.itsParent.displayName) | def exportProcess(self, item, depth=0): """ Share and depth are ignored, always export freebusy associated with the all collection. """ start = beginningOfWeek() cal = itemsToFreeBusy(self.itsView, start, start + FREEBUSY_WEEKS_EXPORTED * 7 * oneDay) return cal.serialize().encode('utf-8') |
self.itemCollectionInclusions = master.itemCollectionInclusions | for coll in master.itemCollectionInclusions: coll.add(self) | def _makeGeneralChange(self, master=None): """Do everything that should happen for any change call.""" if master is None: master = self.getMaster() if master.hasLocalAttributeValue('itemCollectionInclusions'): self.itemCollectionInclusions = master.itemCollectionInclusions self.isGenerated = False |
now = datetime.now() | now = datetime.now(ICUtzinfo.getDefault()) | def GenerateCalendarEvent(view, days=30): event = Calendar.CalendarEvent(view=view) event.displayName = random.choice(HEADLINES) # Choose random days, hours startDelta = timedelta(days=random.randint(0, days), hours=random.randint(0, 24)) now = datetime.now() closeToNow = datetime(now.year, now.month, now.day, now.ho... |
int(now.minute/30) * 30) | int(now.minute/30) * 30, tzinfo=now.tzinfo) | def GenerateCalendarEvent(view, days=30): event = Calendar.CalendarEvent(view=view) event.displayName = random.choice(HEADLINES) # Choose random days, hours startDelta = timedelta(days=random.randint(0, days), hours=random.randint(0, 24)) now = datetime.now() closeToNow = datetime(now.year, now.month, now.day, now.ho... |
note.createdOn = datetime.now() + delta | note.createdOn = datetime.now(ICUtzinfo.getDefault()) + delta | def GenerateNote(view): """ Generate one Note item """ note = pim.Note(view=view) note.displayName = random.choice(TITLES) delta = timedelta(days=random.randint(0, 5), hours=random.randint(0, 24)) note.createdOn = datetime.now() + delta return note |
menuTitle = _(u'Keep sout of %(kind)s') % arguments | menuTitle = _(u'Keep out of %(kind)s') % arguments | def onToggleMineEventUpdateUI(self, event): isCollection = (self.selectedItemToView is not None and isinstance (self.selectedItemToView, AbstractCollection)) if isCollection: if hasattr (self.selectedItemToView, "displayNameAlternatives"): collectionName = self.getNameAlternative (self.selectedItemToView) else: collect... |
args = list(args) args.extend(monitorArgs) | _args = list(args) _args.extend(monitorArgs) | def invoke(cls, op, item, attribute, *args): |
args = monitorArgs getattr(monitorItem, method)(op, item, attribute, *args, **kwds) | _args = monitorArgs else: _args = args getattr(monitorItem, method)(op, item, attribute, *_args, **kwds) | def invoke(cls, op, item, attribute, *args): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.