Azitech

Azimout's Linux weblog

Script to unsubscribe you from all subscribed bugs on Launchpad

leave a comment »

I was subscribed to more than 400 bugs on Launchpad. Unsubscribing from each one manually would have been a nightmare. So I wrote a Python script that uses launchpadlib to do this for me:

#!/usr/bin/env python

'''
This script gets the list of bugs, for which you have subscribed to bugmail
from https://bugs.launchpad.net/~username/+subscribedbugs
and unsubscribes you from ALL OF THEM
'''

cachedir = "/tmp/launchpadlib/cache/"
from launchpadlib.launchpad import Launchpad
launchpad = Launchpad.login_with('bulk_bugmail_unsubscribe', 'edge', cachedir)
me = launchpad.me
mybugs = launchpad.distributions['ubuntu'].searchTasks(bug_subscriber=me)
for entry in mybugs:
	print "Unsubscibing you from bug #", entry.bug.id, entry.bug.title
	entry.bug.unsubscribe(person=me)
	entry.bug.lp_save()

The first time you do this, it will open a browser window in order for you to login and create an authentication token for the script. You need to give it permission to “change everything”.

References:

Advertisements

Written by azimout

20/08/2010 at 16:06

Posted in Howto

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: