samples directory contains mystifying code

Bug #352836 reported by Karl Fogel on 2009-04-01
Affects Status Importance Assigned to Milestone

Bug Description

The example code in the samples/ directory is effectively undocumented, and not self-explanatory. Also, may contain a mis-assumption in its code.

Steps to reproduce:

I installed launchpadlib from a trunk branch today:

   $ bzr branch lp:launchpadlib
   $ cd launchpadlib
   $ sudo python install

Looking for example code, I entered the samples/ directory:

   $ cd samples/
   $ ls *.py

I opened up, but the __doc__ string at the top is just a transcript of a Python session, with no obvious connection to the script. I couldn't figure out what it was trying to say. So I tried running the script:

   $ ./
   Login as '<email address hidden>' in your browser.
   Press <Enter> when done.
   ### it waited for input here ###

Hmmm. It didn't say a password to use, but I tried logging into as "<email address hidden>", with both empty password and "test" for the password. Neither worked, of course. I asked around in IRC, and matsubara told me:

   <matsubara> kfogel: test@canonical doesn't exist on or
   staging.l.n. it's sample data for the development environment.

   <matsubara> kfogel: that sample will only work if you have the full
   LP source code available and the devel environment up and running.

I hit ^C...

  C-c C-cTraceback (most recent call last):
  File "./", line 83, in <module>

...and started looking at the other scripts. None were documented, though some had similar Python command interpreter transcripts at the top. Later I tried, but while logged in as myself in, and the result was just to get a long traceback ending with "socket.error: (111, 'Connection refused')".


1. Can the sample scripts be documented?

2. A user of launchpadlib is not necessarily likely to also be a developer of Launchpad itself, so nothing should depend on the '<email address hidden>' user being available. I think only has this problem -- the string "test@" occurs nowhere else in launchpadlib.

Changed in launchpadlib:
importance: Undecided → Medium
status: New → Triaged
Changed in launchpadlib:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers