[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/designer/src Instance.py
From: |
Jason Cater |
Subject: |
gnue/designer/src Instance.py |
Date: |
Sun, 29 Jul 2001 21:38:49 -0700 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/07/29 21:38:49
Modified files:
designer/src : Instance.py
Log message:
now, when saving, a backup copy is made only once per session (per
form) instead of after each save; this way, the backup copy contains the state
of a form before you started editing this session instead of the state the last
time you saved.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/Instance.py.diff?cvsroot=OldCVS&tr1=1.21&tr2=1.22&r1=text&r2=text
Patches:
Index: gnue/designer/src/Instance.py
diff -u gnue/designer/src/Instance.py:1.21 gnue/designer/src/Instance.py:1.22
--- gnue/designer/src/Instance.py:1.21 Sun Jul 29 13:18:55 2001
+++ gnue/designer/src/Instance.py Sun Jul 29 21:38:49 2001
@@ -58,6 +58,7 @@
RuntimeSettings.registerRuntimeSettingHandler(self, self)
self._isdirty = 0
+ self._makeBackup = 1
self._app = app
self._lastGenericNameSeq = {}
@@ -289,17 +290,20 @@
location = self._path
fileHandle = None
fileHandle2 = None
- try:
- fileHandle = open(location,'r')
- fileHandle2 = open(location + "~",'w')
- fileHandle2.writelines(fileHandle.readlines())
- except:
- pass
- else:
- if fileHandle != None:
- fileHandle.close()
- if fileHandle2 != None:
- fileHandle2.close()
+ if self._makeBackup:
+ try:
+ fileHandle = open(location,'r')
+ fileHandle2 = open(location + "~",'w')
+ fileHandle2.writelines(fileHandle.readlines())
+ except:
+ pass
+ else:
+ if fileHandle != None:
+ fileHandle.close()
+ if fileHandle2 != None:
+ fileHandle2.close()
+
+ self._makeBackup = 0
options = []
imports = []