Title: [commits] (stearns) [16046] merge from trunk, -r16021:16045

Diff

Modified: branches/detail_layout/chandler/Makefile (16045 => 16046)

--- branches/detail_layout/chandler/Makefile	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/Makefile	2007-12-05 18:30:35 UTC (rev 16046)
@@ -13,6 +13,7 @@
 PYTHON_VER   = 2.5
 BP           =
 LOCALE_VER   = trunk
+LOCALE_INST  = 
 
 BUILD_PLUGINS = Chandler-HelloWorldPlugin \
                 Chandler-AmazonPlugin \
@@ -126,7 +127,7 @@
 ARCHIVES = \
     $(CHANDLERARCHIVES)/Launchers-$(SNAP)-0.9-$(BP)30.tar.gz \
     $(CHANDLERARCHIVES)/chandlerdb-$(SNAP)-0.7-$(BP)30.tar.gz \
-    $(CHANDLERARCHIVES)/db-$(SNAP)-4.6.21-$(BP)2.tar.gz \
+    $(CHANDLERARCHIVES)/db-$(SNAP)-4.6.21-$(BP)3.tar.gz \
     $(READLINE) \
     $(PYTHON) \
     $(SETUPTOOLS) \
@@ -285,15 +286,26 @@
           --script-dir='$(PLUGIN_INST)' \
           --install-dir='$(PLUGIN_INST)' .
 
+ifeq ($(OS),Darwin)
+    ifeq ($(OS_MAJOR_VER),9)
+        LOCALE_INST = --install-dir=$(C_BIN)/$(SNAP)/site-packages
+    endif
+endif
+
+ifeq ($(OS),Linux)
+    ifneq ($(findstring $(DISTRIB_CODENAME),feisty gutsy),)
+        LOCALE_INST = --install-dir=$(C_BIN)/$(SNAP)/site-packages
+    endif
+endif
+
 $(addprefix install-, $(BUILD_LOCALES)):
 	rm -rf $(C_HOME)/localizations/$(subst install-,,$@)
-	svn export http://svn.osafoundation.org/localizations/chandler/$(LOCALE_VER)/$(subst install-,,$@) $(C_HOME)/localizations/$(subst install-,,$@)
+	svn export http://svn.osafoundation.org/localizations/chandler/$(LOCALE_VER)/$(subst install-,,$@) localizations/$(subst install-,,$@)
 	$(RUN_PYTHON) tools/createTranslationEgg.py -c --dist \
                   -l $(subst install-,,$@) \
                   -f '$(LOCALE_SRC)'$(subst install-,,$@)/Chandler-$(subst install-,,$@).po \
                   -d '$(LOCALE_SRC)'
-	$(RUN_PYTHON) -m easy_install -x --multi-version --install-dir='$(PLUGIN_INST)' \
-                      '$(LOCALE_SRC)'Chandler.$(subst install-,,$@)-1.0-py$(PYTHON_VER).egg
+	$(RUN_PYTHON) -m easy_install -x $(LOCALE_INST) '$(LOCALE_SRC)'Chandler.$(subst install-,,$@)-1.0-py$(PYTHON_VER).egg
 
 chandler-locale-data:
 	$(RUN_PYTHON) setup.py egg_info

Modified: branches/detail_layout/chandler/WingLinuxDebug.wpr (16045 => 16046)

