[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.



Yes, that code is in the current scrap_clipboard.py that I'm testing.
I saw that exception and was confused it was not running into that one. I'm a bit stressed last days, will hopefully try it again from shell and not from WingIDE later on. But I guess that won't solve the problem. I can play around with it having a bit more time to locate the problem. I will also try your idea below again (guess that's the code I tried first time).


Aaaaah, hold on, I can vaguely remember a similar problem I had once. It had to do with a pygame object type that I wanted to assign to a new variable. I was forced then to manually initiate the variable first before assigning a value with that object type (like an image, but I can't remember what type it was).

Can you confirm that the code works as such on your system (Windows, Linux, ...) ?

Regards
Farai


Am 10.04.2006 um 02:16 schrieb Rene Dudfield:

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.