r4874 - developers/erin_yueh/bt

erin_yueh at docs.openmoko.org erin_yueh at docs.openmoko.org
Tue Dec 16 10:35:05 CET 2008


Author: erin_yueh
Date: 2008-12-16 10:35:03 +0100 (Tue, 16 Dec 2008)
New Revision: 4874

Modified:
   developers/erin_yueh/bt/browse_device.py
   developers/erin_yueh/bt/bt_adapter.py
   developers/erin_yueh/bt/bt_main.py
   developers/erin_yueh/bt/pin.py
   developers/erin_yueh/bt/preferences.py
   developers/erin_yueh/bt/send_file.py
Log:
add GPL2 license, still testing version 0.1


Modified: developers/erin_yueh/bt/browse_device.py
===================================================================
--- developers/erin_yueh/bt/browse_device.py	2008-12-16 06:59:37 UTC (rev 4873)
+++ developers/erin_yueh/bt/browse_device.py	2008-12-16 09:35:03 UTC (rev 4874)
@@ -1,5 +1,23 @@
 #!/usr/bin/env python
 
+# browse_device.py - A pygtk2 application to demonstrate bluetooth functions
+#
+# Version 0.1
+#
+# Authors: Erin Yueh <erinyueh at gmail.com>
+#
+# Copyright (c) 2008 Erin Yueh
+#
+# browse_device.py is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# browse_device.py is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
 import pygtk
 pygtk.require('2.0')
 

Modified: developers/erin_yueh/bt/bt_adapter.py
===================================================================
--- developers/erin_yueh/bt/bt_adapter.py	2008-12-16 06:59:37 UTC (rev 4873)
+++ developers/erin_yueh/bt/bt_adapter.py	2008-12-16 09:35:03 UTC (rev 4874)
@@ -1,5 +1,23 @@
 #!/usr/bin/env python
 
+# bt_adapter.py - A pygtk2 application to demonstrate bluetooth functions
+#
+# Version 0.1
+#
+# Authors: Erin Yueh <erinyueh at gmail.com>
+#
+# Copyright (c) 2008 Erin Yueh
+#
+# bt_adapter.py is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# browse_device.py is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
 import gtk, gobject
 import browse_device
 

Modified: developers/erin_yueh/bt/bt_main.py
===================================================================
--- developers/erin_yueh/bt/bt_main.py	2008-12-16 06:59:37 UTC (rev 4873)
+++ developers/erin_yueh/bt/bt_main.py	2008-12-16 09:35:03 UTC (rev 4874)
@@ -1,5 +1,24 @@
 #!/usr/bin/env python
 
+# bt_main.py - A pygtk2 application to demonstrate bluetooth functions
+#
+# Version 0.1
+#
+# Authors: Erin Yueh <erinyueh at gmail.com>
+#
+# Copyright (c) 2008 Erin Yueh
+#
+# bt_main.py is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# browse_device.py is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
+
 import gtk, gobject
 import browse_device, pin, send_file
 import bt_adapter 

Modified: developers/erin_yueh/bt/pin.py
===================================================================
--- developers/erin_yueh/bt/pin.py	2008-12-16 06:59:37 UTC (rev 4873)
+++ developers/erin_yueh/bt/pin.py	2008-12-16 09:35:03 UTC (rev 4874)
@@ -1,3 +1,24 @@
+#!/usr/bin/env python
+
+# pin.py - A pygtk2 application to demonstrate bluetooth functions
+#
+# Version 0.1
+#
+# Authors: Erin Yueh <erinyueh at gmail.com>
+#
+# Copyright (c) 2008 Erin Yueh
+#
+# pin.py is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# browse_device.py is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
+
 import dbus
 import dbus.glib
 import dbus.service

