PySide development tools (pyuic and pyrcc)
pyside / tools Goto Github PK
View Code? Open in Web Editor NEWPySide development tools (pyuic and pyrcc)
License: GNU General Public License v2.0
PySide development tools (pyuic and pyrcc)
License: GNU General Public License v2.0
PySide's UIC can't generate a class that contains a custom widget like this:
<customwidgets>
<customwidget>
<class>MyOwnOpenGLWidget</class>
<extends>QOpenGLWidget</extends>
<header>MyOwnOpenGLWidget</header>
</customwidget>
</customwidgets>
PyQt5 UIC version doesn't have this issue.
% pyside-uic --version
PySide User Interface Compiler version 0.2.15, running on PySide 1.2.4.
% pyside-uic untitled.ui -o test.py -d
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/pysideuic/Compiler/qobjectcreator.py", line 93, in _resolveBaseclass
baseClass = self._widgets[baseClass][0]
KeyError: 'QOpenGLWidget'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/pysideuic/port_v3/invoke.py", line 34, in invoke
exit_status = driver.invoke()
File "/usr/lib/python3.5/site-packages/pysideuic/driver.py", line 60, in invoke
self._generate()
File "/usr/lib/python3.5/site-packages/pysideuic/driver.py", line 94, in _generate
compileUi(self._ui_file, pyfile, self._opts.execute, self._opts.indent, self._opts.from_imports)
File "/usr/lib/python3.5/site-packages/pysideuic/__init__.py", line 142, in compileUi
winfo = compiler.UICompiler().compileUi(uifile, pyfile, from_imports)
File "/usr/lib/python3.5/site-packages/pysideuic/Compiler/compiler.py", line 91, in compileUi
w = self.parse(input_stream)
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 867, in parse
actor(elem)
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 710, in createUserInterface
self.traverseWidgetTree(elem)
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 688, in traverseWidgetTree
handler(self, child)
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 423, in createLayout
self.traverseWidgetTree(elem)
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 688, in traverseWidgetTree
handler(self, child)
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 460, in handleItem
self.traverseWidgetTree(elem)
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 688, in traverseWidgetTree
handler(self, child)
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 189, in createWidget
self.stack.push(self.setupObject(widget_class, parent, elem))
File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 152, in setupObject
obj = self.factory.createQObject(clsname, name, args, is_attribute)
File "/usr/lib/python3.5/site-packages/pysideuic/objcreator.py", line 87, in createQObject
classType = self.findQObjectType(classname)
File "/usr/lib/python3.5/site-packages/pysideuic/objcreator.py", line 97, in findQObjectType
w = module.search(classname)
File "/usr/lib/python3.5/site-packages/pysideuic/Compiler/qobjectcreator.py", line 104, in search
baseClass = self._resolveBaseclass(self._widgets[cls][0])
File "/usr/lib/python3.5/site-packages/pysideuic/Compiler/qobjectcreator.py", line 98, in _resolveBaseclass
raise ValueError("unknown baseclass %s" % baseClass)
ValueError: unknown baseclass QOpenGLWidget
I try to install pyside-tools (come with pyside) on my Gentoo machine and get the error:
Syntax errors / warnings in Python modules for CPython 2.7:
* Compiling /usr/lib64/python2.7/site-packages/pysideuic/port_v3/proxy_base.py ...
* File "/usr/lib64/python2.7/site-packages/pysideuic/port_v3/proxy_base.py", line 26
* class ProxyBase(metaclass=ProxyType):
* ^
* SyntaxError: invalid syntax
emerge pyside-tools --info
Portage 2.2.7 (default/linux/amd64/13.0/desktop, gcc-4.7.3, glibc-2.17, 3.10.17-gentoo x86_64)
=================================================================
System Settings
=================================================================
System uname: Linux-3.10.17-gentoo-x86_64-Intel-R-_Core-TM-_i5-3337U_CPU_@_1.80GHz-with-gentoo-2.2
KiB Mem: 3766472 total, 1075836 free
KiB Swap: 0 total, 0 free
Timestamp of tree: Thu, 13 Feb 2014 16:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash: 4.2_p45
dev-lang/python: 2.7.5-r3, 3.2.5-r3, 3.3.3
dev-util/cmake: 2.8.11.2
dev-util/pkgconfig: 0.28
sys-apps/baselayout: 2.2
sys-apps/openrc: 0.12.4
sys-apps/sandbox: 2.6-r1
sys-devel/autoconf: 2.13, 2.69
sys-devel/automake: 1.11.6, 1.12.6, 1.13.4
sys-devel/binutils: 2.23.2
sys-devel/gcc: 4.7.3-r1
sys-devel/gcc-config: 1.7.3
sys-devel/libtool: 2.4.2
sys-devel/make: 3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc: 2.17
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core-avx-i -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core-avx-i -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.dkm.cz/pub/gentoo/ http://mirror.yandex.ru/gentoo-distfiles/ ftp://mirror.yandex.ru/gentoo-distfiles/"
LANG="en_US.utf8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync2.ru.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 avx bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr chm cli color consolekit cracklib crypt curl cxx dbus djvu dri dts dvd dvdr emacs emboss encode exif fam ffmpeg firefox flac fontconfig fortran ftp gdbm gif git gpm gtk gzip iconv inotify ipv6 irc jabber jit jpeg jpeg2k lcms ldap libnotify mad mime mmx mng modules mp3 mp4 mpeg mplayer multilib mysql ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit postgre postgres ppds python qt3support qt4 readline sdl session spell sql sqlite sse sse2 sse4 ssl ssse3 startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
=================================================================
Package Settings
=================================================================
dev-python/pyside-tools-0.2.14 was built with the following:
USE="(multilib) -test" ABI_X86="64"
current interpreter version Python 2.7.5
class ThisWorks(QtGui.QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.a =self.tr("i'm fine")
class ThisFails(QtGui.QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.b = '''a long text with
more them one line''' # <---- a single space before 'm' solves the problem
self.a =self.tr("i'm sad")
the .TS generated for the second class will have no identifier:
<context>
<name></name> <!----- empty -->
<message>
<location filename="../console.py" line="37"/>
<source>i'm sad</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ThisWorks</name>
<message>
<location filename="../console.py" line="26"/>
<source>i'm fine</source>
<translation type="unfinished"></translation>
</message>
</context>
It is an old issue reported in http://srinikom.github.io/pyside-bz-archive/1156.html and https://bugreports.qt-project.org/browse/PYSIDE-175. Not sure if this is the right place to make this issue noticeable and even solved or not.
Hi,
Any chance of adding a readme to this project?
Motivation: The main website claims this repo is the source code, rather than the Pyside repo (which I assume is actually the source code). I'd make a PR myself but I don't know what this repo is.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.