Re: Getting USB volume serial number from inserted device on OSX

2013-04-05 Thread Sven
On 5 April 2013 06:20, Tim Roberts t...@probo.com wrote:

 John Nagle na...@animats.com wrote:
 
That would be useful to have as a portable function for all USB
 devices.  Serial port devices are particularly annoying, because their
 port number is somewhat random when there's more than one, and changes
 on hot-plugging.

 There is no portable solution.  Every operating system handles this kind of
 this very differently.  Remember, the operating system abstractions are all
 designed to hide this from you.  When you open a serial port or an audio
 device or use a file system, you aren't supposed to KNOW that there is a
 USB device behind it


Indeed. Which means I have a working solution under Linux, but I am
struggling to find one under OS  X.

Looks like I might have to resort to just parsing the USB tree until I find
the device that was inserted.

-- 
./Sven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting USB volume serial number from inserted device on OSX

2013-04-04 Thread John Nagle
On 4/2/2013 3:18 PM, Sven wrote:
 Hello,
 
 I am using Python 2.7 with pyobjc on Lion and NSNotification center to
 monitor any inserted USB volumes. This works fine.
 
 I've also got some ideas how to get a device's serial number, but these
 involve just parsing all the USB devices ('system_profiler SPUSBDataType'
 command). However I'd like to specifically query the inserted device only
 (the one creating the notification) rather than checking the entire USB
 device list. The latter seems a little inefficient and wrong.

   That would be useful to have as a portable function for all USB
devices.  Serial port devices are particularly annoying, because their
port number is somewhat random when there's more than one, and changes
on hot-plugging.

John Nagle
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting USB volume serial number from inserted device on OSX

2013-04-04 Thread Tim Roberts
John Nagle na...@animats.com wrote:

   That would be useful to have as a portable function for all USB
devices.  Serial port devices are particularly annoying, because their
port number is somewhat random when there's more than one, and changes
on hot-plugging.

There is no portable solution.  Every operating system handles this kind of
this very differently.  Remember, the operating system abstractions are all
designed to hide this from you.  When you open a serial port or an audio
device or use a file system, you aren't supposed to KNOW that there is a
USB device behind it.
-- 
Tim Roberts, t...@probo.com
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting USB volume serial number from inserted device on OSX

2013-04-03 Thread Sven
Apologies. The main app is in python, and I would like to know any
alternative methods to do this in Python on OS X. Doesn't have to use the
OS X APIs.

I'll try elsewhere too though. Thanks


On 3 April 2013 00:37, Ned Deily n...@acm.org wrote:

 In article
 CAEH=cXV0DJa6CCZ4T1RvL2L1g7D_mdDF4=52vugcm5mwt18...@mail.gmail.com,
  Sven sven...@gmail.com wrote:
  I am using Python 2.7 with pyobjc on Lion and NSNotification center to
  monitor any inserted USB volumes. This works fine.
 [...]

 Since your question really is about OS X APIs and not Python or even
 PyObjC, you're more likely to get a meaningful answer elsewhere.  Try
 StackOverflow or one of the OS X lists.

 --
  Ned Deily,
  n...@acm.org

 --
 http://mail.python.org/mailman/listinfo/python-list




-- 
./Sven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting USB volume serial number from inserted device on OSX

2013-04-02 Thread Ned Deily
In article 
CAEH=cXV0DJa6CCZ4T1RvL2L1g7D_mdDF4=52vugcm5mwt18...@mail.gmail.com,
 Sven sven...@gmail.com wrote:
 I am using Python 2.7 with pyobjc on Lion and NSNotification center to
 monitor any inserted USB volumes. This works fine.
[...]

Since your question really is about OS X APIs and not Python or even 
PyObjC, you're more likely to get a meaningful answer elsewhere.  Try 
StackOverflow or one of the OS X lists.

-- 
 Ned Deily,
 n...@acm.org

-- 
http://mail.python.org/mailman/listinfo/python-list