コード例 #1
0
ファイル: accountsmanager.py プロジェクト: tomoconnor/wazapp
    def findAccount():
        imsi = Utilities.getImsi()
        print "Looking for %s " % (imsi)
        m = Manager()
        accountIds = m.accountList()

        for aId in accountIds:
            a = m.account(aId)
            services = a.services()
            for s in services:
                if s.name() == "waxmpp":
                    print "found waxmpp account with imsi: %s" % (
                        a.valueAsString("imsi"))
                    if a.valueAsString("imsi") == imsi:
                        account = a
                        waaccount = WAAccount(
                            account.valueAsString("cc"),
                            account.valueAsString("phoneNumber"),
                            account.valueAsString("username"),
                            account.valueAsString("status"),
                            account.valueAsString("pushName"),
                            account.valueAsString("imsi"),
                            account.valueAsString("password"))
                        waaccount.setAccountInstance(a)

                        return waaccount

        return None
コード例 #2
0
ファイル: accountsmanager.py プロジェクト: yashodhank/wazapp
 def getAccountById(accountId):
     account = AccountsManager.manager.account(accountId)
     waaccount = WAAccount(account.valueAsString("cc"),
                           account.valueAsString("phoneNumber"),
                           account.valueAsString("username"),
                           account.valueAsString("status"),
                           account.valueAsString("pushName"),
                           account.valueAsString("imsi"),
                           account.valueAsString("password"))
     waaccount.setAccountInstance(account)
     return waaccount
コード例 #3
0
ファイル: accountsmanager.py プロジェクト: yashodhank/wazapp
    def findAccount():
        d = AccountsDebug()
        _d = d.d
        imsi = Utilities.getImsi()
        _d("Looking for %s " % (imsi))
        accountIds = AccountsManager.manager.accountList()

        for aId in accountIds:
            a = AccountsManager.manager.account(aId)
            services = a.services()
            for s in services:
                if s.name() in ("waxmpp"):
                    _d("found waxmpp account with imsi: %s" %
                       (a.valueAsString("imsi")))
                    if a.valueAsString("imsi") == imsi:
                        account = a
                        waaccount = WAAccount(
                            account.valueAsString("cc"),
                            account.valueAsString("phoneNumber"),
                            account.valueAsString("username"),
                            account.valueAsString("status"),
                            account.valueAsString("pushName"),
                            account.valueAsString("imsi"),
                            base64.b64decode(account.valueAsString("password"))
                            if account.valueAsString("penc") == "b64" else str(
                                account.valueAsString("password")))
                        #to ensure backwards compatibility for non-blocked accounts

                        if account.valueAsString(
                                "wazapp_version"):  #rest of data exist
                            waaccount.setExtraData(
                                account.valueAsString("kind"),
                                account.valueAsString("expiration"),
                                account.valueAsString("cost"),
                                account.valueAsString("currency"),
                                account.valueAsString("price"),
                                account.valueAsString("price_expiration"))

                        waaccount.setAccountInstance(a)

                        return waaccount

        return None
コード例 #4
0
	def findAccount():
		imsi = Utilities.getImsi()
		print "Looking for %s "%(imsi)
		m = Manager()
		accountIds = m.accountList()
		
		for aId in accountIds:
			a = m.account(aId)
			services = a.services()
			for s in services:
				if s.name() == "waxmpp":
					print "found waxmpp account with imsi: %s"%(a.valueAsString("imsi"))
					if a.valueAsString("imsi") == imsi:
						account = a
						waaccount = WAAccount(account.valueAsString("cc"),account.valueAsString("phoneNumber"),account.valueAsString("username"),account.valueAsString("status"),account.valueAsString("pushName"),account.valueAsString("imsi"),account.valueAsString("password"));
						waaccount.setAccountInstance(a)
						
						return waaccount
		
		return None
コード例 #5
0
ファイル: accountsmanager.py プロジェクト: lailafer/wazapp
	def findAccount():
		d = AccountsDebug()
		_d = d.d;
		imsi = Utilities.getImsi()
		_d("Looking for %s "%(imsi))
		accountIds = AccountsManager.manager.accountList()

		for aId in accountIds:
			a = AccountsManager.manager.account(aId)
			services = a.services()
			for s in services:
				if s.name() in ("waxmpp"):
					_d("found waxmpp account with imsi: %s"%(a.valueAsString("imsi")))
					if a.valueAsString("imsi") == imsi:
						account = a
						waaccount = WAAccount(account.valueAsString("cc"),
											account.valueAsString("phoneNumber"),
											account.valueAsString("username"),
											account.valueAsString("status"),
											account.valueAsString("pushName"),
											account.valueAsString("imsi"),
											base64.b64decode(account.valueAsString("password")) 
												if account.valueAsString("penc") == "b64" 
												else account.valueAsString("password")); #to ensure backwards compatibility for non-blocked accounts

						if account.valueAsString("wazapp_version"): #rest of data exist
							waaccount.setExtraData(account.valueAsString("kind"), 
													account.valueAsString("expiration"),
													account.valueAsString("cost"), 
													account.valueAsString("currency"),
													account.valueAsString("price"), 
													account.valueAsString("price_expiration"))
						
						waaccount.setAccountInstance(a)
						
						return waaccount
		
		return None
コード例 #6
0
ファイル: accountsmanager.py プロジェクト: lailafer/wazapp
	def getAccountById(accountId):
		account = AccountsManager.manager.account(accountId)
		waaccount = WAAccount(account.valueAsString("cc"),account.valueAsString("phoneNumber"),account.valueAsString("username"),account.valueAsString("status"),account.valueAsString("pushName"),account.valueAsString("imsi"),account.valueAsString("password"));
		waaccount.setAccountInstance(account)
		return waaccount