[PATCH 1/3] Refactor raw print statements in accordance with 2to3

"R. Tyler Ballance" <[email protected]> Mon, 9 Nov 2009 09:13:16 -0800
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
Removed prints in a couple places entirely, some of this
code should likely use the `logging` module instead
---
 SetupConfig.py                       |    2 +-
 SetupTools.py                        |   12 +++++-----
 cheetah/CheetahWrapper.py            |    8 +++---
 cheetah/Filters.py                   |   24 ++++++++++----------
 cheetah/ImportManager.py             |    4 +-
 cheetah/NameMapper.py                |   14 ++++++------
 cheetah/Parser.py                    |   15 ++++--------
 cheetah/Template.py                  |    2 +-
 cheetah/TemplateCmdLineIface.py      |    8 +++---
 cheetah/Templates/_SkeletonPage.py   |    2 +-
 cheetah/Tests/CheetahWrapper.py      |    4 +-
 cheetah/Tests/Filters.py             |    2 +-
 cheetah/Tests/Performance.py         |    8 +++---
 cheetah/Tests/Regressions.py         |    2 +-
 cheetah/Tests/SyntaxAndOutput.py     |    2 +-
 cheetah/Tests/Template.py            |    4 +-
 cheetah/Tests/unittest_local_copy.py |    4 +-
 cheetah/Tests/xmlrunner.py           |    4 +-
 cheetah/Tools/SiteHierarchy.py       |   10 ++++----
 cheetah/Utils/memcache.py            |   39 +++++++++++++++------------------
 cheetah/Utils/statprof.py            |   16 +++++++-------
 cheetah/Version.py                   |   10 ++++----
 22 files changed, 94 insertions(+), 102 deletions(-)

diff --git a/SetupConfig.py b/SetupConfig.py
index c95001d..85539e9 100644
--- a/SetupConfig.py
+++ b/SetupConfig.py
@@ -71,7 +71,7 @@ if not os.getenv('CHEETAH_INSTALL_WITHOUT_SETUPTOOLS'):
                 ]
         }
     except ImportError:
-        print 'Not using setuptools, so we cannot install the Markdown dependency'
+        print('Not using setuptools, so we cannot install the Markdown dependency')
 
 
 description = "Cheetah is a template engine and code generation tool."
diff --git a/SetupTools.py b/SetupTools.py
index d08eef2..096ee40 100644
--- a/SetupTools.py
+++ b/SetupTools.py
@@ -158,14 +158,14 @@ def run_setup(configurations):
     try:
         apply(setup, (), kws)
     except BuildFailed, x:
-        print "One or more C extensions failed to build."
-        print "Details: %s" % x
-        print "Retrying without C extensions enabled."
+        print("One or more C extensions failed to build.")
+        print("Details: %s" % x)
+        print("Retrying without C extensions enabled.")
 
         del kws['ext_modules']
         apply(setup, (), kws)
 
-        print "One or more C extensions failed to build."
-        print "Performance enhancements will not be available."
-        print "Pure Python installation succeeded."
+        print("One or more C extensions failed to build.")
+        print("Performance enhancements will not be available.")
+        print("Pure Python installation succeeded.")
 
diff --git a/cheetah/CheetahWrapper.py b/cheetah/CheetahWrapper.py
index 3b1f991..d01f46a 100644
--- a/cheetah/CheetahWrapper.py
+++ b/cheetah/CheetahWrapper.py
@@ -195,14 +195,14 @@ Files are %s""", args, pprint.pformat(vars(opts)), files)
 
 
         if opts.print_settings:
-            print 
-            print '>> Available Cheetah compiler settings:'
+            print() 
+            print('>> Available Cheetah compiler settings:')
             from Cheetah.Compiler import _DEFAULT_COMPILER_SETTINGS
             listing = _DEFAULT_COMPILER_SETTINGS
             listing.sort(key=lambda l: l[0][0].lower())
 
             for l in listing:
-                print '\t%s (default: "%s")\t%s' % l
+                print('\t%s (default: "%s")\t%s' % l)
             sys.exit(0)
 
         #cleanup trailing path separators
@@ -266,7 +266,7 @@ you do have write permission to and re-run the tests.""")
         runner.run(unittest.TestSuite(Test.suites))
         
     def version(self):
-        print Version
+        print(Version)
 
     # If you add a command, also add it to the 'meths' variable in main().
     
