Re: [pysystray-users] @systray.threaded Error when running sample.py
Status: Beta
Brought to you by:
essiene
From: Essien I. E. <es...@da...> - 2006-05-29 19:21:59
|
Sajjad Hussain wrote: > Hi, > > All of my company's software is written with version > 2.3.3. So it is very important that any tool, script > we write must be consistent with that version. I don't > want to break (not a likely chance) any of my code by > switching version. Anyways, is there a work around to > this problem? It would really shorten my work if I > integrate pysystray in my project. > Hmmm... I've coded this quick 'untested' workaround. I'm currently not working from Windows so I don't know if this works. The idea, is to check sys.version and if its less than 2.4, I conditionally define _start_control() to use or not use the threading decorator. Its a dirty hack. Replace your bases.py with the attached bases.py and see if that solves it. You won't for now be able to use the @systray.threaded decorator too, so you can comment that out of the sample. Also, using App.start() will *block* and won't return till the function finishes, since it isn't threaded *anymore* due to this hack. I guess my *unvoiced* advice is that you should attempt migrating to 2.4 (it's going to be a pain to keep this in sync with 2.3, since i don't use it anymore, I wouldn't know when I break it :( ) First though, let me know if this works. cheers, Essien > Regards, > > Sajjad > > --- Essien Ita Essien <es...@da...> wrote: > > >> Hi, >> >> Sorry for replying late... just came back from a >> loooong weekend (public >> holiday here :D) >> >> Sajjad Hussain wrote: >> >>> Hi everyone, >>> >>> I have just installed systray-0.6.1.win32.exe on >>> >> my >> >>> PythonWin 2.3.3. I downloaded >>> pysystray-sample-0.6.1.zip, unzipped it and tried >>> running sample.py. I am getting this error: >>> >>> [/cygdrive/c/design/Miscellaneous/ >>> Taskbar/pysystray-sample-0.6.1]: python sample.py >>> >>> File "sample.py", line 17 >>> @systray.threaded >>> ^ >>> SyntaxError: invalid syntax >>> >>> >> Hmmm... it seems Python 2.3 doesn't support >> decorators (that's the >> syntax for decorators)? You should use Python 2.4 or >> newer. Any reason >> you're using 2.3? >> >> Cheers, >> Essien >> >> >> >> > ------------------------------------------------------- > >> All the advantages of Linux Managed Hosting--Without >> the Cost and Risk! >> Fully trained technicians. The highest number of Red >> Hat certifications in >> the hosting industry. Fanatical Support. Click to >> learn more >> >> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > >> _______________________________________________ >> pysystray-users mailing list >> pys...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/pysystray-users > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications in > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > _______________________________________________ > pysystray-users mailing list > pys...@li... > https://lists.sourceforge.net/lists/listinfo/pysystray-users > |