]> git.phdru.name Git - m_lib.git/blobdiff - m_lib/net/ftp/ftpparse.py
Use print function for Py3 compatibility
[m_lib.git] / m_lib / net / ftp / ftpparse.py
index 1dcef0cd73bc89bdd73f7b46b18bd2ba481dfaad..ae700c320e99561fdd603c66314a4639c751cf4d 100755 (executable)
@@ -21,6 +21,7 @@ Definitely not covered:
 """
 
 
+from __future__ import print_function
 try:
    from mx import DateTime
 except ImportError:
@@ -228,35 +229,35 @@ def ftpparse(line):
 
 def test():
    #UNIX-style listing, without inum and without blocks
-   print ftpparse("-rw-r--r--   1 root     other        531 Jan 29 03:26 README")
-   print ftpparse("dr-xr-xr-x   2 root     other        512 Apr  8  1994 etc")
-   print ftpparse("dr-xr-xr-x   2 root     512 Apr  8  1994 etc")
-   print ftpparse("lrwxrwxrwx   1 root     other          7 Jan 25 00:17 bin -> usr/bin")
+   print(ftpparse("-rw-r--r--   1 root     other        531 Jan 29 03:26 README"))
+   print(ftpparse("dr-xr-xr-x   2 root     other        512 Apr  8  1994 etc"))
+   print(ftpparse("dr-xr-xr-x   2 root     512 Apr  8  1994 etc"))
+   print(ftpparse("lrwxrwxrwx   1 root     other          7 Jan 25 00:17 bin -> usr/bin"))
    #FTP servers for Windoze:
-   print ftpparse("----------   1 owner    group         1803128 Jul 10 10:18 ls-lR.Z")
-   print ftpparse("d---------   1 owner    group               0 May  9 19:45 Softlib")
+   print(ftpparse("----------   1 owner    group         1803128 Jul 10 10:18 ls-lR.Z"))
+   print(ftpparse("d---------   1 owner    group               0 May  9 19:45 Softlib"))
    #WFTPD for DOS:
-   print ftpparse("-rwxrwxrwx   1 noone    nogroup      322 Aug 19  1996 message.ftp")
+   print(ftpparse("-rwxrwxrwx   1 noone    nogroup      322 Aug 19  1996 message.ftp"))
    #NetWare:
-   print ftpparse("d [R----F--] supervisor            512       Jan 16 18:53    login")
-   print ftpparse("- [R----F--] rhesus             214059       Oct 20 15:27    cx.exe")
+   print(ftpparse("d [R----F--] supervisor            512       Jan 16 18:53    login"))
+   print(ftpparse("- [R----F--] rhesus             214059       Oct 20 15:27    cx.exe"))
    #NetPresenz for the Mac:
-   print ftpparse("-------r--         326  1391972  1392298 Nov 22  1995 MegaPhone.sit")
-   print ftpparse("drwxrwxr-x               folder        2 May 10  1996 network")
+   print(ftpparse("-------r--         326  1391972  1392298 Nov 22  1995 MegaPhone.sit"))
+   print(ftpparse("drwxrwxr-x               folder        2 May 10  1996 network"))
 
    #MultiNet (some spaces removed from examples)
-   print ftpparse("00README.TXT;1      2 30-DEC-1996 17:44 [SYSTEM] (RWED,RWED,RE,RE)")
-   print ftpparse("CORE.DIR;1          1  8-SEP-1996 16:09 [SYSTEM] (RWE,RWE,RE,RE)")
+   print(ftpparse("00README.TXT;1      2 30-DEC-1996 17:44 [SYSTEM] (RWED,RWED,RE,RE)"))
+   print(ftpparse("CORE.DIR;1          1  8-SEP-1996 16:09 [SYSTEM] (RWE,RWE,RE,RE)"))
    #non-MutliNet VMS:
-   print ftpparse("CII-MANUAL.TEX;1  213/216  29-JAN-1996 03:33:12  [ANONYMOU,ANONYMOUS]   (RWED,RWED,,)")
+   print(ftpparse("CII-MANUAL.TEX;1  213/216  29-JAN-1996 03:33:12  [ANONYMOU,ANONYMOUS]   (RWED,RWED,,)"))
 
    #DOS format
-   print ftpparse("04-27-00  09:09PM       <DIR>          licensed")
-   print ftpparse("07-18-00  10:16AM       <DIR>          pub")
-   print ftpparse("04-14-00  03:47PM                  589 readme.htm")
+   print(ftpparse("04-27-00  09:09PM       <DIR>          licensed"))
+   print(ftpparse("07-18-00  10:16AM       <DIR>          pub"))
+   print(ftpparse("04-14-00  03:47PM                  589 readme.htm"))
 
-   print ftpparse("-rw-r--r--   1 root     other        531 Jan 29 03:26 READ ME")
-   print ftpparse("-rw-r--r--   1 root     other        531 Jan 29 03:26  DO NOT READ ME ")
+   print(ftpparse("-rw-r--r--   1 root     other        531 Jan 29 03:26 READ ME"))
+   print(ftpparse("-rw-r--r--   1 root     other        531 Jan 29 03:26  DO NOT READ ME "))
 
 if __name__ == "__main__":
    test()