quickly add dialog does not work properly with multi-word dialog names

Bug #678200 reported by Emilien Klein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Quickly
Fix Released
High
Unassigned

Bug Description

The output of "quickly help add" says

Usage:
$ quickly add [dialog dialog_name]
add something to your project_bin

Here, dialog_name is one or more words seperated with underscore

For instance $ quickly add dialog DialogName will create:

From the 3rd line, I understand that "dialog_name" must be "one or more words seperated with underscore"

So I try to execute for instance

$ quickly add dialog a_b
ERROR: unpermitted character in name.
Letters, spaces, dashes (-) and digits only.

So I went back reading the help message and I saw that the example uses CamelCase: "$ quickly add dialog DialogName".

It seems to me that the message about underscores is pretty unclear. Either remove it, or make it more explicit what this is about.

quickly --version
Quickly 0.4.3

Work-around contributed by ~emilien-klein:
Steps:

$ quickly add dialog NautilusImageManipulator
$ bzr status
unknown:
  data/ui/NautilusimagemanipulatorDialog.ui
  data/ui/nautilusimagemanipulator_dialog.xml
  nautilus_image_manipulator/NautilusimagemanipulatorDialog.py

Rename the files like this:

$ bzr status
unknown:
  data/ui/NautilusImageManipulatorDialog.ui
  data/ui/nautilus_image_manipulator_dialog.xml
  nautilus_image_manipulator/NautilusImageManipulatorDialog.py

Then open all 3 files, and do search/replace all like this:

- nautilusimagemanipulator_dialog -> nautilus_image_manipulator_dialog
- NautilusimagemanipulatorDialog -> NautilusImageManipulatorDialog

(basically, add underscores to what's in lower case, and add upper case to the Camel Case)

Revision history for this message
Emilien Klein (emilien-klein) wrote :

Thinking that I had understood this underscore business, I executed

$ quickly add dialog NautilusImageManipulatorDialog

According to the docs, I should have had 3 new files:

1. A subclass of gtk.Dialog called NautilusImageManipulatorDialogDialog in the module
   NautilusImageManipulatorDialogDialog.py
2. A glade file called NautilusImageManipulatorDialogDialog.ui in the ui directory
3. A catalog file called nautilus_image_manipulator_dialog_dialog.xml also in the ui directory

But this is what I got:

$ bzr status
unknown:
  data/ui/NautilusimagemanipulatordialogDialog.ui
  data/ui/nautilusimagemanipulatordialog_dialog.xml
  nautilus_image_manipulator/NautilusimagemanipulatordialogDialog.py

Now I'm pretty confused on the way $ quickly add works/should work...

P.S.: I'm using Quickly 0.4.3 because that's the version that comes with 10.04 (LTS). If this is fixed in a future version, I'd nonetheless be interested to know how I should use this command...

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

Hi. Thanks for using quickly, and especially thanks for reporting your bug. In this case both the implementation and the help is broken. We should fix this in Natty. In the meantime, you best off with just a single name dialog if you can pull it off:

$quickly add dialog manipulator

This will create ManipulatorDialog.py for you, and the ensuing files. If this is not suitable, then I would use:

$quickly add dialog nautilusimagemanipulator

which will create NautilusimagemanipulatorDialog.py for you. Then you will need to do a lot of tedious renaming to make it work, including that file itself, the .xml (nautilusimagemanipulator_dialog.xml
) , and .ui (NautilusimagemanipulatorDialog.ui) files, and within those files as well.

Sorry that this is only partially implemented at the moment, we expect it will be all sorted in time for Natty, though.

Changed in quickly:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Emilien Klein (emilien-klein) wrote :

Thanks for the confirmation. I went the route of renaming, with replace-all in the code it's pretty fast anyway. Good if you can fix this for the next release.

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

@Emilien,

Glad you got it working. If you get a moment, could you please list the steps you took to make it work? That might be helpful for other people who hit this bug.

Cheers, Rick

Revision history for this message
Emilien Klein (emilien-klein) wrote :

Steps:

$ quickly add dialog NautilusImageManipulator
$ bzr status
unknown:
  data/ui/NautilusimagemanipulatorDialog.ui
  data/ui/nautilusimagemanipulator_dialog.xml
  nautilus_image_manipulator/NautilusimagemanipulatorDialog.py

Rename the files like this:

$ bzr status
unknown:
  data/ui/NautilusImageManipulatorDialog.ui
  data/ui/nautilus_image_manipulator_dialog.xml
  nautilus_image_manipulator/NautilusImageManipulatorDialog.py

Then open all 3 files, and do search/replace all like this:

- nautilusimagemanipulator_dialog -> nautilus_image_manipulator_dialog
- NautilusimagemanipulatorDialog -> NautilusImageManipulatorDialog

(basically, add underscores to what's in lower case, and add upper case to the Camel Case)

That's it.

description: updated
summary: - Help message for "quickly add" is unclear
+ quickly add dialog does not work properly with multi-word dialog names
Revision history for this message
Michael Terry (mterry) wrote :

This has been fixed in trunk and will be in the alpha1 natty release.

The help has been fixed to use dashes in examples, and a bug with using dashes was fixed so it will actually do what you expect. There is a automated test for it.

Changed in quickly:
status: Confirmed → Fix Committed
Revision history for this message
Emilien Klein (emilien-klein) wrote :

OK, thanks for this fast fix. Has this already been pushed to trunk? I couldn't find the commit in question.

Revision history for this message
Michael Terry (mterry) wrote :

Commit 550 fixed the bug with dashes. I can't quickly find which commit fixed the help output to use dashes in the examples, as that code got refactored recently.

Michael Terry (mterry)
Changed in quickly:
milestone: none → 11.03.0
Michael Terry (mterry)
Changed in quickly:
status: Fix Committed → Fix Released
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.