--- branches/detail_layout/chandler/WingLinuxDebug.wpr	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/WingLinuxDebug.wpr	2007-12-05 18:30:35 UTC (rev 16046)
@@ -6,11 +6,12 @@
 [project attributes]
 debug.run-args = {loc('Chandler.py'): '--catch=never --stderr'}
 proj.directory-list = [{'dirloc': loc('.'),
-                        'excludes': (),
+                        'excludes': [u'debug',
+                                     u'release'],
                         'filter': '*',
-                        'include_hidden': 0,
+                        'include_hidden': False,
                         'recursive': 1,
-                        'watch_for_changes': 1}]
+                        'watch_for_changes': True}]
 proj.env-vars = {None: ('custom',
                         ['LD_LIBRARY_PATH=debug/lib:debug/db/lib:debug/icu/l'\
                          'ib:debug/j2re-image/lib/i386:debug/j2re-image/lib/'\

Modified: branches/detail_layout/chandler/WingLinuxRelease.wpr (16045 => 16046)

--- branches/detail_layout/chandler/WingLinuxRelease.wpr	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/WingLinuxRelease.wpr	2007-12-05 18:30:35 UTC (rev 16046)
@@ -6,11 +6,12 @@
 [project attributes]
 debug.run-args = {loc('Chandler.py'): '--catch=never --stderr'}
 proj.directory-list = [{'dirloc': loc('.'),
-                        'excludes': (),
+                        'excludes': [u'debug',
+                                     u'release'],
                         'filter': '*',
-                        'include_hidden': 0,
+                        'include_hidden': False,
                         'recursive': 1,
-                        'watch_for_changes': 1}]
+                        'watch_for_changes': True}]
 proj.env-vars = {None: ('custom',
                         ['LD_LIBRARY_PATH=release/lib:release/db/lib:release'\
                          '/icu/lib:release/j2re-image/lib/i386:release/j2re-'\

Modified: branches/detail_layout/chandler/application/Application.py (16045 => 16046)

--- branches/detail_layout/chandler/application/Application.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/application/Application.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -336,6 +336,12 @@
         self.ignoreSynchronizeWidget = True
         self.focus = None
 
+        # Check the Mac platform, will stop the program if not compatible
+        if not checkMacPlatform():
+            wx.MessageBox(_(u'This version of Chandler runs on a different operating system. Please download the correct installer from the OSAF website.'),
+                          _(u'Quitting Chandler'))
+            return False
+
         wx.InitAllImageHandlers()
 
         # Disable automatic calling of UpdateUIEvents. We will call them
@@ -347,9 +353,6 @@
         Globals.wxApplication = self
         self.updateUIInOnIdle = True
         
-        # Check the platform, will stop the program if not compatible
-        checkPlatform()
-
         # Initialize PARCELPATH and sys.path
         parcelPath = Utility.initParcelEnv(options, Globals.chandlerDirectory)
         pluginEnv, pluginEggs = Utility.initPluginEnv(options,
@@ -1555,23 +1558,15 @@
         wx.GetApp().Yield(True)
 
 
-def checkPlatform():
+def checkMacPlatform():
     """
-    Check that the platforms you're running and the one the code has been compiled for match.
-    If they don't, the program stops with sys.exit().
+    Check that we're not running the wrong Mac binaries for the Mac hardware
     """
-    try:
-        from version import platform # This is the compiled platform name
-    except ImportError:
-        # If the platform is not specified in version.py, you're running a dev version from
-        # code. In that case, we suppose you know what you're doing so 
-        # the test will pass and you're on your own...
-        platform = Utility.getPlatformName()
-    if Utility.getPlatformName() != platform:
-        # Prompt the user that we're going to exit
-        wx.MessageBox(_(u'This version of Chandler runs on a different operating system. Please download the correct installer from the OSAF website.'),
-                      _(u'Quitting Chandler'))
-        # Stop the program. Somewhat unclean but since nothing can be done safely
-        # or even should be done (could crash anytime), the best is to just exit when
-        # we still can...
-        sys.exit(1)
+
+    if sys.platform == 'darwin':
+        from platform import processor, machine
+        if processor() == 'i386' and machine() == 'Power Macintosh':
+            # running under Rosetta, not supported
+            return False
+
+    return True

Modified: branches/detail_layout/chandler/application/Utility.py (16045 => 16046)

--- branches/detail_layout/chandler/application/Utility.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/application/Utility.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -23,7 +23,6 @@
 from configobj import ConfigObj
 
 from chandlerdb.util.c import UUID, loadUUIDs, Default
-from repository.persistence.DBRepository import DBRepository
 from repository.persistence.RepositoryError import \
     VersionConflictError, RepositoryPasswordError, RepositoryVersionError, \
     RepositoryRunRecoveryError
@@ -629,6 +628,8 @@
 
 def initRepository(directory, options, allowSchemaView=False):
 
+    from repository.persistence.DBRepository import DBRepository
+
     if options.uuids:
         input = file(options.uuids)
         loadUUIDs([UUID(uuid.strip()) for uuid in input if len(uuid) > 1])

Modified: branches/detail_layout/chandler/parcels/osaf/dumpreload.py (16045 => 16046)

--- branches/detail_layout/chandler/parcels/osaf/dumpreload.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/parcels/osaf/dumpreload.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -133,39 +133,41 @@
     # XXX before we got here, so the caller should be prepared to handle that.
     output = os.fdopen(os.open(filename, flags, 0600), 'wb')
     try:
-        dump = serializer.dumper(output)
+        try:
+            dump = serializer.dumper(output)
 
-        if activity:
-            count = len(aliases)
-            activity.update(msg=_(u"Exporting %(total)d records") % {'total':count}, totalWork=count)
-
-        i = 0
-        for alias in aliases:
-            uuid = trans.getUUIDForAlias(alias)
-            item = rv.findUUID(uuid)
-            for record in trans.exportItem(item):
-                dump(record)
-            i += 1
             if activity:
-                activity.update(msg=_(u"Exported %(number)d of %(total)d items") % \
-                                {'number':i, 'total':count}, work=1)
+                count = len(aliases)
+                activity.update(msg=_(u"Exporting %(total)d records") % {'total':count}, totalWork=count)
 
-        if activity:
-            activity.update(totalWork=None) # we don't know upcoming total work
+            i = 0
+            for alias in aliases:
+                uuid = trans.getUUIDForAlias(alias)
+                item = rv.findUUID(uuid)
+                for record in trans.exportItem(item):
+                    dump(record)
+                i += 1
+                if activity:
+                    activity.update(msg=_(u"Exported %(number)d of %(total)d items") % \
+                                    {'number':i, 'total':count}, work=1)
 
-        for record in trans.finishExport():
             if activity:
-                count += 1
-                activity.update(msg=_(u"Exporting additional record"))
+                activity.update(totalWork=None) # we don't know upcoming total work
 
-            dump(record)
+            for record in trans.finishExport():
+                if activity:
+                    count += 1
+                    activity.update(msg=_(u"Exporting additional record"))
 
-        dump(None)
-        del dump
-    except ActivityAborted:
+                dump(record)
+
+            dump(None)
+            del dump
+        finally:
+            output.close()
+    except:
+        logger.exception("Error during export")
         os.remove(filename)
-    finally:
-        output.close()
 
     if activity:
         activity.update(msg=_(u"Exported %(total)d records") % {'total':count})

Modified: branches/detail_layout/chandler/parcels/osaf/framework/blocks/MenusAndToolbars.py (16045 => 16046)

--- branches/detail_layout/chandler/parcels/osaf/framework/blocks/MenusAndToolbars.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/parcels/osaf/framework/blocks/MenusAndToolbars.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -327,7 +327,12 @@
             control = wxQuickEntry (self.parentBlock.widget,
                                     self.getWidgetID(),
                                     style = wx.TE_PROCESS_ENTER)
-            control.SetName (self.blockName)
+            # On platforms other than macintosh the text control is a child of the wxSearchCtrl.
+            if wx.Platform == '__WXMAC__':
+                textCtrl = control
+            else:
+                textCtrl = control.GetChildren() [0]
+            textCtrl.SetName (self.blockName)
             # Apparently on Macintosh the selection starts out random, which causes it to crash
             # when setting text because it trys to delete characters that don't exist
             control.SetSelection (0, 0)

Modified: branches/detail_layout/chandler/parcels/osaf/framework/script_recording/__init__.py (16045 => 16046)

--- branches/detail_layout/chandler/parcels/osaf/framework/script_recording/__init__.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/parcels/osaf/framework/script_recording/__init__.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -211,7 +211,7 @@
             if dialog.ShowModal () == wx.ID_OK:
                 # Finish the script
                 if self.typingSequence is not None:
-                    self.comments += "        Type %s (%d)%c" % \
+                    self.comments += "        Type %s (%d)%s" % \
                         (self.valueToString (self.typingSequence),
                          self.startTypingLineNumber,
                          os.linesep)
@@ -303,7 +303,7 @@
                         self.typingSequence += unichr (event.UnicodeKey)
                 else:
                     if self.typingSequence is not None:
-                        self.comments += "        Type %s (%d)%c" % \
+                        self.comments += "        Type %s (%d)%s" % \
                             (self.valueToString (self.typingSequence),
                              self.startTypingLineNumber,
                              os.linesep)
@@ -338,17 +338,17 @@
                             else:
                                 assert False, "Didn't find expected menu in menuBar"
 
-                            self.comments += "        Choose menu '%s' (%d)%c" % \
+                            self.comments += "        Choose menu '%s' (%d)%s" % \
                                 (menuName, self.lineNumber, os.linesep)
                         elif isinstance (widget, wx.ToolBarTool):
                             toolBar = widget.GetToolBar()
                             toolIndex = toolBar.GetToolPos (widget.GetId())
 
-                            self.comments += "        Choose toolbar button '%s' (%d)%c" % \
+                            self.comments += "        Choose toolbar button '%s' (%d)%s" % \
                                 (widget.GetLabel(), self.lineNumber, os.linesep)
                 
                     elif eventType == "wx.EVT_LEFT_DOWN":
-                        self.comments += "        Left Mouse Down in " + sentToName + os.linesep
+                        self.comments += "        Left Mouse Down in %s (%d)%s" % (sentToName, self.lineNumber, os.linesep)
                     elif eventType == "wx.EVT_LEFT_DCLICK":
                         self.comments += "        Left Mouse Double Click in " + sentToName + os.linesep
 
@@ -398,13 +398,6 @@
 
                         focusWindow = wx.Window_FindFocus()
                         
-                        if wx.Platform != "__WXMAC__":
-                            # On platforms other than mac the focus window is a wx.TextCtrl
-                            # whose parent is the wx.SearchCtrl
-                            parentWidget = focusWindow.GetParent()
-                            if isinstance (parentWidget, wx.SearchCtrl):
-                                focusWindow = parentWidget
-
                         # Record the focus for verification on playback only for certain
                         # types of events
                         if (eventType in checkFocusEventTypes):

Modified: branches/detail_layout/chandler/parcels/osaf/framework/script_recording/script_lib.py (16045 => 16046)

--- branches/detail_layout/chandler/parcels/osaf/framework/script_recording/script_lib.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/parcels/osaf/framework/script_recording/script_lib.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -65,11 +65,6 @@
     if isinstance (sentToWidget, wx.ToolBarTool):
         assert sentToWidget.IsControl()
         sentToWidget = sentToWidget.GetControl()
-        # On platforms other than mac wx.SearchCtrl's child is the wx.TextCtrl
-        # rather than the wx.SearchCtrl itself.
-        if wx.Platform != "__WXMAC__":
-            if isinstance (sentToWidget, wx.SearchCtrl):
-                sentToWidget = sentToWidget.GetChildren()[0]
 
     elif isinstance (sentToWidget, wx.MenuItem):
         assert sentToWidget.IsSubMenu()
@@ -143,20 +138,6 @@
             recordedFocusWindowClass = properties["recordedFocusWindowClass"]
             focusWindow = wx.Window_FindFocus()
             
-            if wx.Platform != "__WXMAC__" and focusWindow is not None:
-                # On platforms other than mac the focus window is a wx.TextCtrl
-                # whose parent is the wx.SearchCtrl. Go dig out the toolbar item
-                # corresponding to the wx.SearchCtrl.
-                parentWidget = focusWindow.GetParent()
-                if isinstance (parentWidget, wx.SearchCtrl):
-                    focusWindow = parentWidget
-
-            # Rarely, a block has more than one widget associated with it, e.g. a toolBarItem
-            # with a wx.SearchCtrl. If we get the widget associated with out block, we'll always
-            # get the same widget in the case of multiple widgets per blocks.
-            if hasattr (focusWindow, "blockItem"):
-                focusWindow = focusWindow.blockItem.widget
-
             # On Macintosh there is a setting under SystemPreferences>Keyboar&Mouse>KeyboardShortcuts
             # neare the bottom of the page titled "Full Keyboard Access" that defaults to
             # not letting you set the focus to certain controls, e.g. CheckBoxes. So we

Modified: branches/detail_layout/chandler/repository/item/Indexed.py (16045 => 16046)

--- branches/detail_layout/chandler/repository/item/Indexed.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/repository/item/Indexed.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -239,6 +239,27 @@
         self._indexes[indexName] = index
         return index
 
+    def rebuildIndex(self, name, subIndexes=True):
+        """
+        Rebuild an index on this collection.
+
+        If the constraints on an index change without the index noticing, as
+        for example, when a locale change causes a sorted index to go out of
+        order, this method allows the index to be rebuilt. It iterates the
+        entire collection, avoiding existing indexes and rebuilds the named
+        index anew. By default, sub-indexes of the index are rebuilt as well.
+
+        @param name: the name of the index to be rebuilt
+        @param subIndexes: rebuild sub-indexes of the index as well, C{True}
+                           by default
+        @return: the new index object
+        """
+
+        item, attrName = self.itsOwner
+        index = self.getIndex(name)
+
+        return self._rebuildIndex(None, index, item, attrName, name, subIndexes)
+
     def setRanges(self, indexName, ranges):
 
         self.getIndex(indexName).setRanges(ranges)
@@ -743,9 +764,10 @@
 
     def _rebuildIndex(self, logger, index, item, attribute, name,
                       subIndexes=True):
-        
-        logger.warning("Rebuilding index '%s' installed on value '%s' of type %s in attribute '%s' on %s", name, self, type(self), attribute, item._repr_())
 
+        if logger is not None:
+            logger.warning("Rebuilding index '%s' installed on value '%s' of type %s in attribute '%s' on %s", name, self, type(self), attribute, item._repr_())
+
         view = item.itsView
         kwds = index.getInitKeywords()
         if 'ranges' in kwds:

Modified: branches/detail_layout/chandler/repository/persistence/LuceneContainer.py (16045 => 16046)

--- branches/detail_layout/chandler/repository/persistence/LuceneContainer.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/repository/persistence/LuceneContainer.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -24,7 +24,6 @@
 initVM(CLASSPATH, maxstack='2m')
 
 from chandlerdb.util.c import UUID
-from chandlerdb.persistence.c import DBLockDeadlockError, DBInvalidArgError
 
 from repository.persistence.FileContainer import FileContainer, RepositoryError
 from repository.persistence.DBContainer import VersionContainer

Modified: branches/detail_layout/chandler/repository/persistence/Repository.py (16045 => 16046)

--- branches/detail_layout/chandler/repository/persistence/Repository.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/repository/persistence/Repository.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -356,7 +356,11 @@
     def run(self):
 
         from lucene import getVMEnv
-        getVMEnv().attachCurrentThread()
+        env = getVMEnv()
+        if env is not None:
+            env.attachCurrentThread()
+        self._vmEnv = env
+
         super(RepositoryThread, self).run()
 
 

Modified: branches/detail_layout/chandler/tools/createBase.py (16045 => 16046)

--- branches/detail_layout/chandler/tools/createBase.py	2007-12-05 01:52:51 UTC (rev 16045)
+++ branches/detail_layout/chandler/tools/createBase.py	2007-12-05 18:30:35 UTC (rev 16046)
@@ -54,11 +54,16 @@
             self.CHANDLERHOME = getCommand(['cygpath', '-a', self.CHANDLERHOME])
             self.CHANDLERBIN  = getCommand(['cygpath', '-a', self.CHANDLERBIN])
 
+        if isWindows:
+            pyScript = 'RunPython.bat'
+        else:
+            pyScript = 'RunPython'
+
         try:
-            if "release" in os.listdir(self.CHANDLERBIN):
+            if "release" in os.listdir(self.CHANDLERBIN) and os.path.exists(os.path.join(self.CHANDLERBIN, "release", pyScript)):
                 self.BINROOT = os.path.join(self.CHANDLERBIN, "release")
 
-            elif "debug" in os.listdir(self.CHANDLERBIN):
+            elif "debug" in os.listdir(self.CHANDLERBIN) and os.path.exists(os.path.join(self.CHANDLERBIN, "debug", pyScript)):
                 self.BINROOT = os.path.join(self.CHANDLERBIN, "debug")
 
             else:
@@ -66,10 +71,7 @@
         except:
             self.raiseError("CHANDLERBIN is invalid '%s'." % self.CHANDLERBIN)
 
-        if isWindows:
-            self.PYTHON = os.path.join(self.BINROOT, "RunPython.bat")
-        else:
-            self.PYTHON = os.path.join(self.BINROOT, "RunPython")
+        self.PYTHON = os.path.join(self.BINROOT, pyScript)
 
     def checkPOFile(self, poFileName):
         try:




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to