Signal autoconnect does not work with signal names which contain hypens
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
quickly (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
While writing a small test app using the ubuntu-application template, I was trying to get the signal autoconnect feature to work, to no avail.
I then noticed that my "on_filechooser
So when doing the autoconnects, the hyphens in signal names should be replaced by underscores while building the on_{widget}
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: quickly 11.10-0ubuntu4
ProcVersionSign
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelMo
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Mon Nov 14 18:05:37 2011
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
PackageArchitec
ProcEnviron:
LANGUAGE=ca_ES:en
PATH=(custom, no user)
LANG=ca_ES.UTF-8
LC_MESSAGES=
SHELL=/bin/bash
QuicklyDataPath: /usr/share/quickly
QuicklyTemplates:
/usr/share/
/usr/share/
/usr/share/
/usr/share/
QuicklyTemplate
SourcePackage: quickly
UpgradeStatus: Upgraded to oneiric on 2011-09-06 (69 days ago)
Related branches
- Didier Roche-Tolomelli: Approve
-
Diff: 11 lines (+1/-0)1 file modifieddata/templates/ubuntu-application/project_root/python_lib/Builder.py (+1/-0)
- Quickly Developers: Pending requested
-
Diff: 59 lines (+36/-1)2 files modifieddata/templates/ubuntu-application/project_root/python_lib/Builder.py (+2/-1)
data/templates/ubuntu-application/project_root/tests/test_builder.py (+34/-0)
Hi David
The underlying difficulty, widget names are any string: python names are restricted, was originally covered by some tools
logging of methods like "on_widget_signal" that were not automatically connected
an alias decorator that accepted any string and could be a target for automatic connection
However a later change to quickly hid the logging messages from the project_ lib/Builder. py module.
If you want to see them you can use quickly run -vv
There was much discussion at the time between two approaches ton1", "file-set" ) into python names like "on_filechooser button1_ file_set"
automatically mangle glade names like ( "filechooserbut
inform quickly user (you) of the discrepancy using logging, if you turn on logging.
A choice was made to use logging because otherwise the user (you) would need to hold the mangling algorithm in your head
e.g. replace any of [".", ",", ", "-", "á", "é"] etc. by "_"
The blacklist approach (don't use "-") you suggest would be better as a whitelist (if the character is not allowed in a python name change it)
A counter proposal for a bug fix is
Default to have logging turned on for quickly run
turn on logging for quickly supplied boilerplate modules as well as user supplied modules