[svnbook] r6049 committed - trunk/tools/bin/spew-svn-command-options

cmpilato at users.sourceforge.net cmpilato at users.sourceforge.net
Sun Oct 17 19:40:55 UTC 2021


Revision: 6049
          http://sourceforge.net/p/svnbook/source/6049
Author:   cmpilato
Date:     2021-10-17 19:40:55 +0000 (Sun, 17 Oct 2021)
Log Message:
-----------
* trunk/tools/bin/spew-svn-command-options
  Port this script to Python 3.

Patch by: Daniel Sahlberg <daniel.l.sahlberg{__AT__}gmail.com>

Modified Paths:
--------------
    trunk/tools/bin/spew-svn-command-options

Modified: trunk/tools/bin/spew-svn-command-options
===================================================================
--- trunk/tools/bin/spew-svn-command-options	2021-10-12 20:42:37 UTC (rev 6048)
+++ trunk/tools/bin/spew-svn-command-options	2021-10-17 19:40:55 UTC (rev 6049)
@@ -15,7 +15,7 @@
             break
         if line[3] == ' ':
             continue
-        option_parts = filter(None, line.split(' '))
+        option_parts = list(filter(None, line.split(' ')))
         if option_parts[0].startswith('--'):
             option = option_parts[0]
         else:
@@ -49,7 +49,7 @@
             continue
         if not line:
             break
-        subcommand = filter(None, line.split(' '))[0]
+        subcommand = next(filter(None, line.split(' ')))
         subcommands.append(subcommand)
 
     # For each subcommand, find the options.
@@ -59,15 +59,15 @@
             lines = os.popen("%s help %s" %
                              (tool, subcommand), 'r').readlines()
             options = find_options(lines)
-            print "%s %s" % (os.path.basename(tool), subcommand)
+            print("%s %s" % (os.path.basename(tool), subcommand))
             options.sort()
             for option in options:
-                print "%s %s %s" % (os.path.basename(tool), subcommand, option)
+                print("%s %s %s" % (os.path.basename(tool), subcommand, option))
     else:
         lines = os.popen("%s --help" % (tool), 'r').readlines()
         options = find_options(lines)
-        print "%s" % (os.path.basename(tool))
+        print("%s" % (os.path.basename(tool)))
         options.sort()
         for option in options:
-            print "%s %s" % (os.path.basename(tool), option)
+            print("%s %s" % (os.path.basename(tool), option))
         




More information about the svnbook-dev mailing list