X-Git-Url: https://git.phdru.name/?p=extfs.d.git;a=blobdiff_plain;f=obexftp;h=8d4906d1639152e3e4ea7426f79608521336225b;hp=0f4202b30be202bdccd606c194b2337468b7457f;hb=f3b172a7afa393c59592fe09651affcb8515a4d2;hpb=3979302eabc8e5950ecde77c21773377d5de5a25 diff --git a/obexftp b/obexftp index 0f4202b..8d4906d 100755 --- a/obexftp +++ b/obexftp @@ -8,7 +8,7 @@ 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 SiemensFS or such). The +user-mode solution, no kernel modules required (unlike SieFS or such). The script implements all commands of Midnight VFS, except for undocumented "run"; but 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 @@ -28,7 +28,7 @@ Create somewhere a transport file. The transport file can have any name, and is expected to be a text file with at least one line defining the transport to your device. Other lines in the file are ignored. -First word in the line is a transport name - Bluetooth, IrDA or TTY. The name +First word in the line is a transport name - Bluetooth, TTY or IrDA. The name is case-insensitive. For the Bluetooth transport put there a line "Bluetooth CP:AD:RE:SS channel", @@ -37,23 +37,24 @@ and channel is the OBEX File Transfer channel; you can discover the address and the channel for your device by using commands like "hcitool scan" and "sdptool browse". -The content with the IrDA just put "IrDA" in the file. +For the TTY put the device name: "tty /dev/ttyUSB0". -For the TTY put a device name: "tty /dev/rfcomm0". +For the IrDA: just put "IrDA" in the file. Now run this "cd" command in the Midnight Commander (in the "bindings" files -the command is "%cd"): cd description#obexftp. The VFS script uses obexftp to -connect to the device and list files and directories. Please be warned that -opening the VFS for the first time is VERY slow, because the script needs to -scan the entire cell phone's filesystem. And there must be a timeout between -connections, which doesn't make the scanning process faster. Midnight Commander -caches the result, so you can browse directories quickly. +the command is "%cd"): cd description#obexftp, where "description" is the name +of your file. The VFS script uses obexftp to connect to the device and list +files and directories. Please be warned that opening the VFS for the first time +is VERY slow, because the script needs to scan the entire cell phone's +filesystem. And there must be timeouts between connections, which don't make +the scanning faster. Midnight Commander caches the result, so you can browse +directories quickly. """ -__version__ = "0.5.2" -__revision__ = "$Id: obexftp,v 1.8 2004/06/16 16:17:43 phd Exp $" -__date__ = "$Date: 2004/06/16 16:17:43 $"[7:-2] +__version__ = "1.0.1" +__revision__ = "$Id: obexftp,v 1.12 2004/06/23 16:05:34 phd Exp $" +__date__ = "$Date: 2004/06/23 16:05:34 $"[7:-2] __author__ = "Oleg Broytmann " __copyright__ = "Copyright (C) 2004 PhiloSoft Design" @@ -89,10 +90,10 @@ Put it in /usr/lib/mc/extfs. For more information read the source!""" % ( def setup_transport(): """Setup transport parameters for the obexftp program""" transport_file = open(sys.argv[2], 'r') - line = transport_file.readline().strip() + line = transport_file.readline() transport_file.close() - parts = line.split() + parts = line.strip().split() transport = parts[0].lower() if transport == "bluetooth": @@ -102,7 +103,7 @@ def setup_transport(): elif transport == "irda": return "-i" else: - error("Unknown transport '%s'; expected 'bluetooth', 'tty' or 'irda'" % base_filename) + error("Unknown transport '%s'; expected 'bluetooth', 'tty' or 'irda'" % transport) # Parse ObexFTP XML directory listings