Merge lp:~andreagrandi/ubuntu-community-accomplishments/user-has-mugshot into lp:~ubuntu-community-accomplishments-reviewers/ubuntu-community-accomplishments/0.1

Proposed by Andrea Grandi
Status: Merged
Merged at revision: 34
Proposed branch: lp:~andreagrandi/ubuntu-community-accomplishments/user-has-mugshot
Merge into: lp:~ubuntu-community-accomplishments-reviewers/ubuntu-community-accomplishments/0.1
Diff against target: 65 lines (+56/-0)
2 files modified
accomplishments/ubuntu-community/user-has-mugshot.accomplishment (+18/-0)
scripts/ubuntu-community/user-has-mugshot.py (+38/-0)
To merge this branch: bzr merge lp:~andreagrandi/ubuntu-community-accomplishments/user-has-mugshot
Reviewer Review Type Date Requested Status
Jono Bacon Approve
Review via email: mp+95690@code.launchpad.net

Description of the change

Add user-has-mugshot accomplishment script. This trophy is awarded when a user set an avatar image in the Launchpad website.

To post a comment you must log in.
34. By Andrea Grandi

Fix some errors and debug code in user-has-mugshot script.

Revision history for this message
Jono Bacon (jonobacon) wrote :

Thanks for the contribution, Andrea! This looks great. I think I am going to break this out into a set of Launchpad accomplishments for general things you can do in Launchpad, as this one is not specific to Ubuntu.

In the meantime, could I ask you to be a bit more expansive in .accomplishment file and explain what a mugshot is, what are good mugshots (e.g. faces), what are bad ones (e.g. offensive images), and break the instructions in the 'steps' section into multiple steps - each step can be started on a new line with a tab before it.

If you could fix up this I will then merge it.

Thanks!

review: Needs Fixing
35. By Andrea Grandi

Add user-has-mugshot accomplishment. Some bugs fixed.

Revision history for this message
Andrea Grandi (andreagrandi) wrote :

> Thanks for the contribution, Andrea! This looks great. I think I am going to
> break this out into a set of Launchpad accomplishments for general things you
> can do in Launchpad, as this one is not specific to Ubuntu.
>
> In the meantime, could I ask you to be a bit more expansive in .accomplishment
> file and explain what a mugshot is, what are good mugshots (e.g. faces), what
> are bad ones (e.g. offensive images), and break the instructions in the
> 'steps' section into multiple steps - each step can be started on a new line
> with a tab before it.
>
> If you could fix up this I will then merge it.
>
> Thanks!

I've pushed the required changes into n°35 revision. Please let me know if it is ok!
Have a nice weekend :)

Revision history for this message
Jono Bacon (jonobacon) wrote :

Thanks for being so responsive!

I have merged this in. I just made two small changes:

 * You had 'depends=' but it was empty so I set it to 'depends=ubuntu-community/registered-on-launchpad' as a user needs to have a Launchpad account first before they can achieve this.
 * I set the category to Launchpad, but as I said earlier, I might break this out into a different accomplishments set later. For now, it's own category works fine. :-)

Thanks, Andrea!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'accomplishments/ubuntu-community/user-has-mugshot.accomplishment'
2--- accomplishments/ubuntu-community/user-has-mugshot.accomplishment 1970-01-01 00:00:00 +0000
3+++ accomplishments/ubuntu-community/user-has-mugshot.accomplishment 2012-03-04 15:36:17 +0000
4@@ -0,0 +1,18 @@
5+[accomplishment]
6+title=Setting a mugshot in Launchpad profile
7+description=User has set a mugshot in his own Launchpad profile
8+application=ubuntu-community
9+category=General
10+icon=default.png
11+depends=
12+needs-signing=true
13+needs-information=launchpad-email
14+summary = A mugshot is an avatar image that the user can set in his Launchpad profile. It's nice when people can identify you just watching a picture of you. We advise you to choose a real picture of you (usually displaying only the face) or another avatar you really like. Please try to avoid picture with content that coul offend someone else (like sexy picture etc...). The picture must be exactly 192x192 and big no more than 100 Kb.
15+steps: Setting a mugshot is very simple.
16+ You must be logged on Launchpad.net website.
17+ Then he needs to go on your profile page that usually is http://launchpad.net/~YOURUSERNAME
18+ Click on the link "Change details".
19+ Be sure to have a 192x192 pixel piture to upload (.png or .jpg will be ok).
20+ Once the picture is uploaded, please click on "Save changes" button at the end of the page.
21+links: http://www.launchpad.net
22+help = #launchpad on Freenode
23
24=== added file 'scripts/ubuntu-community/user-has-mugshot.py'
25--- scripts/ubuntu-community/user-has-mugshot.py 1970-01-01 00:00:00 +0000
26+++ scripts/ubuntu-community/user-has-mugshot.py 2012-03-04 15:36:17 +0000
27@@ -0,0 +1,38 @@
28+#!/usr/bin/python
29+
30+import traceback, sys
31+import libaccomplishments
32+
33+try:
34+ import json, sys, os, pwd, subprocess
35+ from ubuntuone.couch import auth
36+ from launchpadlib.launchpad import Launchpad
37+
38+ libaccom = libaccomplishments.Accomplishments()
39+
40+ f = libaccom.getExtraInformation("ubuntu-community", "launchpad-email")
41+
42+ if bool(f[0]["launchpad-email"]) == False:
43+ sys.exit(4)
44+ else:
45+ email = f[0]["launchpad-email"]
46+
47+ l=Launchpad.login_anonymously('ubuntu-community accomplishments','production')
48+ me=l.people.getByEmail(email=email)
49+
50+ if me == None:
51+ sys.exit(1)
52+ else:
53+ try:
54+ mugshot = me.mugshot
55+ mugshot_handle = mugshot.open()
56+ sys.exit(0)
57+ except:
58+ sys.exit(1)
59+
60+except SystemExit, e:
61+ sys.exit(e.code)
62+except:
63+ traceback.print_exc()
64+ sys.exit(2)
65+

Subscribers

People subscribed via source and target branches

to all changes: