Add a command line option to run only the add-printer wizard with reduced interactivity

Bug #127120 reported by Till Kamppeter
8
Affects Status Importance Assigned to Milestone
system-config-printer (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: system-config-printer

To implement automatic printer setup when pluggin the printer (Plug'n'Print):

https://blueprints.launchpad.net/ubuntu/+spec/automatic-printer-conf

the printer setup tool needs a way to get called so that it only goes through the add-printer wizard, without opening its main window.

The flow of the add-printer wizard should be modified somewhat in this case:

- It should only display the printer which was plugged (or at least all printers which are not yest set up, like http://localhost:631/admin shows) and ask the user whether the new printer should be set up.
- If the user agrees the printer should be set up with the recommended driver and an auto-generated queue name (no driver selection and queue name dialogs)

Changed in system-config-printer:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Jani Monoses (jani) wrote :

hi Till,

the current version of s-c-p in gutsy is the same as in feisty, while upstream has made quite a few improvements since April.
A Debian dev imported our package and it recently got past the Debian NEW queue, needs a sync.

http://packages.debian.org/unstable/python/system-config-printer

It'd be great if Fedora, Debian and Ubuntu all used the same tool :)

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Jani, I have tried to merge our s-c-p with the Debian one which you talked about, but with this version adding a printer is completely non-functional. When I click "Forward" on the page for entering the print queue name the wizard hangs (does not go to next page) and on the terminal in which I started the s-c-p I get:

--------------------------------------------------
till@till-laptop:~/ubuntu/system-config-printer/system-config-printer-0.7.70$ system-config-printer

***MEMORY-WARNING***: system-config-printer.py[32358]: GSlice: g_thread_init() must be called before all other GLib functions; memory corruption due to late invocation of g_thread_init() has been detected; this program is likely to crash, leak or unexpectedly abort soon...
queryPPDs
Lock acquired for PPDs thread
PPDs thread started
queryDevices
Lock acquired for devices thread
Devices thread started
Connecting (PPDs)
Releasing PPDs lock
Connecting (devices)
Closing connection (devices)
Releasing devices lock
queryPPDs: in progress
fetchPPDs
Acquiring PPDs lock
Got PPDs
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 2048, in on_btnNPForward_clicked
    self.nextNPTab()
  File "/usr/share/system-config-printer/system-config-printer.py", line 2056, in nextNPTab
    self.loadPPDs()
  File "/usr/share/system-config-printer/system-config-printer.py", line 535, in loadPPDs
    self.ppds = ppds.PPDs(self.fetchPPDs (), language=self.language[0])
  File "/usr/share/system-config-printer/system-config-printer.py", line 528, in fetchPPDs
    return self.ppds_result
AttributeError: GUI instance has no attribute 'ppds_result'
--------------------------------------------------

My packages you can download at

http://www.linux-foundation.org/~till/tmp/ubuntu/gutsy/system-config-printer/

Revision history for this message
Jani Monoses (jani) wrote : Re: [Bug 127120] Re: Add a command line option to run only the add-printer wizard with reduced interactivity

I have just seen today on the ubuntu-mobile list that in current gutsy there
are common problems with
GSlice crashes. So maybe it's a glib bug since gutsy has a recent unstable
glib branch, I hope it's not
s-c-p related at all.

Are there chances of considering s-c-p instead of gnome-cups-manager in
Ubuntu 7.10, is this the reason you're
working on it?

In the past I had very good communication with upstream (Tim Waugh) he is
helpful both in Launchpad and in private
mail, and interested in having the tool outside of Fedora.

Jani

On 7/20/07, Till Kamppeter <email address hidden> wrote:
>
> Jani, I have tried to merge our s-c-p with the Debian one which you
> talked about, but with this version adding a printer is completely non-
> functional. When I click "Forward" on the page for entering the print
> queue name the wizard hangs (does not go to next page) and on the
> terminal in which I started the s-c-p I get:
>
> --------------------------------------------------
> till@till-laptop:~/ubuntu/system-config-printer/system-
> config-printer-0.7.70$ system-config-printer
>
> ***MEMORY-WARNING***: system-config-printer.py[32358]: GSlice:
> g_thread_init() must be called before all other GLib functions; memory
> corruption due to late invocation of g_thread_init() has been detected; this
> program is likely to crash, leak or unexpectedly abort soon...
> queryPPDs
> Lock acquired for PPDs thread
> PPDs thread started
> queryDevices
> Lock acquired for devices thread
> Devices thread started
> Connecting (PPDs)
> Releasing PPDs lock
> Connecting (devices)
> Closing connection (devices)
> Releasing devices lock
> queryPPDs: in progress
> fetchPPDs
> Acquiring PPDs lock
> Got PPDs
> Traceback (most recent call last):
> File "/usr/share/system-config-printer/system-config-printer.py", line
> 2048, in on_btnNPForward_clicked
> self.nextNPTab()
> File "/usr/share/system-config-printer/system-config-printer.py", line
> 2056, in nextNPTab
> self.loadPPDs()
> File "/usr/share/system-config-printer/system-config-printer.py", line
> 535, in loadPPDs
> self.ppds = ppds.PPDs(self.fetchPPDs (), language=self.language[0])
> File "/usr/share/system-config-printer/system-config-printer.py", line
> 528, in fetchPPDs
> return self.ppds_result
> AttributeError: GUI instance has no attribute 'ppds_result'
> --------------------------------------------------
>
> My packages you can download at
>
> http://www.linux-foundation.org/~till/tmp/ubuntu/gutsy/system-config-
> printer/
>
> --
> Add a command line option to run only the add-printer wizard with reduced
> interactivity
> https://bugs.launchpad.net/bugs/127120
> You received this bug notification because you are a member of Xubuntu
> Team, which is a bug contact for system-config-printer in ubuntu.
>

Revision history for this message
Jani Monoses (jani) wrote :

I have just seen today on the ubuntu-mobile list that in current gutsy there are common problems with
GSlice crashes. So maybe it's a glib bug since gutsy has a recent unstable glib branch, I hope it's not
s-c-p related at all.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

> Are there chances of considering s-c-p instead of gnome-cups-manager in
> Ubuntu 7.10, is this the reason you're
> working on it?

Yes, this is the intention. We already wanted to get rid of g-c-m in Feisty as it is not maintained upstream any more for more than a year. First suggestion of a replacement was Mandriva's printerdrake

https://blueprints.launchpad.net/ubuntu/+spec/printerdrake

but this would require to write a new GUI for printerdrake and we did not find someone to do that. So we have also taken s-c-p into account and it seems to be suitable, too.

The issues I have reported as bugs yesterday (see bug list for system-config-printer) but they are not very much coding to fix. So getting it to be a good replacement is possible for Gutsy.

As I never programmed in Python it would be nice if you can also have a look into this problem.

Revision history for this message
Jani Monoses (jani) wrote :

sounds good.

I had a poroposal at UDS in Sevilla that did not get scheduled but I talked about it with Martin informally.

https://blueprints.launchpad.net/ubuntu/+spec/system-config-printer

Martin's main objection was that the UI is not as intuitive as gnome-cups-manager's.
The latter has a nautilus-like 'folder view' with printers and add new icon, much like windows has.
s-c-p has a more advanced and powerful but less intuitive one.

Another problem was that when I showed Martin the app, setting server paramteres for some reason did not stuck
in /etc/cups.conf or only did unpredictably. That's a bug that is definitely fixable but did not help in showing s-c-p
in a favourable light at that point :)

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

In my opinion it is much more important to have a tool which is maintained upstream, so that bugs get fixed and new features (to be state-of-the-art and to support the newest CUPS features) get added.

With the unmaintained gnome-cups-manager we have a tool which will get more and more outdated with the time and bugs accumulate and do not get fixed due to lack of good maintainership.

It is much more user friendly if the printer setup tool has less bugs and supports modern printing system and driver features out of the box than having printers displayed as icons.

Revision history for this message
Jani Monoses (jani) wrote :

I agree wrt being maintained, that's why I proposed the spec. But Martin has a valid point, as it is now, it is not very 'ubuntuish'
The UI may get improvements. it's in upstream TODO file. Maybe the usability folks can look at it (glatzor, mpt, or others)

Revision history for this message
Jani Monoses (jani) wrote :

I agree wrt being maintained, that's why I proposed the spec. But Martin has a valid point, as it is now, it is not very 'ubuntuish'
The UI may get improvements. it's in upstream TODO file. Maybe the Ubuntu usability folks can look at it (glatzor, mpt, or others)

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Or should we overtake the upstream maintainership of the gnome-cups-manager? Put it into a bzr at Canonical, set up a simple home page for it ...

As we have to do some improvements on system-config-printer anyway we could also put this effort in doing improvements on the gnome-cups-manager. WDYT?

One thing which also motivated me to switch to system-config-printer is that it seems that this 0.7.70 version has plug'n'print functionality (set up printer automatically when plugging it in). Only thing is that, probably due to the problem of the wizard hanging the non-interactive setup is also broken.

Revision history for this message
Tim Waugh (twaugh) wrote :

Till: the plug-n-print functionality comes via a small package named hal-cups-utils. It's just a small bit of Python that "plugs in" to system-config-printer and adds the correct printer. The file is /usr/libexec/hal_lpadmin in Fedora. It responds to HAL events and translates HAL URIs into usb: or hp: URIs when it can.

Regarding the UI, any improvements are welcome. :-)

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Tim, where can I get the source tarball for that package? Is it also on your home page?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Sorry, Tim, I have found it. It is already packaged for Ubuntu, and even in main. It was simply not installed by default.

