~yasumoto7/five-a-day/icon_countdown

« back to all changes in this revision

Viewing changes to fiveadayapplet/controller.py

  • Committer: Daniel Holbach
  • Date: 2008-07-02 10:51:40 UTC
  • Revision ID: daniel.holbach@canonical.com-20080702105140-jcby5j3dt6srgmrs
fiveaday/bzr.py, fiveaday/files.py, 5-a-day, fiveaday/parser.py,
fiveadayapplet/controller.py:

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    
30
30
def get_teams_data(user):
31
31
    all_teams = dict((i,False) for i in lpteams.get_teams(user))
32
 
    teamfile = files.team_file()
33
 
    if os.path.exists(teamfile):
34
 
        for i in map(lambda a: a.strip(), open(teamfile).readlines()):
35
 
            if not i in all_teams:
36
 
                raise KeyError, _("You are not a member of '%s'") %i
37
 
            all_teams[i] = True
 
32
    for i in files.get_teams():
 
33
        if not i in all_teams:
 
34
            raise KeyError, _("You are not a member of '%s'") %i
 
35
        all_teams[i] = True
38
36
    return all_teams
39
37
    
40
38
def get_username():
147
145
        
148
146
        x = self.view.do_teams_show()
149
147
        if x:
150
 
            f = open(os.path.expanduser(fiveadayapplet.TEAM_FILE), "w")
151
 
            f.write("\n".join(self.model.values))
152
 
            f.close()
 
148
            files.set_teams(x)
153
149
        
154
150
    # Events
155
151