Пример #1
0
	def fill_users(self):
		query = ("use genesisDB;")
		query1 = ("select * from users;")
		try:
			self.cursor.execute(query)
			self.cursor.execute(query1)

			for (param1, param2, param3, param4) in self.cursor:
				objUser = user(param1,param2,param3,param4)
				self.users.append(objUser)

			self.disconnectDB()
		
		except:
			print("No se puede conectar a genesisDB")
			self.disconnectDB()
Пример #2
0
    def __init__(self, auth_key, secret, url, **kwargs):
        self._key = auth_key
        self._secret = secret
        self._url = url

        # Default request type is POST
        self._request_method = 'POST'

        # Setup optional persistent arguments
        self._args = {}
        for k, v in kwargs.items():
            self._args[k] = v

        self.clear()

        # All the objects get initialized
        self.account = objects.account(self)
        self.attachment = objects.attachment(self)
        self.call = objects.call(self)
        self.chat = objects.chat(self)
        self.contact = objects.contact(self)
        self.conversation = objects.conversation(self)
        self.folder = objects.folder(self)
        self.history = objects.history(self)
        self.invoice = objects.invoice(self)
        self.key = objects.key(self)
        self.mailbox = objects.mailbox(self)
        self.message = objects.message(self)
        self.metrics = objects.metrics(self)
        self.note = objects.note(self)
        self.partner = objects.partner(self)
        self.popAccount = objects.popAccount(self)
        self.preference = objects.preference(self)
        self.search = objects.search(self)
        self.smtpServer = objects.smtpServer(self)
        self.tag = objects.tag(self)
        self.template = objects.template(self)
        self.ticket = objects.ticket(self)
        self.user = objects.user(self)
        self.utility = objects.utility(self)
Пример #3
0
 def getUser(self,username):
     user = objects.user(self.token,self.pubkey,username)
     return user
Пример #4
0
 def getUser(self, username):
     user = objects.user(self.token, self.pubkey, username)
     return user
Пример #5
0
	def check_login(self, name, passwd):
		for i in self.users:
			if i.user == name and i.passwd == passwd:
				return True, user(i.id ,i.user ,i.passwd, i.level)
		return False, user()