Revision history for this message
Jani Monoses (jani) wrote :

Yes, hal-cups-utils just like system-config-printer are not installed by default, only in Xubuntu. Debian has not yet taken hal-cups-utils.
Regarding gnome-cups-manager I have tried sending patches last year to upstream to no avail, but the code is messy enough not to be worth it imho to have our own fork. I wanted to do that too when upstream failed to answer, but seb128 was not happy about us having an upstream gnome package taken over that way.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

So, what is your suggestion for the default printer setup tool for Gutsy?

seb128, pitti, what is your suggestion.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Jani, I have installed hal-cups-utils, but somehoow nothing happens when plugging the printer or when running

sudo /usr/lib/hal-cups-utils/hal_lpadmin --add

any ideas how to get it working?

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Jani, reported the problem of hal-cups-utils as bug 127841.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have fixed system-config-printer 0.7.70 now. I have replaced my packages by equally-named packages here:

http://www.linux-foundation.org/~till/tmp/ubuntu/gutsy/system-config-printer/

Revision history for this message
Jani Monoses (jani) wrote :

Till,

feel free to upload those to Gutsy.

thanks for merging it

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

hal-cups-utils calls parts of system-config-printer directly, a command line option to run only the add-printer wizard with reduced interactivity is not needed. Closing.

Changed in system-config-printer:
status: Confirmed → 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.