Changeset 61c5043


Ignore:
Timestamp:
Nov 29, 2009, 10:14:51 PM (14 years ago)
Author:
Nimrod Gileadi <nimrodg@…>
Branches:
master, debian, mac, no-cups, web
Children:
b17d602
Parents:
d566e6b
git-author:
Nimrod Gileadi <nimrodg@…> (11/29/09 22:14:51)
git-committer:
Nimrod Gileadi <nimrodg@…> (11/29/09 22:14:51)
Message:

Added docstrings. Beautified debugging output slightly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gutenbach-rhythmbox-plugin/__init__.py

    rd566e6b r61c5043  
     1"""
     2This module implements a Rhythmbox plugin that sends selected track to a
     3printer queue. It's meant to be used with gutenbach, a music spooling printer
     4server.
     5
     6The plugin uses lpr to send the files to gutenbach.
     7"""
     8import gtk
    19import rb
    2 import gtk
     10import subprocess
     11import urllib
    312import urlparse
    4 import urllib
    5 import subprocess
    613
    714# UI Change is an extra item added to right-click menu when clicking on tracks
     
    1825
    1926    def activate(self, shell):
     27        """Adds a new item to the right-click menu which allows
     28        sending music files to the gutenbach server.
     29        """
    2030        self.shell = shell
    2131        # Create action for sending a track to gutenbach
     
    3848
    3949    def gutenbach_action(self, action, shell):
     50        """An action called when the user clicks the right-click menu item
     51        to send a track to gutenbach.
     52        This function calls an instance of lpr for each file to be added.
     53        """
    4054        source = shell.get_property("selected-source")
    4155        # For each track currently selected in the song browser
     
    5165                    printer = self.printer
    5266                command = 'lpr -P %s "%s"' % (printer, path)
    53                 print command
     67                print "About to run command '%s'" % command
    5468                subprocess.Popen(command, shell=True)
    5569
Note: See TracChangeset for help on using the changeset viewer.