MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / accountClass

Function accountClass

src/bitmessageqt/account.py:48–72  ·  view source on GitHub ↗
(address)

Source from the content-addressed store, hash-verified

46 return ret
47
48def accountClass(address):
49 if not BMConfigParser().has_section(address):
50 # FIXME: This BROADCAST section makes no sense
51 if address == str_broadcast_subscribers:
52 subscription = BroadcastAccount(address)
53 if subscription.type != AccountMixin.BROADCAST:
54 return None
55 else:
56 subscription = SubscriptionAccount(address)
57 if subscription.type != AccountMixin.SUBSCRIPTION:
58 # e.g. deleted chan
59 return NoAccount(address)
60 return subscription
61 try:
62 gateway = BMConfigParser().get(address, "gateway")
63 for name, cls in inspect.getmembers(sys.modules[__name__], inspect.isclass):
64# obj = g(address)
65 if issubclass(cls, GatewayAccount) and cls.gatewayName == gateway:
66 return cls(address)
67 # general gateway
68 return GatewayAccount(address)
69 except:
70 pass
71 # no gateway
72 return BMAccount(address)
73
74class AccountColor(AccountMixin):
75 def __init__(self, address, type = None):

Callers 10

rerenderAddressBookMethod · 0.90
click_pushButtonSendMethod · 0.90
displayNewSentMessageMethod · 0.90
on_action_InboxReplyMethod · 0.90
on_context_menuInboxMethod · 0.90
__init__Method · 0.90

Calls 7

BMConfigParserClass · 0.90
BroadcastAccountClass · 0.85
SubscriptionAccountClass · 0.85
NoAccountClass · 0.85
GatewayAccountClass · 0.85
BMAccountClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected