dabo Commit
Revision 4927
Date: 2009-01-11 20:25:42 -0800 (Sun, 11 Jan 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/4927
Changed:
U trunk/dabo/dApp.py
U trunk/dabo/ui/uiwx/uiApp.py
Log:
Improved the reload() functionality to better handle changes on the server.
Added the resyncFiles() method to dApp(). This is needed for reloading parts of
the app while the app is running.
Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py 2009-01-12 04:23:01 UTC (rev 4926)
+++ trunk/dabo/dApp.py 2009-01-12 04:25:42 UTC (rev 4927)
@@ -257,8 +257,21 @@
self._afterInit()
self.autoBindEvents()
-
+
+ def resyncFiles(self):
+ """ In the middle of an app's lifetime, files on the remote
server may
+ have been updated. This will ensure that the local copy is in
sync.
+ """
+ rp = self._RemoteProxy
+ if rp:
+ try:
+ rp.syncFiles()
+ except urllib2.URLError, e:
+ # Cannot sync; record the error and move on
+ dabo.errorLog.write(_("File re-sync failed.
Reason: %s") % e)
+
+
def __del__(self):
"""Make sure that temp files are removed"""
self._tempFileHolder.release()
Modified: trunk/dabo/ui/uiwx/uiApp.py
===================================================================
--- trunk/dabo/ui/uiwx/uiApp.py 2009-01-12 04:23:01 UTC (rev 4926)
+++ trunk/dabo/ui/uiwx/uiApp.py 2009-01-12 04:25:42 UTC (rev 4927)
@@ -1017,6 +1017,7 @@
except AttributeError:
dabo.errorLog.write(_("Only .cdxml forms can be
re-loaded"))
return
+ self.dApp.resyncFiles()
frm.lockDisplay()
# Store the old form's bizobj dict
bizDict = frm.bizobjs
@@ -1027,6 +1028,7 @@
newForm.bizobjs = bizDict
newForm.PrimaryBizobj = bizPrimary
dabo.ui.callAfter(frm.release)
+ newForm.update()
newForm.show()
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]