Chris,

Thanks again for the explanation I've added that to my tutorial.

http://gnipsel.com/linuxcnc/gui/gui06e.html

John

On 9/1/2012 12:30 PM, Chris Morley wrote:
>
>
>> Date: Sat, 1 Sep 2012 10:05:23 -0500
>> From: bjt...@gmail.com
>> To: emc-users@lists.sourceforge.net
>> Subject: Re: [Emc-users] Postgui
>>
>> Hi Chris,
>>
>> Thanks for the explanation that helps a lot in understanding what the
>> heck is going on. I do mostly monkey see, monkey do programming so
>> understanding more slowly changes that...
>>
>> John
>>
> Oh I do exactly the same thing - hack away till it works :)
> I just started about 6 months a head of you!
>
> I was thinking I might not have been clear about the postgui() method.
> here is the relevent code:
>
>      def postgui(self):
>          inifile=self.linuxcnc.emc.ini(sys.argv[2])
>          postgui_halfile = inifile.find("HAL", "POSTGUI_HALFILE")
>          return postgui_halfile,sys.argv[2]
>
> This returns the postgui file name (if there is one) and the INI path
> This is in the touchy class definition code.
>
> usually you would call it like this:
> filename,inipath = self.postgui()
>
> when called like this python automatically calls the method with the instance 
> name first.
> that is why in the definition code [ def postgui(self) ] it uses 'self'
> self represents the instance name
>   
> but when called out side of the touchy class you must call it like this:
>
> filename,inipath = touchy.postgui(hwg)
>
> because you are outside the class, python doesn't know what instance or class 
> you
> are referring to. so you must specify the touchy class and the hwg instance.
>
> clear as mud hey!
> Don't ask me how many tries it took for me to get that right!
>
> Chris M
>   
>
>
>                                       
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to