Signal autoconnect does not work with signal names which contain hypens

Bug #890318 reported by David Planella
6
This bug affects 1 person
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_filechooserbutton1_file_set" handler in the code was ignored because the signal name is "file-set" (from GtkFileChooserButton), and the code quickly generates was trying to connect "on_filechooserbutton1_file-set" instead, which is not a valid Python identifier.

So when doing the autoconnects, the hyphens in signal names should be replaced by underscores while building the on_{widget}_{signal} handler names.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: quickly 11.10-0ubuntu4
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Mon Nov 14 18:05:37 2011
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=ca_ES:en
 PATH=(custom, no user)
 LANG=ca_ES.UTF-8
 LC_MESSAGES=ca_ES.UTF-8
 SHELL=/bin/bash
QuicklyDataPath: /usr/share/quickly
QuicklyTemplates:
 /usr/share/quickly/templates/ubuntu-pygame
 /usr/share/quickly/templates/ubuntu-cli
 /usr/share/quickly/templates/ubuntu-application
 /usr/share/quickly/templates/ubuntu-flash-game
QuicklyTemplatesDirectories: /usr/share/quickly/templates/
SourcePackage: quickly
UpgradeStatus: Upgraded to oneiric on 2011-09-06 (69 days ago)

Related branches

Revision history for this message
David Planella (dpm) wrote :
description: updated
Revision history for this message
Tony Byrne (tony-badwolf) wrote :

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
automatically mangle glade names like ( "filechooserbutton1", "file-set" ) into python names like "on_filechooserbutton1_file_set"
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

Revision history for this message
dino99 (9d9) wrote :

This version has expired, and quickly is no more maintained

Changed in quickly (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.