diff --git a/cheetah/Filters.py b/cheetah/Filters.py
index d452439..39ac9ec 100644
--- a/cheetah/Filters.py
+++ b/cheetah/Filters.py
@@ -65,9 +65,9 @@ class Markdown(EncodeUnicode):
         try:
             import markdown
         except ImportError:
-            print '>>> Exception raised importing the "markdown" module'
-            print '>>> Are you sure you have the ElementTree module installed?'
-            print '          http://effbot.org/downloads/#elementtree'
+            print('>>> Exception raised importing the "markdown" module')
+            print('>>> Are you sure you have the ElementTree module installed?')
+            print('          http://effbot.org/downloads/#elementtree')
             raise
 
         encoded = super(Markdown, self).filter(value, **kwargs)
@@ -97,8 +97,8 @@ class CodeHighlighter(EncodeUnicode):
             from pygments import lexers
             from pygments import formatters
         except ImportError, ex:
-            print '<%s> - Failed to import pygments! (%s)' % (self.__class__.__name__, ex)
-            print '-- You may need to install it from: http://pygments.org'
+            print('<%s> - Failed to import pygments! (%s)' % (self.__class__.__name__, ex))
+            print('-- You may need to install it from: http://pygments.org')
             return encoded
 
         lexer = None
@@ -196,15 +196,15 @@ class StripSqueeze(Filter):
 def test():
     s1 = "abc <=> &"
     s2 = "   asdf  \n\t  1  2    3\n"
-    print "WebSafe INPUT:", `s1`
-    print "      WebSafe:", `WebSafe().filter(s1)`
+    print("WebSafe INPUT:", `s1`)
+    print("      WebSafe:", `WebSafe().filter(s1)`)
     
-    print
-    print " Strip INPUT:", `s2`
-    print "       Strip:", `Strip().filter(s2)`
-    print "StripSqueeze:", `StripSqueeze().filter(s2)`
+    print()
+    print(" Strip INPUT:", `s2`)
+    print("       Strip:", `Strip().filter(s2)`)
+    print("StripSqueeze:", `StripSqueeze().filter(s2)`)
 
-    print "Unicode:", `EncodeUnicode().filter(u'aoeu12345\u1234')`
+    print("Unicode:", `EncodeUnicode().filter(u'aoeu12345\u1234')`)
     
 if __name__ == "__main__":  
     test()
diff --git a/cheetah/ImportManager.py b/cheetah/ImportManager.py
index 743360e..667898f 100755
--- a/cheetah/ImportManager.py
+++ b/cheetah/ImportManager.py
@@ -223,8 +223,8 @@ class DirOwner(Owner):
                     co = compile(open(py[0], 'r').read()+'\n', py[0], 'exec')
                     break
                 except SyntaxError, e:
-                    print "Invalid syntax in %s" % py[0]
-                    print e.args
+                    print("Invalid syntax in %s" % py[0])
+                    print(e.args)
                     raise
             elif pyc:
                 stuff = open(pyc[0], 'rb').read()
diff --git a/cheetah/NameMapper.py b/cheetah/NameMapper.py
index 3a6322e..c70db38 100644
--- a/cheetah/NameMapper.py
+++ b/cheetah/NameMapper.py
@@ -364,13 +364,13 @@ def example():
         }
     b = 'this is local b'
 
-    print valueForKey(a.dic,'subDict')
-    print valueForName(a, 'dic.item')
-    print valueForName(vars(), 'b')
-    print valueForName(__builtins__, 'dir')()
-    print valueForName(vars(), 'a.classVar')
-    print valueForName(vars(), 'a.dic.func', executeCallables=True)
-    print valueForName(vars(), 'a.method2.item1', executeCallables=True)
+    print(valueForKey(a.dic,'subDict'))
+    print(valueForName(a, 'dic.item'))
+    print(valueForName(vars(), 'b'))
+    print(valueForName(__builtins__, 'dir')())
+    print(valueForName(vars(), 'a.classVar'))
+    print(valueForName(vars(), 'a.dic.func', executeCallables=True))
+    print(valueForName(vars(), 'a.method2.item1', executeCallables=True))
 
 if __name__ == '__main__':
     example()
