[Pythonmac-SIG] Macintosh Appletalk connections?

Erik van Blokland erik@letterror.com
Fri, 31 Mar 2000 10:09:45 +0200


--Emailer_-1257567820
Content-Type: text/plain; charset="US-ASCII"

-- Schollnick, Benjamin [3/30/00 10:33 PM]:

>I'll try this a little bit later 'morrow, and see how it works.
>It sounds like this will do quite well.
>
>Trick question, though, how do I "eject" / "unmount" 	the
>drive?

heh heh, the other side of the problem. Alright, here is unmountvolume 
which unmounts volumes by name. Note it's not called unmountservervolume 
as it appears to also unmount local volumes. The Finder seems to be 
bothered if you unmount the volume right after mounting it, but that 
might just be my system.

Have fun,
Erik



# code generated by AECaptureParser v 0.003

import aetools
import aetypes
class eventtalker(aetools.TalkTo):
	pass

def mountservervolume(volume, server, username, password):
	talker = eventtalker("MACS")
	 = {}
	attrs = {}
	args["PASS"] = password
	args["USER"] = username
	args["SRVR"] = server
	args['----'] = volume
	_reply, args, attrs = talker.send("aevt", "mvol", args, attrs)
	if args.has_key('errn'):
		raise aetools.Error, aetools.decodeerror(args)
	if args.has_key('----'):
		return args['----']

def unmountvolume(volume):
	talker = eventtalker("MACS")
	args = {}
	attrs = {}
	AEobject_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cdis'), 
form="name", seld=volume, fr=None)
	args['----'] = AEobject_00
	_reply, args, attrs = talker.send("fndr", "ptwy", args, attrs)
	if args.has_key('errn'):
		raise aetools.Error, aetools.decodeerror(args)
	if args.has_key('----'):
		return args['----']

mountservervolume('Robot', 'Robot CE', 'erik', '123')
unmountvolume('Robot')



--Emailer_-1257567820
Content-Type: application/mac-binhex40; name="mountvolume.py.hqx"


(This file must be converted with BinHex 4.0)
:$Qe[G@jdGQpXG@eP,R"j!&4&@&43D@4P!3!!!!2V!!!#!pGh)b"MEf4P)'GPEQ9
bBA4PC#"LH5""480KF(4eFQ93BA*cCA)JGL!`,M!`-`dM)'9bD@Y!E'9dG'9bFQp
b,Q0[E3d0D@e`Eh*d)'&PG'p[E(-0D@e`Eh*d)'&PG(P`CA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