project_path_not_found is raised when data_path_not_found should be

Bug #497688 reported by Philip Peitsch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Quickly
Fix Released
Undecided
Unassigned
quickly (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: quickly

The project_path_not_found exception is thrown when the data path is not found for a quickly project. Unfortunately, this does not include any data about the path it was attempting to search for, which can make debugging a deployed instance slightly more difficult. I've appended a patch that changes this exception so that the path is printed out

ProblemType: Bug
Architecture: amd64
CheckboxSubmission: caa155f54c0f4362405eca2142b98252
CheckboxSystem: 9038dc5b445882e24b06ebe5cf05c9fc
Date: Thu Dec 17 20:30:33 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: quickly 0.2.6
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-17.54-generic
SourcePackage: quickly
Uname: Linux 2.6.31-17-generic x86_64

Revision history for this message
Philip Peitsch (philip-peitsch) wrote :
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Thanks for your interest in Quickly.

However, I guess you mislead the usage of this exception: it doesn't mind "I can't find the data path for a Quickly project", it's more "I don't find that the current project where you are launching a inside project command".
The algorithm is "do I find a .quickly in the current path ?"
-> yes - ok, project path
-> no, look at parent directory.

This is cycling until getting the root path (/). So, there is no data to print with this exception.
If I'm not clear, do not hesitate to ask me.

Changed in quickly (Ubuntu):
status: New → Invalid
Revision history for this message
Philip Peitsch (philip-peitsch) wrote :

Hi Didier,

I am still a little confused sorry :)

Inside the project_nameconfig.py file, there is a function called getdatapath(). From my reading, the purpose is to get the absolute path to the data folder (that holds media etc.). The bottom half of this looks like:

    abs_data_path = os.path.abspath(pathname)
    if os.path.exists(abs_data_path):
        return abs_data_path
    else:
        raise project_path_not_found

If the patch is applied, that turns into this:

    abs_data_path = os.path.abspath(pathname)
    if os.path.exists(abs_data_path):
        return abs_data_path
    else:
        raise project_path_not_found(abs_data_path)

The key difference being that the exception actually outputs the abs_data_path that it just checked for. So I don't quite understand your comment that there is no data to print :-)... I just want it to print the pathname :-).

The main justification for this is that in the event of a quickly-made application not starting, I have already had a user simply paste that error command. The actual issue faced would have been much more apparent if the project_path_not_found exception had actually printed out where it was looking in, as the user had installed the quickly application to a custom location, and the data path for the project was very obviously incorrect :-)

Thanks for the great work so far though! I am using quickly most evenings these days... I would struggle to develop without your very handy tool!

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Hey Philip thanks for the clarification,

No, it's not that working on a plane sucks ;)
project_path_not_found should only be called in the case I previously described (in get_root_project_path). Not when no data path is found!

Consequently, you are totally correct about providing wrong data path is needed (even though data path is now collected with trunk version by apport when you use "ubuntu-bug quickly"): the thing is to raise the right exception (which has to be created: "data_path_no_found").

So, I'm changing wrong raise/except catchup when project_path_not_found was instantiated instead of data_path_not_found based on your patch. I rename the bug too. Thanks for your contribution and your feedback :)

summary: - having project_path_not_found show the path it failed to find would ease
- debug
+ project_path_not_found is raised when data_path_not_found should be
Changed in quickly:
status: New → Triaged
Changed in quickly (Ubuntu):
status: Invalid → Triaged
Changed in quickly:
milestone: none → 0.4
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Fixed in trunk, patch morely rewritten to handle it in the good context. Thanks :)

Changed in quickly:
status: Triaged → Fix Committed
Changed in quickly:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.7 KiB)

This bug was fixed in the package quickly - 0.3.90-0ubuntu1

---------------
quickly (0.3.90-0ubuntu1) lucid; urgency=low

  * New release:
    Quickly core:
    - check now that --template has one argument
    - -- enables to give options to templates (unknown options and arguments
      are still given to templates but -- specify explicity what to give to
      templates commands like -h, --version...)
    - check and enable recreation of the credential if user deletes it on
      Launchpad
    - Use realpath so that we can symlink to the binary in trunk.
      (Jonathan Lange)
    - project_path_not_found is raised when data_path_not_found should be
      (originated from Philip Peitsch's patch). (LP: #497688)
    - importing command in one template from another template is now possible
      support as well "all" keyword to import all commands from a template
      into another one (take care of overridden commands too)
      (LP: #452306, #487301)
    - add an apport hook to get installed templates (LP: #411127)
    - enable option completion for templates
    - handle now version upgrade, launching script for templates and handling
      versionning on them
    - change getstarted wording (LP: #486180) - Grant
    - Quickly ship now "version" tag instead of "format" tag
    - add some templatetools to check X display
    - if a commands exit with 4, do not show "ERROR:" (case of wrong command
      usage, for instance)
    - Rewrote importing module in both bin/quickly and ubuntu-project binary
    - Add get_camel_case_name() and get_sentence_name() to templatetools
    - Refactor some code in pre_create hook()
    - Now dashes and spaces support in project name! Dealing with python and
      packaging issues for you. (LP: #493130)
    - Provide Quickly API (LP: #426480)
    - Fix some issues in the man page
    ubuntu-application Template:
    - Enabling upload to team or user ppa, as well as any ppa.
      Use --ppa ppaname or --ppa team/ppaname
      .quickly file can be used as well with ppa = ppaname or
      ppa = team/ppaname (LP: #470192)
      ppa completion is also available
    - Change BSD header by full license
    - Add MIT license
    - Fixes an error when launchpad display name contains unicode character
      (Petar Vasić)
    - Fix typo in quickly help save (Petar Vasić)
    - Adds logo.png as logo property in about dialog (LP: #478389)
      (Petar Vasić)
    - Remove lp-project-change command and add configure command.
      configure lp-project [project_name] to set/reset lp project binded to
      your Quickly project
      ppa <ppa name> to set a default ppa with your project
    - Fix ~/.selected-editor being ignored (LP: #484730)
    - Fix wrong shell completion when in a template (it wrongly proposed
      all commands followed by templates)
    - Check if we have a X display available before running "run" or launching
      GUI in "create" command.
    - add -- support in quickly run to pass options like --help, --version so
      that Quickly core don't take them.
    - enable preferences save call being called multiple times (Philip Peitsch)
    - Use realpath so that we can symlink to the binary in trunk.
 ...

Read more...

Changed in quickly (Ubuntu):
status: Triaged → 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.