diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2006-03-12 18:09:43 +0000 | 
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2006-03-12 18:09:43 +0000 | 
| commit | 020ac98f0656d3f95d1bb38ea546f145897446fa (patch) | |
| tree | cc0588a4dedb8994f769fdf413435faba0d60026 | |
| parent | 5f2d86a6658b756d878ae467a6fc4fd4d7c1968d (diff) | |
Remove bluepin script
| -rw-r--r-- | acinclude.m4 | 7 | ||||
| -rwxr-xr-x | bootstrap-configure | 3 | ||||
| -rw-r--r-- | scripts/Makefile.am | 6 | ||||
| -rwxr-xr-x | scripts/bluepin | 164 | 
4 files changed, 2 insertions, 178 deletions
| diff --git a/acinclude.m4 b/acinclude.m4 index 8334785c..9b57f504 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -302,7 +302,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [  	hid2hci_enable=${usb_found}  	dfutool_enable=no  	bcm203x_enable=no -	bluepin_enable=yes  	AC_ARG_ENABLE(fortify, AC_HELP_STRING([--disable-fortify], [disable compile time buffer checks]), [  		fortify_enable=${enableval} @@ -330,7 +329,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [  		hid2hci_enable=${enableval}  		dfutool_enable=${enableval}  		bcm203x_enable=${enableval} -		bluepin_enable=${enableval}  	])  	AC_ARG_ENABLE(dbus, AC_HELP_STRING([--enable-dbus], [enable D-BUS support]), [ @@ -385,10 +383,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [  		bcm203x_enable=${enableval}  	]) -	AC_ARG_ENABLE(bluepin, AC_HELP_STRING([--enable-bluepin], [install Python based PIN helper]), [ -		bluepin_enable=${enableval} -	]) -  	if (test "${fortify_enable}" = "yes"); then  		CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"  	fi @@ -415,5 +409,4 @@ AC_DEFUN([AC_ARG_BLUEZ], [  	AM_CONDITIONAL(HID2HCI, test "${hid2hci_enable}" = "yes" && test "${usb_found}" = "yes")  	AM_CONDITIONAL(DFUTOOL, test "${dfutool_enable}" = "yes" && test "${usb_found}" = "yes")  	AM_CONDITIONAL(BCM203X, test "${bcm203x_enable}" = "yes" && test "${usb_found}" = "yes") -	AM_CONDITIONAL(BLUEPIN, test "${bluepin_enable}" = "yes")  ]) diff --git a/bootstrap-configure b/bootstrap-configure index ad595294..a48c2b8f 100755 --- a/bootstrap-configure +++ b/bootstrap-configure @@ -13,5 +13,4 @@ fi  		--localstatedir=/var \  		--enable-all \  		--disable-pcmcia \ -		--disable-initscripts \ -		--disable-bluepin +		--disable-initscripts diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 94508c66..edaa129e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,9 +1,5 @@ -if BLUEPIN -bin_SCRIPTS = bluepin -endif - -EXTRA_DIST = bluepin bluetooth.init bluetooth.default create_dev +EXTRA_DIST = bluetooth.init bluetooth.default create_dev  MAINTAINERCLEANFILES = Makefile.in diff --git a/scripts/bluepin b/scripts/bluepin deleted file mode 100755 index 741765b7..00000000 --- a/scripts/bluepin +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/python -# -# Bluetooth PIN helper -# Written by Maxim Krasnyansky <maxk@qualcomm.com> -# -import sys, os, string, popen2, pygtk - -pygtk.require('2.0') - -# X Display initialization. -# Find running X Server and parse its arguments. -# Set environment variables DISPLAY and XAUTHORITY -# using info extracted from X Server args. -# -def set_display(): -	disp = ":0" -	auth = "" -	proc = "-C X -C Xorg -C XFree86" -	ps   = "/bin/ps " + proc + " --format args --no-headers" - -	r,w = popen2.popen2(ps) -	arg = string.split(r.read()) -	for i in range(1, len(arg)): -		if arg[i][0] != '-' and i==1: -			disp = arg[i] -		elif arg[i] == "-auth": -			auth = arg[i+1] -			break - -	os.environ['DISPLAY']    = disp  -	os.environ['XAUTHORITY'] = auth - -# Set X display before initializing GTK -set_display() - -# Some versions of fontconfig will segfault if HOME isn't set. -os.environ['HOME'] = "" - -import gtk - -# Dialog Class -DLG_OK = 1 -DLG_CANCEL = 2 -class Dialog(gtk.Dialog): -	result = DLG_CANCEL  -	args = {} -	def __init__(self, modal=gtk.FALSE, mesg=None, args = {}): -		gtk.Dialog.__init__(self) -		self.args = args -		self.set_modal(modal) -#		self.set_usize(400, 0) -#		self.set_uposition(300,300) -		 -		self.connect("destroy", self.quit) -		self.connect("delete_event", self.quit) - -		self.action_area.set_border_width(2) - -		ok = gtk.Button("Accept") -		ok.connect("clicked", self.ok) -		self.action_area.pack_start(ok, padding = 20) -		ok.show() - -		cl = gtk.Button("Reject") -		cl.connect("clicked", self.cancel) -		self.action_area.pack_start(cl, padding = 20) -		cl.show() - -		if mesg: -			msg = gtk.Label("") -			msg.set_text(mesg) -			self.vbox.pack_start(msg, padding = 10) -			msg.show() - -		self.ents = [] -		for k in self.args.keys(): -			hbox = gtk.HBox() -			hbox.set_border_width(5) -			self.vbox.pack_start(hbox) -			hbox.show() - -			l = gtk.Label("") -			e = gtk.Entry() -			l.set_text( k ) -			e.set_text( self.args[k] ) -			e.connect("key_press_event", self.key_press) -			hbox.pack_start(l, padding = 10, expand = gtk.FALSE) -			hbox.pack_start(e) -			l.show() -			e.show() - -			self.ents.append( (k, e) ) - -		self.ents[0][1].grab_focus() - -	def key_press(self, entry, event): -		if event.keyval == gtk.keysyms.Return: -			entry.emit_stop_by_name("key_press_event") -			self.ok() -		elif event.keyval == gtk.keysyms.Escape: -			entry.emit_stop_by_name("key_press_event") -			self.cancel() - -	def ok(self, *args): -		self.result = DLG_OK  -		for e in self.ents: -			k = e[0] -			self.args[k] = e[1].get_text()  -		self.quit() - -	def cancel(self, *args): -		self.result = DLG_CANCEL  -		self.quit() - -	def quit(self, *args): -		self.hide() -		self.destroy() -		gtk.mainquit() - -def dialog(title, mesg, args, modal = gtk.FALSE): -	dlg = Dialog(args = args, mesg = mesg, modal = modal) -	dlg.set_title(title) -	dlg.show() -	gtk.mainloop() -	return dlg.result - -def main(*args): -	if len(sys.argv) < 2: -		print "ERR" -		sys.exit() -	 -	dir    = sys.argv[1] -	bdaddr = sys.argv[2] - -	if len(sys.argv) > 3: -		name = sys.argv[3] -	else: -		name = "" - -	title = "Bluetooth PIN Code" - -	# Bluetooth spec recommends automatic strong random PIN generation. -	# So eventually we should implement that.  -	pin = { "PIN": "" } - -	if dir == "out": -		mesg = "Outgoing connection to " -	else: -		mesg = "Incoming connection from " -	 -	mesg = mesg + name + "[" + bdaddr + "]" - -	if dialog(title, mesg, pin) == DLG_OK: -		pin["PIN"] = string.strip(pin["PIN"]) - -		if len(pin["PIN"]) >= 1 and len(pin["PIN"]) <= 16: -			print "PIN:" + pin["PIN"] -		else: -			print "ERR" -	else: -		print "ERR" - -# -main() | 
