|
hat stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
|
| us |
hat stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Tue, 18 Feb, 17:56 |
| us |
hat stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Tue, 18 Feb, 17:56 |
|
hat stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Tue, 18 Feb, 17:56 |
|
alog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
|
|
alog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Thu, 03 Oct, 23:00 |
|
alog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Thu, 03 Oct, 23:00 |
|
nCommand
- self.jabberClient.Login()
+ from OSAF.framework.blocks.Block import Block, BlockEvent
+ from OSAF.framework.notifications.Notification import Notification
- # start the agent manager
- from OSAF.framework.agents.AgentManager import AgentManager
- Globals.agentManager = AgentManager()
- Globals.agentManager.Startup()
+ wxID = event.GetId()
+ if wxID >= Block.MINIMUM_WX_ID and wxID <= Block.MAXIMUM_WX_ID:
+ blockEvent = Block.wxIDToObject (wxID)
+
+ if isinstance (blockEvent, BlockEvent):
+ assert isinstance (blockEvent, BlockEvent)
+ if event.GetEventType() == wxEVT_UPDATE_UI:
+ data = {'type':'UpdateUI'}
+ else:
+ data = {'type':'Normal'}
- #self.OpenStartingURL()
+ notification = Notification(blockEvent, None, None)
+ notification.SetData(data)
+ Globals.notificationManager.PostNotification (notification)
+ if event.GetEventType() == wxEVT_UPDATE_UI:
+ try:
+ event.Check (data ['Check'])
+ except KeyError:
+ pass
+ try:
+ event.Enable (data ['Enable'])
+ except KeyError:
+ pass
+ try:
+ text = data ['Text']
+ eventObject = event.GetEventObject()
+ event.SetText (data ['Text'])
+ except KeyError:
+ pass
+ return
+ event.Skip()
- return true #indicates we succeeded with initialization
+ def OnIdle(self, event):
+ """
+ Adding a handler for catching a set focus event doesn't catch
+ every change to the focus. It's difficult to preprocess every event
+ so we check for focus changes in OnIdle
+ """
+ focus = wxWindow_FindFocus()
+ if self.focus != focus:
+ self.focus = focus
+ Globals.mainView.onSetFocus()
+ event.Skip()
- def OnTerminate(self):
+ def OnExit(self):
"""
Main application termination.
"""
@@ -364,36 +283,8 @@
need to add a final commit when the application quits to save data the
state of the user's world, e.g. window location and size.
"""
- self.repository.commit(purge=True)
- self.repository.close()
- del self.applicationResources
-
- def OpenStartingURL(self):
- """
- Opens the proper url when the application first starts. If
- this is the first time running, then we just take the first item
- in the URLTree. If we have persisted, then we use the last
- remembered url.
- """
- if not hasattr(self, 'wxMainFrame'):
- self.wxMainFrame = app.association[id(self.model.mainFrame)]
- url = self.wxMainFrame.navigationBar.model.GetCurrentURL()
- if url != None:
- url = app.jabberClient.StripRemoteIfNecessary(url)
- self.wxMainFrame.GoToURL(url, false)
- else:
- children = self.model.URLTree.GetURLChildren('')
- if len(children) > 0:
- self.wxMainFrame.GoToURL(children[0], true)
-
- def OnQuit(self, event):
- """
- Exit the application
- """
- # FIXME: This will not fully quit the app if a stdout window has been
- # opened by a print statement. We should also close that stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
|
| m |
nCommand
- self.jabberClient.Login()
+ from OSAF.framework.blocks.Block import Block, BlockEvent
+ from OSAF.framework.notifications.Notification import Notification
- # start the agent manager
- from OSAF.framework.agents.AgentManager import AgentManager
- Globals.agentManager = AgentManager()
- Globals.agentManager.Startup()
+ wxID = event.GetId()
+ if wxID >= Block.MINIMUM_WX_ID and wxID <= Block.MAXIMUM_WX_ID:
+ blockEvent = Block.wxIDToObject (wxID)
+
+ if isinstance (blockEvent, BlockEvent):
+ assert isinstance (blockEvent, BlockEvent)
+ if event.GetEventType() == wxEVT_UPDATE_UI:
+ data = {'type':'UpdateUI'}
+ else:
+ data = {'type':'Normal'}
- #self.OpenStartingURL()
+ notification = Notification(blockEvent, None, None)
+ notification.SetData(data)
+ Globals.notificationManager.PostNotification (notification)
+ if event.GetEventType() == wxEVT_UPDATE_UI:
+ try:
+ event.Check (data ['Check'])
+ except KeyError:
+ pass
+ try:
+ event.Enable (data ['Enable'])
+ except KeyError:
+ pass
+ try:
+ text = data ['Text']
+ eventObject = event.GetEventObject()
+ event.SetText (data ['Text'])
+ except KeyError:
+ pass
+ return
+ event.Skip()
- return true #indicates we succeeded with initialization
+ def OnIdle(self, event):
+ """
+ Adding a handler for catching a set focus event doesn't catch
+ every change to the focus. It's difficult to preprocess every event
+ so we check for focus changes in OnIdle
+ """
+ focus = wxWindow_FindFocus()
+ if self.focus != focus:
+ self.focus = focus
+ Globals.mainView.onSetFocus()
+ event.Skip()
- def OnTerminate(self):
+ def OnExit(self):
"""
Main application termination.
"""
@@ -364,36 +283,8 @@
need to add a final commit when the application quits to save data the
state of the user's world, e.g. window location and size.
"""
- self.repository.commit(purge=True)
- self.repository.close()
- del self.applicationResources
-
- def OpenStartingURL(self):
- """
- Opens the proper url when the application first starts. If
- this is the first time running, then we just take the first item
- in the URLTree. If we have persisted, then we use the last
- remembered url.
- """
- if not hasattr(self, 'wxMainFrame'):
- self.wxMainFrame = app.association[id(self.model.mainFrame)]
- url = self.wxMainFrame.navigationBar.model.GetCurrentURL()
- if url != None:
- url = app.jabberClient.StripRemoteIfNecessary(url)
- self.wxMainFrame.GoToURL(url, false)
- else:
- children = self.model.URLTree.GetURLChildren('')
- if len(children) > 0:
- self.wxMainFrame.GoToURL(children[0], true)
-
- def OnQuit(self, event):
- """
- Exit the application
- """
- # FIXME: This will not fully quit the app if a stdout window has been
- # opened by a print statement. We should also close that stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Fri, 17 Sep, 18:43 |
|
method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
|
| lt |
method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Tue, 19 Apr, 06:07 |
|
dow.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
|
|
dow.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Mon, 08 Nov, 16:33 |
|
ror:
+ pass
+ try:
+ text = data ['Text']
+ eventObject = event.GetEventObject()
+ event.SetText (data ['Text'])
+ except KeyError:
+ pass
+ return
+ event.Skip()
- return true #indicates we succeeded with initialization
+ def OnIdle(self, event):
+ """
+ Adding a handler for catching a set focus event doesn't catch
+ every change to the focus. It's difficult to preprocess every event
+ so we check for focus changes in OnIdle
+ """
+ focus = wxWindow_FindFocus()
+ if self.focus != focus:
+ self.focus = focus
+ Globals.mainView.onSetFocus()
+ event.Skip()
- def OnTerminate(self):
+ def OnExit(self):
"""
Main application termination.
"""
@@ -364,36 +283,8 @@
need to add a final commit when the application quits to save data the
state of the user's world, e.g. window location and size.
"""
- self.repository.commit(purge=True)
- self.repository.close()
- del self.applicationResources
-
- def OpenStartingURL(self):
- """
- Opens the proper url when the application first starts. If
- this is the first time running, then we just take the first item
- in the URLTree. If we have persisted, then we use the last
- remembered url.
- """
- if not hasattr(self, 'wxMainFrame'):
- self.wxMainFrame = app.association[id(self.model.mainFrame)]
- url = self.wxMainFrame.navigationBar.model.GetCurrentURL()
- if url != None:
- url = app.jabberClient.StripRemoteIfNecessary(url)
- self.wxMainFrame.GoToURL(url, false)
- else:
- children = self.model.URLTree.GetURLChildren('')
- if len(children) > 0:
- self.wxMainFrame.GoToURL(children[0], true)
-
- def OnQuit(self, event):
- """
- Exit the application
- """
- # FIXME: This will not fully quit the app if a stdout window has been
- # opened by a print statement. We should also close that stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
|
|
ror:
+ pass
+ try:
+ text = data ['Text']
+ eventObject = event.GetEventObject()
+ event.SetText (data ['Text'])
+ except KeyError:
+ pass
+ return
+ event.Skip()
- return true #indicates we succeeded with initialization
+ def OnIdle(self, event):
+ """
+ Adding a handler for catching a set focus event doesn't catch
+ every change to the focus. It's difficult to preprocess every event
+ so we check for focus changes in OnIdle
+ """
+ focus = wxWindow_FindFocus()
+ if self.focus != focus:
+ self.focus = focus
+ Globals.mainView.onSetFocus()
+ event.Skip()
- def OnTerminate(self):
+ def OnExit(self):
"""
Main application termination.
"""
@@ -364,36 +283,8 @@
need to add a final commit when the application quits to save data the
state of the user's world, e.g. window location and size.
"""
- self.repository.commit(purge=True)
- self.repository.close()
- del self.applicationResources
-
- def OpenStartingURL(self):
- """
- Opens the proper url when the application first starts. If
- this is the first time running, then we just take the first item
- in the URLTree. If we have persisted, then we use the last
- remembered url.
- """
- if not hasattr(self, 'wxMainFrame'):
- self.wxMainFrame = app.association[id(self.model.mainFrame)]
- url = self.wxMainFrame.navigationBar.model.GetCurrentURL()
- if url != None:
- url = app.jabberClient.StripRemoteIfNecessary(url)
- self.wxMainFrame.GoToURL(url, false)
- else:
- children = self.model.URLTree.GetURLChildren('')
- if len(children) > 0:
- self.wxMainFrame.GoToURL(children[0], true)
-
- def OnQuit(self, event):
- """
- Exit the application
- """
- # FIXME: This will not fully quit the app if a stdout window has been
- # opened by a print statement. We should also close that stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Thu, 29 Jul, 13:31 |
|
Globals.mainView.onSetFocus()
+ event.Skip()
- def OnTerminate(self):
+ def OnExit(self):
"""
Main application termination.
"""
@@ -364,36 +283,8 @@
need to add a final commit when the application quits to save data the
state of the user's world, e.g. window location and size.
"""
- self.repository.commit(purge=True)
- self.repository.close()
- del self.applicationResources
-
- def OpenStartingURL(self):
- """
- Opens the proper url when the application first starts. If
- this is the first time running, then we just take the first item
- in the URLTree. If we have persisted, then we use the last
- remembered url.
- """
- if not hasattr(self, 'wxMainFrame'):
- self.wxMainFrame = app.association[id(self.model.mainFrame)]
- url = self.wxMainFrame.navigationBar.model.GetCurrentURL()
- if url != None:
- url = app.jabberClient.StripRemoteIfNecessary(url)
- self.wxMainFrame.GoToURL(url, false)
- else:
- children = self.model.URLTree.GetURLChildren('')
- if len(children) > 0:
- self.wxMainFrame.GoToURL(children[0], true)
-
- def OnQuit(self, event):
- """
- Exit the application
- """
- # FIXME: This will not fully quit the app if a stdout window has been
- # opened by a print statement. We should also close that stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
|
| <Catherine.No...@awl.com> |
Globals.mainView.onSetFocus()
+ event.Skip()
- def OnTerminate(self):
+ def OnExit(self):
"""
Main application termination.
"""
@@ -364,36 +283,8 @@
need to add a final commit when the application quits to save data the
state of the user's world, e.g. window location and size.
"""
- self.repository.commit(purge=True)
- self.repository.close()
- del self.applicationResources
-
- def OpenStartingURL(self):
- """
- Opens the proper url when the application first starts. If
- this is the first time running, then we just take the first item
- in the URLTree. If we have persisted, then we use the last
- remembered url.
- """
- if not hasattr(self, 'wxMainFrame'):
- self.wxMainFrame = app.association[id(self.model.mainFrame)]
- url = self.wxMainFrame.navigationBar.model.GetCurrentURL()
- if url != None:
- url = app.jabberClient.StripRemoteIfNecessary(url)
- self.wxMainFrame.GoToURL(url, false)
- else:
- children = self.model.URLTree.GetURLChildren('')
- if len(children) > 0:
- self.wxMainFrame.GoToURL(children[0], true)
-
- def OnQuit(self, event):
- """
- Exit the application
- """
- # FIXME: This will not fully quit the app if a stdout window has been
- # opened by a print statement. We should also close that stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Fri, 19 Jun, 18:20 |
|
tup()
+ wxID = event.GetId()
+ if wxID >= Block.MINIMUM_WX_ID and wxID <= Block.MAXIMUM_WX_ID:
+ blockEvent = Block.wxIDToObject (wxID)
+
+ if isinstance (blockEvent, BlockEvent):
+ assert isinstance (blockEvent, BlockEvent)
+ if event.GetEventType() == wxEVT_UPDATE_UI:
+ data = {'type':'UpdateUI'}
+ else:
+ data = {'type':'Normal'}
- #self.OpenStartingURL()
+ notification = Notification(blockEvent, None, None)
+ notification.SetData(data)
+ Globals.notificationManager.PostNotification (notification)
+ if event.GetEventType() == wxEVT_UPDATE_UI:
+ try:
+ event.Check (data ['Check'])
+ except KeyError:
+ pass
+ try:
+ event.Enable (data ['Enable'])
+ except KeyError:
+ pass
+ try:
+ text = data ['Text']
+ eventObject = event.GetEventObject()
+ event.SetText (data ['Text'])
+ except KeyError:
+ pass
+ return
+ event.Skip()
- return true #indicates we succeeded with initialization
+ def OnIdle(self, event):
+ """
+ Adding a handler for catching a set focus event doesn't catch
+ every change to the focus. It's difficult to preprocess every event
+ so we check for focus changes in OnIdle
+ """
+ focus = wxWindow_FindFocus()
+ if self.focus != focus:
+ self.focus = focus
+ Globals.mainView.onSetFocus()
+ event.Skip()
- def OnTerminate(self):
+ def OnExit(self):
"""
Main application termination.
"""
@@ -364,36 +283,8 @@
need to add a final commit when the application quits to save data the
state of the user's world, e.g. window location and size.
"""
- self.repository.commit(purge=True)
- self.repository.close()
- del self.applicationResources
-
- def OpenStartingURL(self):
- """
- Opens the proper url when the application first starts. If
- this is the first time running, then we just take the first item
- in the URLTree. If we have persisted, then we use the last
- remembered url.
- """
- if not hasattr(self, 'wxMainFrame'):
- self.wxMainFrame = app.association[id(self.model.mainFrame)]
- url = self.wxMainFrame.navigationBar.model.GetCurrentURL()
- if url != None:
- url = app.jabberClient.StripRemoteIfNecessary(url)
- self.wxMainFrame.GoToURL(url, false)
- else:
- children = self.model.URLTree.GetURLChildren('')
- if len(children) > 0:
- self.wxMainFrame.GoToURL(children[0], true)
-
- def OnQuit(self, event):
- """
- Exit the application
- """
- # FIXME: This will not fully quit the app if a stdout window has been
- # opened by a print statement. We should also close that stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
|
| <bruno_lo...@terra.com.br> |
tup()
+ wxID = event.GetId()
+ if wxID >= Block.MINIMUM_WX_ID and wxID <= Block.MAXIMUM_WX_ID:
+ blockEvent = Block.wxIDToObject (wxID)
+
+ if isinstance (blockEvent, BlockEvent):
+ assert isinstance (blockEvent, BlockEvent)
+ if event.GetEventType() == wxEVT_UPDATE_UI:
+ data = {'type':'UpdateUI'}
+ else:
+ data = {'type':'Normal'}
- #self.OpenStartingURL()
+ notification = Notification(blockEvent, None, None)
+ notification.SetData(data)
+ Globals.notificationManager.PostNotification (notification)
+ if event.GetEventType() == wxEVT_UPDATE_UI:
+ try:
+ event.Check (data ['Check'])
+ except KeyError:
+ pass
+ try:
+ event.Enable (data ['Enable'])
+ except KeyError:
+ pass
+ try:
+ text = data ['Text']
+ eventObject = event.GetEventObject()
+ event.SetText (data ['Text'])
+ except KeyError:
+ pass
+ return
+ event.Skip()
- return true #indicates we succeeded with initialization
+ def OnIdle(self, event):
+ """
+ Adding a handler for catching a set focus event doesn't catch
+ every change to the focus. It's difficult to preprocess every event
+ so we check for focus changes in OnIdle
+ """
+ focus = wxWindow_FindFocus()
+ if self.focus != focus:
+ self.focus = focus
+ Globals.mainView.onSetFocus()
+ event.Skip()
- def OnTerminate(self):
+ def OnExit(self):
"""
Main application termination.
"""
@@ -364,36 +283,8 @@
need to add a final commit when the application quits to save data the
state of the user's world, e.g. window location and size.
"""
- self.repository.commit(purge=True)
- self.repository.close()
- del self.applicationResources
-
- def OpenStartingURL(self):
- """
- Opens the proper url when the application first starts. If
- this is the first time running, then we just take the first item
- in the URLTree. If we have persisted, then we use the last
- remembered url.
- """
- if not hasattr(self, 'wxMainFrame'):
- self.wxMainFrame = app.association[id(self.model.mainFrame)]
- url = self.wxMainFrame.navigationBar.model.GetCurrentURL()
- if url != None:
- url = app.jabberClient.StripRemoteIfNecessary(url)
- self.wxMainFrame.GoToURL(url, false)
- else:
- children = self.model.URLTree.GetURLChildren('')
- if len(children) > 0:
- self.wxMainFrame.GoToURL(children[0], true)
-
- def OnQuit(self, event):
- """
- Exit the application
- """
- # FIXME: This will not fully quit the app if a stdout window has been
- # opened by a print statement. We should also close that stdout window.
- self.wxMainFrame.Close()
- Globals.agentManager.Shutdown()
+ Globals.repository.commit(purge=True)
+ Globals.repository.close()
def OnMainThreadCallbackEvent(self, event):
"""
@@ -403,291 +294,6 @@
event.lock.release()
event.Skip()
- def OnAbout(self, event):
- """
- Show the splash screen in response to the about command
- """
-
- pageLocation = os.path.join ('application', 'welcome.html')
- splash = SplashScreen(app.wxMainFrame, _("About Chandler"),
- pageLocation, True, False)
- splash.ShowModal()
- splash.Destroy()
-
- def OnPreferences(self, event):
- """
- Show the preferences dialog
- """
- title = _("Chandler Preferences")
- dialog = PreferencesDialog.PreferencesDialog(app.wxMainFrame, title, self.model.preferences)
-
- result = dialog.ShowModal()
- if result == wxID_OK:
- dialog.SavePreferences()
- self.HandleSystemPreferences()
- dialog.Destroy()
-
- def LoadParcelsV2InDirectory (self, baseDir, relDir=""):
- """
- Load the parcels and call the class method to install them. Parcels
- are Python Packages and are defined by directories that contain
- __init__.py (or __init__.pyc). __init__.py must assign the parcel's
- class name to parcelClass. For example:
-
- parcelClass = 'CalendarFile.CalendarClass'
-
- CalendarFile is the python file (without the .py extension) that
- contains the class CalendarClass contained in the file which is
- the parcel class.
-
- For examples, look in the parcel directory.
-
- The method now takes two directory arguments, baseDir and relDir.
- baseDir should be a directory containing parcel subdirectories,
- while relDir is only used when recursing through directories below
- baseDir.
- """
- path = os.path.join(baseDir, relDir)
- assert (os.path.exists (path) and os.path.isdir(path))
-
- if (relDir and \
- (os.path.exists(os.path.join (path, "__init__.py")) or \
- os.path.exists(os.path.join (path, "__init__.pyc")) or \
- os.path.exists(os.path.join (path, "__init__.pyo"))) \
- ):
- importArgument = relDir.replace (os.sep, '.')
- """
- Import the parcel, which should define parcelClass.
-
- If you get an error like: Import can't find module,
- or can't find name in module: No module named XYZ.XYZ
- on the following statement, you probablyf startTLS(self, ctx):
+ assert not self.TLS
+ self.stopReading()
+ self.stopWriting()
+- self._startTLS()
+- self.socket = SSL.Connection(ctx.getContext(), self.soc-25foundation.org> |
Sat, 25 Apr, 01:55 |