[BEGINNER QUESTION]: Problem with unicode string in create-aplication.py for

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[BEGINNER QUESTION]: Problem with unicode string in create-aplication.py for

cr4yv3n
Hello qooxdoo people,

        I'm fairly new to this project and I must say it looks nice. However, I'm having trouble with even the most basic usage. I tried searching the mailing-list/forum first, but I was unable to find a post with a question similar to mine (strangely enough). Anyways, while I have used python in the past, I'm not much of an expert with unicode string literals in the language to say the least. When I tried to run the Hello World example on my Vista machine, I keep getting an error about the syntax of the unicode string at the end of \tool\pylib\ecmascript\frontend\lang.py being incorrect. I tried running the command about 4 different ways after making changes to the quotes from '''   ''' to just " " as well as changing the ur prefix to just u. Still, didn't seem to help much. Anyway, here's what I got on my console window:





C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python cre
ate-application.py --name=custom --out=C:
Traceback (most recent call last):
  File "create-application.py", line 27, in <module>
    from ecmascript.frontend import lang
  File "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
ecmascript\frontend\lang.py", line 284
    UNICODE_CATEGORY_Zs = ur'''(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u
2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]'''

                                                             ^
SyntaxError: invalid syntax

C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python cre
ate-application.py --name=custom --out=C:
Traceback (most recent call last):
  File "create-application.py", line 27, in <module>
    from ecmascript.frontend import lang
  File "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
ecmascript\frontend\lang.py", line 284
    UNICODE_CATEGORY_Zs = ur"(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u20
04\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]"

                                                         ^
SyntaxError: invalid syntax

C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python cre
ate-application.py --name=custom --out=C:
Traceback (most recent call last):
  File "create-application.py", line 27, in <module>
    from ecmascript.frontend import lang
  File "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
ecmascript\frontend\lang.py", line 284
    UNICODE_CATEGORY_Zs = u"(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u200
4\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]"

                                                        ^
SyntaxError: invalid syntax

C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>create-app
lication.py --name=custom --out=C:
Traceback (most recent call last):
  File "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin\cr
eate-application.py", line 27, in <module>
    from ecmascript.frontend import lang
  File "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
ecmascript\frontend\lang.py", line 284
    UNICODE_CATEGORY_Zs = ur'''(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u
2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]'''

                                                             ^
SyntaxError: invalid syntax


Anyone have an idea how to fix this? I'm lost. Thanks in advance for all replies.
Reply | Threaded
Open this post in threaded view
|

Re: [BEGINNER QUESTION]: Problem with unicode string in create-aplication.py for

Werner Thie
Hi

What value do you see when you do an

import sys
print sys.maxunicode

at the python prompt.

It's 0xFFFF (or 65535) for UCS-2, and 0x10FFFF (or 1114111) for UCS-4

All the qooxdoo tools work just fine for me with Python25 or Python26
compiled for UCS-2 on either Mac, Linux or MSW, never experimented with
UCS-4 though. Might be that this is the culprit?

HTH, Werner

On 02.06.2010 15:13, cr4yv3n wrote:

>
> Hello qooxdoo people,
>
>          I'm fairly new to this project and I must say it looks nice.
> However, I'm having trouble with even the most basic usage. I tried
> searching the mailing-list/forum first, but I was unable to find a post with
> a question similar to mine (strangely enough). Anyways, while I have used
> python in the past, I'm not much of an expert with unicode string literals
> in the language to say the least. When I tried to run the Hello World
> example on my Vista machine, I keep getting an error about the syntax of the
> unicode string at the end of \tool\pylib\ecmascript\frontend\lang.py being
> incorrect. I tried running the command about 4 different ways after making
> changes to the quotes from '''   ''' to just " " as well as changing the ur
> prefix to just u. Still, didn't seem to help much. Anyway, here's what I got
> on my console window:
>
>
>
>
>
> C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python
> cre
> ate-application.py --name=custom --out=C:
> Traceback (most recent call last):
>    File "create-application.py", line 27, in<module>
>      from ecmascript.frontend import lang
>    File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
> ecmascript\frontend\lang.py", line 284
>      UNICODE_CATEGORY_Zs =
> ur'''(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u
> 2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]'''
>
>                                                               ^
> SyntaxError: invalid syntax
>
> C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python
> cre
> ate-application.py --name=custom --out=C:
> Traceback (most recent call last):
>    File "create-application.py", line 27, in<module>
>      from ecmascript.frontend import lang
>    File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
> ecmascript\frontend\lang.py", line 284
>      UNICODE_CATEGORY_Zs =
> ur"(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u20
> 04\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]"
>
>                                                           ^
> SyntaxError: invalid syntax
>
> C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python
> cre
> ate-application.py --name=custom --out=C:
> Traceback (most recent call last):
>    File "create-application.py", line 27, in<module>
>      from ecmascript.frontend import lang
>    File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
> ecmascript\frontend\lang.py", line 284
>      UNICODE_CATEGORY_Zs =
> u"(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u200
> 4\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]"
>
>                                                          ^
> SyntaxError: invalid syntax
>
> C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>create-app
> lication.py --name=custom --out=C:
> Traceback (most recent call last):
>    File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin\cr
> eate-application.py", line 27, in<module>
>      from ecmascript.frontend import lang
>    File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
> ecmascript\frontend\lang.py", line 284
>      UNICODE_CATEGORY_Zs =
> ur'''(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u
> 2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]'''
>
>                                                               ^
> SyntaxError: invalid syntax
>
>
> Anyone have an idea how to fix this? I'm lost. Thanks in advance for all
> replies.

------------------------------------------------------------------------------


_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

werner.vcf (311 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [BEGINNER QUESTION]: Problem with unicode string in create-aplication.py for

Thomas Herchenroeder
In reply to this post by cr4yv3n
hi,

this is indeed strange, as this no particularly unusual code line, and i
never heard anyone reporting problems with it. which python version do
you use? can you please make sure that everything from
"UNICODE_CATEGORY_Zs =" to the final "'''" is on a single line. does
your editor do automatic line breaking?!

