~ubuntu-branches/ubuntu/maverick/gwibber/maverick-updates

« back to all changes in this revision

Viewing changes to gwibber/client.py

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2010-10-05 09:57:28 UTC
  • mfrom: (1.1.33 upstream)
  • Revision ID: james.westby@ubuntu.com-20101005095728-xxken2wb2x8xypw1
Tags: 2.32.0.1-0ubuntu1
* New upstream release
  -  Re-enable the first run experience, if there are no accounts configured
     run gwibber-accounts (LP: #654811)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    self.connection.connect_to_signal("ConnectionOnline", self.on_connection_online)
44
44
    self.connection.connect_to_signal("ConnectionOffline", self.on_connection_offline)
45
45
 
46
 
    """
47
 
    microblog.util.getbus("Streams").connect_to_signal("SettingChanged", self.on_setting_changed)
48
 
 
49
 
    if len(json.loads(self.service.GetAccounts())) == 0:
50
 
      import upgrade
51
 
      account_migrate = upgrade.GwibberAccountMigrate()
52
 
      if not account_migrate.run():
53
 
        if os.path.exists(os.path.join("bin", "gwibber-accounts")):
54
 
          cmd = os.path.join("bin", "gwibber-accounts")
55
 
        else:
56
 
          cmd = "gwibber-accounts"
57
 
        ret = 1
58
 
        while ret != 0:
59
 
          ret = subprocess.call([cmd])
 
46
    self.accounts = microblog.util.getbus("Accounts")
 
47
 
 
48
    first_run = False
 
49
    # check for existing accounts
 
50
    if len(json.loads(self.accounts.List())) == 0:
 
51
      # if there are no accounts configured, prompt the user to add some
 
52
      first_run = True
 
53
      if os.path.exists(os.path.join("bin", "gwibber-accounts")):
 
54
        cmd = os.path.join("bin", "gwibber-accounts")
 
55
      else:
 
56
        cmd = "gwibber-accounts"
 
57
      ret = 1
 
58
      while ret != 0:
 
59
        ret = subprocess.call([cmd])
 
60
 
 
61
    self.setup_ui()
 
62
 
 
63
    if first_run:
 
64
      # Since we didn't have accounts configured when gwibber-service started
 
65
      # force it to refresh now that accounts have been added
60
66
      self.service.Refresh()
61
 
    """
62
 
 
63
 
    self.setup_ui()
64
67
 
65
68
    # Migrate the autostart gconf key to the new location
66
69
    if config.GCONF.get("/apps/gwibber/autostart"):