~yasumoto7/five-a-day/icon_countdown

« back to all changes in this revision

Viewing changes to 5-a-day

  • Committer: Daniel Holbach
  • Date: 2008-08-28 14:10:43 UTC
  • Revision ID: daniel.holbach@canonical.com-20080828141043-8h05u4aaa92b7b5b
* fiveaday/core.py, 5-a-day, fiveaday/core.py, fiveaday/files.py,
  fiveaday/signature.py, fiveadayapplet/controller.py, po/5-a-day.pot,
  po/POTFILES.in: 
  - ask user to run  "bzr launchpad-login <lplogin>"  instead of writing it 
    to ~/.5-a-day. (LP: #255340)
  - move information about all path names, etc. into a component called
    core.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
from gettext import gettext as _
9
9
import gettext
10
10
 
11
 
from fiveaday import bzr, files, parser, signature
 
11
from fiveaday import bzr, files, parser, signature, core
12
12
 
13
13
 
14
14
def main():
16
16
    commands, flags, data = parser.parse_args()
17
17
    first_run = False
18
18
 
 
19
    c = core.Core()
19
20
    # TODO: use verbose option
20
 
    username = files.get_lpid()
 
21
    username = c.lplogin
21
22
    if not username:
22
23
        return 102 #102: username not defined
23
24
 
24
 
    if not os.path.exists(files.local_branch()):
 
25
    if not os.path.exists(c.local_branch):
25
26
        bzr.update_branch()
26
27
        first_run = True
27
28
 
48
49
 
49
50
    if "add-teams" in commands:
50
51
        if files.add_teams(data):
51
 
            bzr.add_if_not_in_inventory(files.local_branch(), 
52
 
                                        os.path.basename(files.team_file()))
 
52
            bzr.add_if_not_in_inventory(c.local_branch, 
 
53
                                        os.path.basename(c.team_file))
53
54
            bzr.commit_changes(force=True)
54
55
            return 0
55
56
        return 1
56
57
    if "remove-teams" in commands:
57
58
        if files.remove_teams(data):
58
 
            bzr.add_if_not_in_inventory(files.local_branch(), 
59
 
                                        os.path.basename(files.team_file()))
 
59
            bzr.add_if_not_in_inventory(c.local_branch, 
 
60
                                        os.path.basename(c.team_file))
60
61
            bzr.commit_changes(force=True)
61
62
            return 0
62
63
        return 1