t.

On 06/02/2010 03:13 PM, cr4yv3n wrote:

>
> Hello qooxdoo people,
>
>         I'm fairly new to this project and I must say it looks nice.
> However, I'm having trouble with even the most basic usage. I tried
> searching the mailing-list/forum first, but I was unable to find a post with
> a question similar to mine (strangely enough). Anyways, while I have used
> python in the past, I'm not much of an expert with unicode string literals
> in the language to say the least. When I tried to run the Hello World
> example on my Vista machine, I keep getting an error about the syntax of the
> unicode string at the end of \tool\pylib\ecmascript\frontend\lang.py being
> incorrect. I tried running the command about 4 different ways after making
> changes to the quotes from '''   ''' to just " " as well as changing the ur
> prefix to just u. Still, didn't seem to help much. Anyway, here's what I got
> on my console window:
>
>
>
>
>
> C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python
> cre
> ate-application.py --name=custom --out=C:
> Traceback (most recent call last):
>   File "create-application.py", line 27, in <module>
>     from ecmascript.frontend import lang
>   File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
> ecmascript\frontend\lang.py", line 284
>     UNICODE_CATEGORY_Zs =
> ur'''(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u
> 2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]'''
>
>                                                              ^
> SyntaxError: invalid syntax
>
> C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python
> cre
> ate-application.py --name=custom --out=C:
> Traceback (most recent call last):
>   File "create-application.py", line 27, in <module>
>     from ecmascript.frontend import lang
>   File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
> ecmascript\frontend\lang.py", line 284
>     UNICODE_CATEGORY_Zs =
> ur"(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u20
> 04\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]"
>
>                                                          ^
> SyntaxError: invalid syntax
>
> C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>python
> cre
> ate-application.py --name=custom --out=C:
> Traceback (most recent call last):
>   File "create-application.py", line 27, in <module>
>     from ecmascript.frontend import lang
>   File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
> ecmascript\frontend\lang.py", line 284
>     UNICODE_CATEGORY_Zs =
> u"(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u200
> 4\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]"
>
>                                                         ^
> SyntaxError: invalid syntax
>
> C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin>create-app
> lication.py --name=custom --out=C:
> Traceback (most recent call last):
>   File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\bin\cr
> eate-application.py", line 27, in <module>
>     from ecmascript.frontend import lang
>   File
> "C:\Users\zak.hoskins\Desktop\qooxdoo-1.1-sdk\qooxdoo-1.1-sdk\tool\pylib\
> ecmascript\frontend\lang.py", line 284
>     UNICODE_CATEGORY_Zs =
> ur'''(?u)[\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u
> 2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]'''
>
>                                                              ^
> SyntaxError: invalid syntax
>
>
> Anyone have an idea how to fix this? I'm lost. Thanks in advance for all
> replies.

------------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [BEGINNER QUESTION]: Problem with unicode string in create-aplication.py for

cr4yv3n
@Werner:

>>> print (sys.maxunicode)
65535

I'm assuming UCS-2

@thron7-2:

I'm using Python 3.1.2. I'm editing this in notepad. I have no idea if the line breaks would be an issue in notepad. I normally edit .py files in KEdit on my Linux box at home and have no problems. I've used notepad in the past for small school assignments, but this is at work and unfortunately I'm not allowed to use my OS/tool suit of choice. While cmd.exe returns this string on multiple lines when the syntax error is thrown, in notepad the unicode string is just all on one single line. The only difference I note is that on my prompt, there's an "^" carrot that points to the end of the string (i.e. the double or triple quotes) when the syntax error is thrown, whereas when I pasted the message into this mailing list, it for some reason places the carrot to point at the "\u2009\" part of the string. However, that's just an issue with how the error message I pasted into the forum is represented differently than it is on my prompt, not how it's represented in notepad. That shouldn't be an issue with the code. Just wanted to let you know a little more about what my version of the interpreter was complaining about.
Reply | Threaded
Open this post in threaded view
|

Re: [BEGINNER QUESTION]: Problem with unicode string in create-aplication.py for

cr4yv3n
Oh gosh, I'm an idiot. OK, just now realized that qooxdoo doesn't support python 3+ yet. Sorry, I told the help desk guys to install python on my machine (developers here aren't allowed admin rights and therefore can't install our own stuff). I didn't think to mention I needed an older version. Sorry, but thanks for the suggestions anyway.