コード例 #1
0
ファイル: protocol.py プロジェクト: c0ns0le/Pythonista
    def make_change_user(self, seed, username=None, password=None,
                         database=None, charset=33, client_flags=0):
        """Make a MySQL packet with the Change User command"""
        if not seed:
            raise errors.ProgrammingError('Seed missing')

        auth = self._prepare_auth(username, password, database,
                                  client_flags, seed)
        data =  utils.int1store(ServerCmd.CHANGE_USER) +\
                auth[0] + auth[1] + auth[2] + utils.int2store(charset)
        return data
コード例 #2
0
    def make_change_user(self,
                         seed,
                         username=None,
                         password=None,
                         database=None,
                         charset=33,
                         client_flags=0):
        """Make a MySQL packet with the Change User command"""
        if not seed:
            raise errors.ProgrammingError('Seed missing')

        auth = self._prepare_auth(username, password, database, client_flags,
                                  seed)
        data =  utils.int1store(ServerCmd.CHANGE_USER) +\
                auth[0] + auth[1] + auth[2] + utils.int2store(charset)
        return data
コード例 #3
0
 def _pkt_make_changeuser(self, username=None, password=None,
     database=None, charset=8, seed=None):
     """Make a MySQL packet with the Change User command"""
     try:
         seed = seed or self.scramble
     except:
         raise errors.ProgrammingError('Seed missing')
     
     (_username, _password, _database) = self._prepare_auth(
         username, password, database, self.client_flags, seed)
     data =  utils.int1store(ServerCmd.CHANGE_USER) +\
             _username +\
             _password +\
             _database +\
             utils.int2store(charset)
     return data
コード例 #4
0
ファイル: protocol.py プロジェクト: Alwnikrotikz/open-hea
 def add_2_int(self, i):
     self.add(utils.int2store(i))