/usr/bin/blueman-browse is in blueman 1.23-git201403102151-1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | #! /usr/bin/python
import os, sys
#support running uninstalled
_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if os.path.exists(os.path.join(_dirname, "CHANGELOG.md")):
sys.path.insert(0, _dirname)
import gtk
import gobject
from optparse import OptionParser
import gettext
import time
from blueman.bluez.Manager import Manager
from blueman.gui.DeviceSelectorDialog import DeviceSelectorDialog
from blueman.Functions import *
from blueman.Constants import *
from blueman.main.Config import Config
class Browse:
def __init__(self):
setup_icon_path()
usage = "Usage: %prog [options]"
parser = OptionParser(usage)
parser.add_option("-d", "--device", dest="device",
action="store", help=_("Browse this device"), metavar="ADDRESS")
(options, args) = parser.parse_args()
self.options = options
self.args = args
if options.device == None:
dev = self.select_device()
if not dev:
exit()
addr = dev.Address
else:
addr = options.device
addr = addr.strip(" ")
conf = Config("transfer")
if conf.props.browse_command == None:
conf.props.browse_command = DEF_BROWSE_COMMAND
if "nautilus" in DEF_BROWSE_COMMAND:
if not have("nautilus"):
if have("thunar"):
conf.props.browse_command = "thunar obex://[%d]"
elif have ("pcmanfm"):
conf.props.browse_command = "pcmanfm obex://[%d]"
else:
conf.props.browse_command = "xdg-open obex://[%d]"
cmd = conf.props.browse_command.replace("%d", addr)
args = cmd.split(" ")
try:
spawn(args, True)
except Exception as e:
dprint(e)
d = gtk.MessageDialog(None, buttons=gtk.BUTTONS_OK, type=gtk.MESSAGE_ERROR)
d.props.text = _("Failed to launch \"%s\"") % args[0]
d.props.secondary_text = "%s\n\n" % e + _("You can enter an alternate browser in service settings")
d.run()
d.destroy()
def select_device(self):
d = DeviceSelectorDialog()
resp = d.run()
d.destroy()
if resp == gtk.RESPONSE_ACCEPT:
sel = d.GetSelection()
if sel:
return sel[1]
else:
return None
else:
return None
Browse()
|