[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Mac pygame user wanted to help test new pygame clipboard support.



Weird.  There is supposed to be a try/except around it so that it will
catch if it is undefined, and then define it.

Is this code in your scrap_clipboard.py file?

try:
    x = SCRAP_TEXT
except:
    SCRAP_TEXT = 1413830740

If it is... weird.  Could you please try changing it to just
SCRAP_TEXT = 1413830740

Thanks for your help!



On 4/10/06, Farai Aschwanden <fash@xxxxxxxxxx> wrote:
> Sorry, it crashed again. After starting the small black window
> appears then it disappears and the following error comes up:
>
> NamedError: name 'SCRAP_TEXT' is not defined
>
> The editor stops at line 20:
>      x = SCRAP_TEXT
>
> I have to say that I let it run in WingIDE (Python Edtior) that
> offers autocomplete. When entering SCRAP... it shows me "SCRAP_TEXT"
> in the list but somehow Python cannot handle it.
>
> Lemme know when I can try again.
>
>
>
>
> Am 09.04.2006 um 23:54 schrieb Rene Dudfield:
>
> > Thanks
> >
> > Could you please try them again?
> >
> > http://rene.f0o.com/~rene/stuff/scrap_clipboard.py
> > http://rene.f0o.com/~rene/stuff/mac_scrap.py
> >
> >
> > Cheers,
> >
> > On 4/9/06, Farai Aschwanden <fash@xxxxxxxxxx> wrote:
> >> Hello
> >>
> >> I tested it so far on my Mac (PPC, OSX 10.4, Python 2.3, Pygame
> >> 1.70). After saving both with their right name, starting
> >> scrap_clipboard.py and pressing "g" I got the following error on
> >> scrap_clipboard.py:
> >>
> >> NameError: name 'SCRAP_TEXT is not defined in scrap_clipboard.py
> >> Stoped at line: r = pygame.scrap.get(SCRAP_TEXT)
> >>
> >> Similar when pressing "p":
> >> pygame.scrap.put(SCRAP_TEXT, "Hello.  This is a message from scrap.")
> >> Stoped at line: pygame.scrap.put(SCRAP_TEXT, "Hello.  This is a
> >> message from scrap.")
> >>
> >> Greetings
> >> Farai
> >>
> >>
> >>
> >>
> >>
> >> Am 09.04.2006 um 10:17 schrieb Rene Dudfield:
> >>
> >>> Anyone able to test out clipboard support on the mac?
> >>>
> >>> If so download both of these scripts and run the scrap_clipboard.py
> >>> one.
> >>> http://rene.f0o.com/~rene/stuff/scrap_clipboard.py
> >>> http://rene.f0o.com/~rene/stuff/mac_scrap.py
> >>>
> >>> Press 'g' key to get stuff from the clipboard and print it to the
> >>> console.
> >>> Press 'p' key to put 'Hello.  This is a message from scrap.' in the
> >>> clipboard.
> >>>
> >>>
> >>> Thanks for any help.
> >>
> >>
>
>