[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Problem with uic.loadUiType
From:       "Rapczak, Jesse" <jrapczak () soe ! sony ! com>
Date:       2012-01-25 23:29:25
Message-ID: 429AA9673D00424FADF9905B7CFFC31B07D0D13C () mail-sd6 ! ad ! soe ! sony ! com
[Download RAW message or body]

Found the solution thanks to my colleague Christian Akesson:

 

http://christianakesson.com/2011/122

 

Crazy error.

 

From: pyqt-bounces@riverbankcomputing.com
[mailto:pyqt-bounces@riverbankcomputing.com] On Behalf Of Rapczak, Jesse
Sent: Tuesday, January 24, 2012 6:14 PM
To: pyqt@riverbankcomputing.com
Subject: Re: [PyQt] Problem with uic.loadUiType

 

Weird, I ran the example code in my C:\Python26 directory, then
re-copied the PyQt4 folder from site-packages to Maya's Python
interpreter path and everything works now.

 

But... why?? J

 

From: pyqt-bounces@riverbankcomputing.com
[mailto:pyqt-bounces@riverbankcomputing.com] On Behalf Of Rapczak, Jesse
Sent: Tuesday, January 24, 2012 5:32 PM
To: pyqt@riverbankcomputing.com
Subject: Re: [PyQt] Problem with uic.loadUiType

 

Hmm, I'm dumbfounded. Anyone else have any idea what could cause this
not to work on my system? PyQt works fine otherwise, inside of Maya and
out.

 

From: Panupat Chongstitwattana [mailto:panupatc@gmail.com] 
Sent: Monday, January 23, 2012 11:38 AM
To: Rapczak, Jesse
Subject: Re: [PyQt] Problem with uic.loadUiType

 

Sorry I am unable to recreate the error. That line with uic runs fine on
my end : /

On Tue, Jan 24, 2012 at 12:13 AM, Rapczak, Jesse <jrapczak@soe.sony.com>
wrote:

Sure. I'm trying to use the example here:

 

http://dl.dropbox.com/u/1633130/PyQt%20tuts/example1.py

http://dl.dropbox.com/u/1633130/PyQt%20tuts/example1.ui

 

This is from http://nathanhorne.com/?p=451

 

From: Panupat Chongstitwattana [mailto:panupatc@gmail.com] 
Sent: Monday, January 23, 2012 11:11 AM
To: Rapczak, Jesse
Subject: Re: [PyQt] Problem with uic.loadUiType

 

Can we see your code?

On Tue, Jan 24, 2012 at 12:04 AM, Rapczak, Jesse <jrapczak@soe.sony.com>
wrote:

Hey all,

I'm relatively new to PyQt and am trying to use uic.loadUiType to load
up a .ui file at runtime. However, I'm getting the following error. I
must be doing something wrong... any ideas?

# Error: <type 'exceptions.SyntaxError'>: invalid syntax (<string>, line
31)
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File "c:\Tools\Maya\Common\Utilities\BranchSelector\example1.py",
line 40, in <module>
#     listExample_form, listExample_base =
uic.loadUiType('C:\Tools\Maya\Common\Utilities\BranchSelector\example1.u
i')
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\__init__.py",
line 200, in loadUiType
#     winfo = compiler.UICompiler().compileUi(uifile, code_string,
from_imports)
#   File
"c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\Compiler\compiler.py",
line 55, in __init__
#     CompilerCreatorPolicy())
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\uiparser.py",
line 127, in __init__
#     self.factory = QObjectCreator(creatorPolicy)
#   File "c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\objcreator.py",
line 91, in __init__
#     if load_plugin(open(filename), plugin_globals, plugin_locals):
#   File
"c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\port_v2\load_plugin.py",
line 47, in load_plugin
#     raise WidgetPluginError("%s: %s" % (e.__class__, str(e)))
# WidgetPluginError: <type 'exceptions.SyntaxError'>: invalid syntax
(<string>, line 31) #


Thanks!

--
Jesse Rapczak
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

 

 


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" \
CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
span.wrc13
	{mso-style-name:wrc13;}
span.wrc0
	{mso-style-name:wrc0;}
