Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/twisted_8_1/twisted/words/im/baseaccount.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # -*- Python -*-
2 #
3 # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
4 # See LICENSE for details.
5
6 #
7
8
9 class AccountManager:
10 """I am responsible for managing a user's accounts.
11
12 That is, remembering what accounts are available, their settings,
13 adding and removal of accounts, etc.
14
15 @ivar accounts: A collection of available accounts.
16 @type accounts: mapping of strings to L{Account<interfaces.IAccount>}s.
17 """
18 def __init__(self):
19 self.accounts = {}
20
21 def getSnapShot(self):
22 """A snapshot of all the accounts and their status.
23
24 @returns: A list of tuples, each of the form
25 (string:accountName, boolean:isOnline,
26 boolean:autoLogin, string:gatewayType)
27 """
28 data = []
29 for account in self.accounts.values():
30 data.append((account.accountName, account.isOnline(),
31 account.autoLogin, account.gatewayType))
32 return data
33
34 def isEmpty(self):
35 return len(self.accounts) == 0
36
37 def getConnectionInfo(self):
38 connectioninfo = []
39 for account in self.accounts.values():
40 connectioninfo.append(account.isOnline())
41 return connectioninfo
42
43 def addAccount(self, account):
44 self.accounts[account.accountName] = account
45
46 def delAccount(self, accountName):
47 del self.accounts[accountName]
48
49 def connect(self, accountName, chatui):
50 """
51 @returntype: Deferred L{interfaces.IClient}
52 """
53 return self.accounts[accountName].logOn(chatui)
54
55 def disconnect(self, accountName):
56 pass
57 #self.accounts[accountName].logOff() - not yet implemented
58
59 def quit(self):
60 pass
61 #for account in self.accounts.values():
62 # account.logOff() - not yet implemented
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/words/im/__init__.py ('k') | third_party/twisted_8_1/twisted/words/im/basechat.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698