(address)
| 46 | return ret |
| 47 | |
| 48 | def 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 | |
| 74 | class AccountColor(AccountMixin): |
| 75 | def __init__(self, address, type = None): |
no test coverage detected