|
From: <di...@us...> - 2007-11-07 14:15:24
|
Revision: 561
http://safekeep.svn.sourceforge.net/safekeep/?rev=561&view=rev
Author: dimi
Date: 2007-11-07 06:15:06 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
Provide Python 2.2 compatibility based on a suggestion
from Gert <ger...@ta...>.
Modified Paths:
--------------
safekeep/trunk/safekeep
Modified: safekeep/trunk/safekeep
===================================================================
--- safekeep/trunk/safekeep 2007-10-19 17:43:35 UTC (rev 560)
+++ safekeep/trunk/safekeep 2007-11-07 14:15:06 UTC (rev 561)
@@ -19,7 +19,30 @@
import commands, tempfile, time, traceback
import getpass, pwd, xml.dom.minidom
import socket, smtplib
+from __future__ import generators
+######################################################################
+# Python 2.2 compatibility
+######################################################################
+# There is no guarantee that we'll continue supporting Python 2.2
+# indefinitely, but we make a reasonable effor to do so as long as
+# it doesn't result in major complication/ugliness.
+
+try:
+ True, False
+except NameError:
+ True, False = 1, 0
+
+def enumerate(obj):
+ i = -1
+ for item in obj:
+ i += 1
+ yield i, item
+
+######################################################################
+# Global settings
+######################################################################
+
config_file = '/etc/safekeep/safekeep.conf'
config_ext = '.backup'
logbuf = []
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|