Modified: developers/erin_yueh/bt/preferences.py
===================================================================
--- developers/erin_yueh/bt/preferences.py	2008-12-16 06:59:37 UTC (rev 4873)
+++ developers/erin_yueh/bt/preferences.py	2008-12-16 09:35:03 UTC (rev 4874)
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+# preferences.py - A pygtk2 application to demonstrate bluetooth functions
+#
+# Version 0.1
+#
+# Authors: Erin Yueh <erinyueh at gmail.com>
+#
+# Copyright (c) 2008 Erin Yueh
+#
+# preferences.py is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# browse_device.py is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.

Modified: developers/erin_yueh/bt/send_file.py
===================================================================
--- developers/erin_yueh/bt/send_file.py	2008-12-16 06:59:37 UTC (rev 4873)
+++ developers/erin_yueh/bt/send_file.py	2008-12-16 09:35:03 UTC (rev 4874)
@@ -1,5 +1,24 @@
 #!/usr/bin/env python
 
+# send_file.py - A pygtk2 application to demonstrate bluetooth functions
+#
+# Version 0.1
+#
+# Authors: Erin Yueh <erinyueh at gmail.com>
+#
+# Copyright (c) 2008 Erin Yueh
+#
+# send_file.py is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# browse_device.py is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
+
 import pygtk
 pygtk.require('2.0')
 
@@ -30,15 +49,15 @@
         self.filew.connect("destroy", self.destroy)
         # Connect the ok_button to file_ok_sel method
         self.filew.ok_button.connect("clicked", self.file_ok_sel)
-    
+
         # Connect the cancel_button to destroy the widget
         self.filew.cancel_button.connect("clicked",
                                          lambda w: self.filew.destroy())
-    
+
         # Lets set the filename, as if this were a save dialog,
         # and we are giving a default filename
         self.filew.set_filename("penguin.png")
-    
+
         self.filew.show()
 
 class SelectDevice:
@@ -59,21 +78,18 @@
         self.prepare_to_send(addr)
 
     def __browsexml(self, doc):
-        record=doc.documentElement
-        
+        record = doc.documentElement
         for node in record.childNodes:
             if node.nodeType == node.ELEMENT_NODE and node.getAttribute('id') == '0x0004':
                 val = node.getElementsByTagName('uint8')
                 return int(val[0].getAttribute('value'), 16)
 
-    def resolveService(self, addr, service='FTP' ):
-        
-        #service_handle = self.adapter.GetRemoteServiceHandles(addr,'')
+    def resolveService(self, addr, service='FTP' ): 
+
         service_handle = self.bt.bluetooth_adapter.getRemoteServiceHandles(addr,'FTP')
-        print 'service_handle: ',service_handle
         if service_handle:
-            xml= self.bt.bluetooth_adapter.getRemoteServiceRecordAsXML(addr,service_handle[0])
-            doc=parseString(xml)
+            xml = self.bt.bluetooth_adapter.getRemoteServiceRecordAsXML(addr,service_handle[0])
+            doc = parseString(xml)
             return self.__browsexml(doc)
         else:
             return None
@@ -89,11 +105,7 @@
                 print 'sendfile ERROR',e 
         else:
             print 'No FTP service'
-        
-        
-    def start_sending(self, widget):
-        print 'starting_sending'
-        
+
     def __init__(self,bt,name):
         print 'SelectDevice: dev_list'
         self.sendfname = name
@@ -114,15 +126,11 @@
         win.sm = gtk.TreeModelSort(self.liststore)
         # Set sort column
         win.sm.set_sort_column_id(1, gtk.SORT_ASCENDING)
-        
+
         win.tv = gtk.TreeView(win.sm)
         win.tv.connect("row-activated", self.col1_toggled_cb)
         win.vbox.pack_start(win.sw)
-        
-        win.b = gtk.Button('Send File...')
-        win.b.connect('clicked', self.start_sending)
-        win.vbox.pack_start(win.b, False)
-        
+
         win.sw.add(win.tv)
         win.tv.column = [None]*2
         win.tv.column[0] = gtk.TreeViewColumn('Name')




More information about the commitlog mailing list