-#! /usr/local/bin/python -O
-
-"""
-ObexFTP Virtual FileSystem for Midnight Commander.
-
-Author: Oleg BroytMann <phd@phd.pp.ru>.
-Copyright (C) 2004 PhiloSoft Design.
-License: GPL.
-
-Manipulate a cell phone's filesystem calling obexftp binary. This is a
-complete user-mode solution, no kernel modules required (unlike SieFS or
-such). The script implements all commands of Midnight VFS, except for
-undocumented "run"; anyway there are no runnable files in the cell phone. The
-script is written in Python because I love Python, the best of all languages ;),
-and I need to parse XML directory listings from obexftp.
-
-The script requires Midnight Commander 3.1+ (http://www.ibiblio.org/mc/),
-Python 2.3+ (http://www.python.org/),
-OpenOBEX 1.0.1+ (http://openobex.sourceforge.net/) and
-ObexFTP 0.10.4+ (http://triq.net/obexftp).
-
-Edit the script, and correct the shebang path, if your python is not in the
-/usr/local. Edit the full path to the obexftp binary (see below). Put the file
-in the /usr/[local/]lib/mc/extfs, and add a line "obexftp" to the
-/usr/[local/]lib/mc/extfs/extfs.ini.
-
-Create somewhere a transport file. The transport file may have any name, and
-is expected to be a text file with at least one line defining the transport to
+#! /usr/bin/env python
+"""ObexFTP Virtual FileSystem for Midnight Commander
+
+Manipulate a cell phone's filesystem calling obexftp binary. This is a complete
+user-mode solution, no kernel modules required (unlike SieFS or such). The
+script implements all commands of Midnight Commander VFS, except for
+undocumented "run"; anyway there are no runnable files in cell phones. The
+script is written in Python because I I need to parse XML directory listings
+from obexftp, and Python is the best of all languages suited for the task ;).
+
+The script requires Midnight Commander 3.1+
+(http://www.midnight-commander.org/), Python 2.3+ (http://www.python.org/),
+OpenOBEX 1.0.1+ (http://dev.zuckschwerdt.org/openobex/) and ObexFTP 0.10.4+
+(http://triq.net/obexftp).
+
+Edit the script, and correct the full path to the obexftp binary (see
+obexftp_prog below). For mc 4.7+ put the script in
+$HOME/[.local/share/].mc/extfs.d. For older versions put it in
+/usr/[local/][lib|share]/mc/extfs and add a line "obexftp" to the
+/usr/[local/][lib|share]/mc/extfs/extfs.ini. Make the script executable.
+
+See detailed installation instructions at
+http://phdru.name/Software/mc/INSTALL.html.
+
+Create somewhere a transport file. The transport file may have any name, and is
+expected to be a text file with at least one line defining the transport to