Our+Bug,+2485

Our group decided early on which bug we wanted to work on, mainly because it was the only one we truly understood. We limited our decisions, first, by looking at the sugar-love bugs which are generally the easy to fix bugs for beginner contributors. Among these, Megan was most interested in [|#2485], a bug in the core of the operating system that allows users to enter extra white space around their nicknames. The idea behind the bug is that usually kids using the software will accidentally put an extra space before or after they enter their names.

To begin our contribution, Jordan sent an email out to the sugar-devel[opers] mailing list to find out where in the code we could find the nickname assignment. We heard back within minutes from Walter Bender, the creator of Sugar, who gave us two paths within the code, one to the original assignment of the nicknames and the other to where a user can change his/her account (including nickname). In response, some other developers added some insight about the possibility that users want “fancy names” that include such things as emoticons and the strip we intended to use may cause some trouble with these. In our own code, we have used the strip method in both sections of the code provided by Walter Bender and achieved a basic fix for leading or trailing white space. We intend to look a little deeper, though, to see if we can allow the fancy names without leaving extra white space.

def get_nick: client = gconf.client_get_default return client.get_string('/desktop/sugar/user/nick')

def print_nick: print get_nick

def set_nick(nick): """Set the nickname. nick : e.g. 'walter' """ if not nick: raise ValueError(_('You must enter a name.')) if not isinstance(nick, unicode): nick = unicode(nick, 'utf-8') client = gconf.client_get_default client.set_string('/desktop/sugar/user/nick', nick) return 1