diff --git a/cheetah/Parser.py b/cheetah/Parser.py
index 7436e9c..4a8515d 100644
--- a/cheetah/Parser.py
+++ b/cheetah/Parser.py
@@ -1224,7 +1224,6 @@ class _LowLevelParser(SourceReader):
                 startPosIdx = 3
             else:
                 startPosIdx = 1
-            #print 'CHEETAH STRING', nextToken, theStr, startPosIdx
             self.setPos(beforeTokenPos+startPosIdx+1)
             outputExprs = []
             strConst = ''
@@ -1240,8 +1239,6 @@ class _LowLevelParser(SourceReader):
             self.setPos(endPos)
             if strConst:
                 outputExprs.append(repr(strConst))
-            #if not self.atEnd() and self.matches('.join('):
-            #    print 'DEBUG***'
             token = "''.join(["+','.join(outputExprs)+"])"
         return token
 
@@ -1854,13 +1851,11 @@ class _HighLevelParser(_LowLevelParser):
         try:
             self._compiler.setCompilerSetting(settingName, valueExpr)
         except:
-            out = sys.stderr
-            print >> out, 'An error occurred while processing the following #compiler directive.'
-            print >> out, '-'*80
-            print >> out, self[startPos:endPos]
-            print >> out, '-'*80
-            print >> out, 'Please check the syntax of these settings.'
-            print >> out, 'A full Python exception traceback follows.'
+            sys.stderr.write('An error occurred while processing the following #compiler directive.\n')
+            sys.stderr.write('----------------------------------------------------------------------\n')
+            sys.stderr.write('%s\n' % self[startPos:endPos])
+            sys.stderr.write('----------------------------------------------------------------------\n')
+            sys.stderr.write('Please check the syntax of these settings.\n\n')
             raise
 
 
diff --git a/cheetah/Template.py b/cheetah/Template.py
index ec92208..ab63074 100644
--- a/cheetah/Template.py
+++ b/cheetah/Template.py
@@ -1837,7 +1837,7 @@ class Template(Servlet):
         # 'dic = super(ThisClass, self).webInput(names, namesMulti, ...)'
         # and then the code below.
         if debug:
-           print "<PRE>\n" + pprint.pformat(dic) + "\n</PRE>\n\n"
+           print("<PRE>\n" + pprint.pformat(dic) + "\n</PRE>\n\n")
         self.searchList().insert(0, dic)
         return dic
 
diff --git a/cheetah/TemplateCmdLineIface.py b/cheetah/TemplateCmdLineIface.py
index 16a90cf..6690b6d 100644
--- a/cheetah/TemplateCmdLineIface.py
+++ b/cheetah/TemplateCmdLineIface.py
@@ -41,7 +41,7 @@ class CmdLineIface:
         """The main program controller."""
         
         self._processCmdLineArgs()
-        print self._template
+        print(self._template)
         
     def _processCmdLineArgs(self):
         try:
@@ -53,13 +53,13 @@ class CmdLineIface:
 
         except getopt.GetoptError, v:
             # print help information and exit:
-            print v
-            print self.usage()
+            print(v)
+            print(self.usage())
             sys.exit(2)
         
         for o, a in self._opts:
             if o in ('-h','--help'):
-                print self.usage()
+                print(self.usage())
                 sys.exit()
             if o == '--env':
                 self._template.searchList().insert(0, os.environ)
diff --git a/cheetah/Templates/_SkeletonPage.py b/cheetah/Templates/_SkeletonPage.py
index fe01ebf..95a59a7 100644
--- a/cheetah/Templates/_SkeletonPage.py
+++ b/cheetah/Templates/_SkeletonPage.py
@@ -88,7 +88,7 @@ class _SkeletonPage(Template):
             if not self._stylesheets.has_key(identifier):
                 warning = '# the identifier ' + identifier + \
                           'was in stylesheetsOrder, but not in stylesheets'
-                print warning
+                print(warning)
                 stylesheetTagsTxt += warning
                 continue
                     
diff --git a/cheetah/Tests/CheetahWrapper.py b/cheetah/Tests/CheetahWrapper.py
index e152e68..809be40 100644
--- a/cheetah/Tests/CheetahWrapper.py
+++ b/cheetah/Tests/CheetahWrapper.py
@@ -52,7 +52,7 @@ class CFBase(unittest.TestCase):
 
     def inform(self, message):
         if self.verbose:
-            print message
+            print(message)
 
     def setUp(self):
         """Create the top-level directories, subdirectories and .tmpl
@@ -520,7 +520,7 @@ def listTests(cheetahWrapperFile):
             break
         m = rx.search(lin)
         if m:
-            print m.group(1)
+            print(m.group(1))
     f.close()
 
 def main():
diff --git a/cheetah/Tests/Filters.py b/cheetah/Tests/Filters.py
index bf35440..9b3c7c2 100644
--- a/cheetah/Tests/Filters.py
+++ b/cheetah/Tests/Filters.py
@@ -31,7 +31,7 @@ Header
             assert template == expected
         except Exception, ex:
             if ex.__class__.__name__ == 'MarkdownException' and majorVer == 2 and minorVer < 5:
-                print '>>> NOTE: Support for the Markdown filter will be broken for you. Markdown says: %s' % ex
+                print('>>> NOTE: Support for the Markdown filter will be broken for you. Markdown says: %s' % ex)
                 return
             raise
 
diff --git a/cheetah/Tests/Performance.py b/cheetah/Tests/Performance.py
index 8101e85..fc74367 100644
--- a/cheetah/Tests/Performance.py
+++ b/cheetah/Tests/Performance.py
@@ -57,8 +57,8 @@ def perftest(max_num_pystones, current_pystone=None):
                     pystone_total_time = total_time / pystone_rate
                 global DEBUG
                 if DEBUG:
-                    print 'The test "%s" took: %s pystones' % (function.func_name,
-                        pystone_total_time)
+                    print('The test "%s" took: %s pystones' % (function.func_name,
+                        pystone_total_time))
                 else:
                     if pystone_total_time > (max_num_pystones + TOLERANCE):
                         raise DurationError((('Test too long (%.2f Ps, '
@@ -98,8 +98,8 @@ class PerformanceTest(unittest.TestCase):
         self.prof.stop()
         self.prof.close()
         if self.display:
-            print '>>> %s (%d iterations) ' % (self.__class__.__name__,
-                    self.iterations)
+            print('>>> %s (%d iterations) ' % (self.__class__.__name__,
+                    self.iterations))
             stats = hotshot.stats.load('%s.prof' % self.__class__.__name__)
             #stats.strip_dirs()
             stats.sort_stats('time', 'calls')
diff --git a/cheetah/Tests/Regressions.py b/cheetah/Tests/Regressions.py
index 4d50348..67a736a 100644
--- a/cheetah/Tests/Regressions.py
+++ b/cheetah/Tests/Regressions.py
@@ -29,7 +29,7 @@ class GetAttrTest(unittest.TestCase):
     def test_ValidException(self):
         o = CustomGetAttrClass()
         try:
-            print o.attr
+            print(o.attr)
         except GetAttrException, e:
             # expected
             return
diff --git a/cheetah/Tests/SyntaxAndOutput.py b/cheetah/Tests/SyntaxAndOutput.py
index 72721bc..6bd6963 100644
--- a/cheetah/Tests/SyntaxAndOutput.py
+++ b/cheetah/Tests/SyntaxAndOutput.py
@@ -171,7 +171,7 @@ Template output mismatch:
                 )
             moduleCode = templateObj._CHEETAH_generatedModuleCode
         if self.DEBUGLEV >= 1:
-            print moduleCode
+            print(moduleCode)
         try:
             output = templateObj.respond() # rather than __str__, because of unicode
             assert output==expectedOutput, self._outputMismatchReport(output, expectedOutput)
diff --git a/cheetah/Tests/Template.py b/cheetah/Tests/Template.py
index 144ae6f..7edbdb9 100644
--- a/cheetah/Tests/Template.py
+++ b/cheetah/Tests/Template.py
@@ -293,7 +293,7 @@ class TryExceptImportTest(TemplateTest):
 class ClassMethodSupport(TemplateTest):
     def test_BasicDecorator(self):
         if sys.version_info[0] == 2 and sys.version_info[1] == 3:
-                print 'This version of Python doesn\'t support decorators, skipping tests'
+                print('This version of Python doesn\'t support decorators, skipping tests')
                 return
         template = '''
             #@classmethod
@@ -311,7 +311,7 @@ class ClassMethodSupport(TemplateTest):
 class StaticMethodSupport(TemplateTest):
     def test_BasicDecorator(self):
         if sys.version_info[0] == 2 and sys.version_info[1] == 3:
-                print 'This version of Python doesn\'t support decorators, skipping tests'
+                print('This version of Python doesn\'t support decorators, skipping tests')
                 return
         template = '''
             #@staticmethod
diff --git a/cheetah/Tests/unittest_local_copy.py b/cheetah/Tests/unittest_local_copy.py
index a5f5499..11d2d2c 100755
--- a/cheetah/Tests/unittest_local_copy.py
+++ b/cheetah/Tests/unittest_local_copy.py
@@ -917,8 +917,8 @@ Examples:
         self.runTests()
 
     def usageExit(self, msg=None):
-        if msg: print msg
-        print self.USAGE % self.__dict__
+        if msg: print(msg)
+        print(self.USAGE % self.__dict__)
         sys.exit(2)
 
     def parseArgs(self, argv):
diff --git a/cheetah/Tests/xmlrunner.py b/cheetah/Tests/xmlrunner.py
index dc49c56..bc9f6ab 100644
--- a/cheetah/Tests/xmlrunner.py
+++ b/cheetah/Tests/xmlrunner.py
@@ -313,7 +313,7 @@ class XMLTestRunnerTest(unittest.TestCase):
         """
         class TestTest(unittest.TestCase):
             def test_foo(self):
-                print "Test"
+                print("Test")
         self._try_test_run(TestTest, """<testsuite errors="0" failures="0" name="unittest.TestSuite" tests="1" time="0.000">
   <testcase classname="__main__.TestTest" name="test_foo" time="0.000"></testcase>
   <system-out><![CDATA[Test
@@ -329,7 +329,7 @@ class XMLTestRunnerTest(unittest.TestCase):
         """
         class TestTest(unittest.TestCase):
             def test_foo(self):
-                print >>sys.stderr, "Test"
+                print("Test", file=sys.stderr)
         self._try_test_run(TestTest, """<testsuite errors="0" failures="0" name="unittest.TestSuite" tests="1" time="0.000">
   <testcase classname="__main__.TestTest" name="test_foo" time="0.000"></testcase>
   <system-out><![CDATA[]]></system-out>
diff --git a/cheetah/Tools/SiteHierarchy.py b/cheetah/Tools/SiteHierarchy.py
index 06da56f..6cae0bc 100644
--- a/cheetah/Tools/SiteHierarchy.py
+++ b/cheetah/Tools/SiteHierarchy.py
@@ -173,10 +173,10 @@ if __name__ == '__main__':
 		    ]
 
 	for url in ['/', '/services', '/services/products/widget', '/contact']:
-		print '<p>', '='*50
-		print '<br> %s: <br>\n' % url
+		print('<p>', '='*50)
+		print('<br> %s: <br>\n' % url)
 		n = Hierarchy(hierarchy, url, menuCSSClass='menu', crumbCSSClass='crumb',
 			      prefix='/here')
-		print n.menuList()
-		print '<p>', '-'*50
-		print n.crumbs()
+		print(n.menuList())
+		print('<p>', '-'*50)
+		print(n.crumbs())
diff --git a/cheetah/Utils/memcache.py b/cheetah/Utils/memcache.py
index ee9678d..029f621 100644
--- a/cheetah/Utils/memcache.py
+++ b/cheetah/Utils/memcache.py
@@ -177,7 +177,6 @@ class Client:
         for i in range(Client._SERVER_RETRIES):
             server = self.buckets[serverhash % len(self.buckets)]
             if server.connect():
-                #print "(using server %s)" % server,
                 return server, key
             serverhash = hash(str(serverhash) + str(i))
         return None, None
@@ -555,10 +554,9 @@ def _doctest():
     return doctest.testmod(memcache, globs=globs)
 
 if __name__ == "__main__":
-    print "Testing docstrings..."
+    print("Testing docstrings...")
     _doctest()
-    print "Running tests:"
-    print
+    print("Running tests:")
     #servers = ["127.0.0.1:11211", "127.0.0.1:11212"]
     servers = ["127.0.0.1:11211"]
     mc = Client(servers, debug=1)
@@ -568,14 +566,14 @@ if __name__ == "__main__":
             return "%s (%s)" % (val, type(val))
         return "%s" % val
     def test_setget(key, val):
-        print "Testing set/get {'%s': %s} ..." % (to_s(key), to_s(val)),
+        print("Testing set/get {'%s': %s} ..." % (to_s(key), to_s(val)))
         mc.set(key, val)
         newval = mc.get(key)
         if newval == val:
-            print "OK"
+            print("OK")
             return 1
         else:
-            print "FAIL"
+            print("FAIL")
             return 0
 
     class FooStruct:
@@ -591,34 +589,33 @@ if __name__ == "__main__":
     test_setget("a_string", "some random string")
     test_setget("an_integer", 42)
     if test_setget("long", long(1<<30)):
-        print "Testing delete ...",
+        print("Testing delete ...")
         if mc.delete("long"):
-            print "OK"
+            print("OK")
         else:
-            print "FAIL"
-    print "Testing get_multi ...",
-    print mc.get_multi(["a_string", "an_integer"])
+            print("FAIL")
+    print("Testing get_multi ...")
+    print(mc.get_multi(["a_string", "an_integer"]))
 
-    print "Testing get(unknown value) ...",
-    print to_s(mc.get("unknown_value"))
+    print("Testing get(unknown value) ...")
+    print(to_s(mc.get("unknown_value")))
 
     f = FooStruct()
     test_setget("foostruct", f)
 
-    print "Testing incr ...",
+    print("Testing incr ...")
     x = mc.incr("an_integer", 1)
     if x == 43:
-        print "OK"
+        print("OK")
     else:
-        print "FAIL"
+        print("FAIL")
 
-    print "Testing decr ...",
+    print("Testing decr ...")
     x = mc.decr("an_integer", 1)
     if x == 42:
-        print "OK"
+        print("OK")
     else:
-        print "FAIL"
-
+        print("FAIL")
 
 
 # vim: ts=4 sw=4 et :
diff --git a/cheetah/Utils/statprof.py b/cheetah/Utils/statprof.py
index 55638eb..d6d64d6 100644
--- a/cheetah/Utils/statprof.py
+++ b/cheetah/Utils/statprof.py
@@ -277,15 +277,15 @@ class CallStats(object):
         self.cum_secs_per_call = None
 
     def display(self):
-        print '%6.2f %9.2f %9.2f  %s' % (self.pcnt_time_in_proc,
+        print('%6.2f %9.2f %9.2f  %s' % (self.pcnt_time_in_proc,
                                          self.cum_secs_in_proc,
                                          self.self_secs_in_proc,
-                                         self.name)
+                                         self.name))
 
 
 def display():
     if state.sample_count == 0:
-        print 'No samples recorded.'
+        print('No samples recorded.')
         return
 
     l = [CallStats(x) for x in call_data.itervalues()]
@@ -293,12 +293,12 @@ def display():
     l.sort(reverse=True)
     l = [x[2] for x in l]
 
-    print '%5.5s %10.10s   %7.7s  %-8.8s' % ('%  ', 'cumulative', 'self', '')
-    print '%5.5s  %9.9s  %8.8s  %-8.8s' % ("time", "seconds", "seconds", "name")
+    print('%5.5s %10.10s   %7.7s  %-8.8s' % ('%  ', 'cumulative', 'self', ''))
+    print('%5.5s  %9.9s  %8.8s  %-8.8s' % ("time", "seconds", "seconds", "name"))
 
     for x in l:
         x.display()
 
-    print '---'
-    print 'Sample count: %d' % state.sample_count
-    print 'Total time: %f seconds' % state.accumulated_time
+    print('---')
+    print('Sample count: %d' % state.sample_count)
+    print('Total time: %f seconds' % state.accumulated_time)
diff --git a/cheetah/Version.py b/cheetah/Version.py
index 7fdf82f..9cc2e91 100644
--- a/cheetah/Version.py
+++ b/cheetah/Version.py
@@ -32,11 +32,11 @@ def convertVersionStringToTuple(s):
 
 if __name__ == '__main__':
     c = convertVersionStringToTuple
-    print c('2.0a1')
-    print c('2.0b1')
-    print c('2.0rc1')
-    print c('2.0')
-    print c('2.0.2')
+    print(c('2.0a1'))
+    print(c('2.0b1'))
+    print(c('2.0rc1'))
+    print(c('2.0'))
+    print(c('2.0.2'))
 
 
     assert c('0.9.19b1') < c('0.9.19')
-- 
1.6.4.2


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july