span.EmailStyle21
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.EmailStyle22
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.EmailStyle23
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Found the \
solution thanks to my colleague Christian Akesson:<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><a href="http://christianakesson.com/2011/122">http://christianakesson.com/2011/122</a><o:p></o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Crazy error.<o:p></o:p></p><p \
class=MsoNormal><a name="_MailEndCompose"><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></a></p><div><div \
style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p \
class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> \
pyqt-bounces@riverbankcomputing.com [mailto:pyqt-bounces@riverbankcomputing.com] \
<b>On Behalf Of </b>Rapczak, Jesse<br><b>Sent:</b> Tuesday, January 24, 2012 6:14 \
PM<br><b>To:</b> pyqt@riverbankcomputing.com<br><b>Subject:</b> Re: [PyQt] Problem \
with uic.loadUiType<o:p></o:p></span></p></div></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Weird, I \
ran the example code in my C:\Python26 directory, then re-copied the PyQt4 folder \
from site-packages to Maya&#8217;s Python interpreter path and everything works \
now.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>But&#8230; \
why?? </span><span style='font-size:11.0pt;font-family:Wingdings;color:#1F497D'>J</span><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div \
style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p \
class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> <a \
href="mailto:pyqt-bounces@riverbankcomputing.com">pyqt-bounces@riverbankcomputing.com</a> \
[<a href="mailto:pyqt-bounces@riverbankcomputing.com">mailto:pyqt-bounces@riverbankcomputing.com</a>] \
<b>On Behalf Of </b>Rapczak, Jesse<br><b>Sent:</b> Tuesday, January 24, 2012 5:32 \
PM<br><b>To:</b> <a href="mailto:pyqt@riverbankcomputing.com">pyqt@riverbankcomputing.com</a><br><b>Subject:</b> \
Re: [PyQt] Problem with uic.loadUiType<o:p></o:p></span></p></div></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hmm, \
I&#8217;m dumbfounded. Anyone else have any idea what could cause this not to work on \
my system? PyQt works fine otherwise, inside of Maya and out.<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div \
style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p \
class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Panupat Chongstitwattana \
[<a href="mailto:panupatc@gmail.com">mailto:panupatc@gmail.com</a>] <br><b>Sent:</b> \
Monday, January 23, 2012 11:38 AM<br><b>To:</b> Rapczak, Jesse<br><b>Subject:</b> Re: \
[PyQt] Problem with uic.loadUiType<o:p></o:p></span></p></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal \
style='margin-bottom:12.0pt'>Sorry I am unable to recreate the error. That line with \
uic runs fine on my end : /<o:p></o:p></p><div><p class=MsoNormal>On Tue, Jan 24, \
2012 at 12:13 AM, Rapczak, Jesse &lt;<a \
href="mailto:jrapczak@soe.sony.com">jrapczak@soe.sony.com</a>&gt; \
wrote:<o:p></o:p></p><div><div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Sure. \
I&#8217;m trying to use the example here:</span><o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a \
href="http://dl.dropbox.com/u/1633130/PyQt%20tuts/example1.py" \
target="_blank">http://dl.dropbox.com/u/1633130/PyQt%20tuts/example1.py</a></span><o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a \
href="http://dl.dropbox.com/u/1633130/PyQt%20tuts/example1.ui" \
target="_blank">http://dl.dropbox.com/u/1633130/PyQt%20tuts/example1.ui</a></span><o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This is \
from </span><a href="http://nathanhorne.com/?p=451" \
target="_blank">http://nathanhorne.com/?p=451</a><o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a \
name="1350b8eb3e8f3814__MailEndCompose"><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span></a><o:p></o:p></p><div \
style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Panupat Chongstitwattana \
[mailto:<a href="mailto:panupatc@gmail.com" target="_blank">panupatc@gmail.com</a>] \
<br><b>Sent:</b> Monday, January 23, 2012 11:11 AM<br><b>To:</b> Rapczak, \
Jesse<br><b>Subject:</b> Re: [PyQt] Problem with \
uic.loadUiType</span><o:p></o:p></p></div><div><div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>Can we see your \
code?<o:p></o:p></p><div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Tue, Jan 24, 2012 at \
12:04 AM, Rapczak, Jesse &lt;<a href="mailto:jrapczak@soe.sony.com" \
target="_blank">jrapczak@soe.sony.com</a>&gt; wrote:<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hey all,<br><br>I'm \
relatively new to PyQt and am trying to use uic.loadUiType to load<br>up a .ui file \
at runtime. However, I'm getting the following error. I<br>must be doing something \
wrong... any ideas?<br><br># Error: &lt;type 'exceptions.SyntaxError'&gt;: invalid \
syntax (&lt;string&gt;, line<br>31)<br># Traceback (most recent call last):<br># \
&nbsp; File &quot;&lt;maya console&gt;&quot;, line 1, in &lt;module&gt;<br># &nbsp; \
File &quot;c:\Tools\Maya\Common\Utilities\BranchSelector\example1.py&quot;,<br>line \
40, in &lt;module&gt;<br># &nbsp; &nbsp; listExample_form, listExample_base \
=<br>uic.loadUiType('C:\Tools\Maya\Common\Utilities\BranchSelector\example1.u<br>i')<br># \
&nbsp; File &quot;c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\__init__.py&quot;,<br>line \
200, in loadUiType<br># &nbsp; &nbsp; winfo = compiler.UICompiler().compileUi(uifile, \
code_string,<br>from_imports)<br># &nbsp; \
File<br>&quot;c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\Compiler\compiler.py&quot;,<br>line \
55, in __init__<br># &nbsp; &nbsp; CompilerCreatorPolicy())<br># &nbsp; File \
&quot;c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\uiparser.py&quot;,<br>line 127, \
in __init__<br># &nbsp; &nbsp; self.factory = QObjectCreator(creatorPolicy)<br># \
&nbsp; File &quot;c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\objcreator.py&quot;,<br>line \
91, in __init__<br># &nbsp; &nbsp; if load_plugin(open(filename), plugin_globals, \
plugin_locals):<br># &nbsp; \
File<br>&quot;c:\Tools\Maya\Version\2012\Utilities\PyQt4\uic\port_v2\load_plugin.py&quot;,<br>line \
47, in load_plugin<br># &nbsp; &nbsp; raise WidgetPluginError(&quot;%s: %s&quot; % \
(e.__class__, str(e)))<br># WidgetPluginError: &lt;type 'exceptions.SyntaxError'&gt;: \
invalid syntax<br>(&lt;string&gt;, line 31) #<br><br><br>Thanks!<br><span \
style='color:#888888'><br>--<br>Jesse \
Rapczak<br>_______________________________________________<br>PyQt mailing list \
&nbsp; &nbsp;<a href="mailto:PyQt@riverbankcomputing.com" \
target="_blank">PyQt@riverbankcomputing.com</a><br><a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></span><o:p></o:p></p></div><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div></div></div></div></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
--===============1283403484807009089==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic