コード例 #1
0
    def send_keys(self, keys):
        """Send keys to node

        :type keys: String
            :rtype : None
        """
        key_codes = scancodes.from_string(str(keys))
        for key_code in key_codes:
            if isinstance(key_code[0], str):
                if key_code[0] == 'wait':
                    sleep(1)
                continue
            self._libvirt_node.sendKey(0, 0, list(key_code), len(key_code), 0)
コード例 #2
0
    def send_keys(self, keys):
        """Send keys to node

        :type keys: String
            :rtype : None
        """
        key_codes = scancodes.from_string(str(keys))
        for key_code in key_codes:
            if isinstance(key_code[0], str):
                if key_code[0] == 'wait':
                    sleep(1)
                continue
            self._libvirt_node.sendKey(0, 0, list(key_code), len(key_code), 0)
コード例 #3
0
ファイル: libvirt_driver.py プロジェクト: aglarendil/devops
    def node_send_keys(self, node, keys):
        """
        :rtype : None
        :type node: Node
        """

        keys = scancodes.from_string(str(keys))
        for key_codes in keys:
            if isinstance(key_codes[0], str):
                if key_codes[0] == 'wait':
                    sleep(1)
                continue
            self.conn.lookupByUUIDString(node.uuid).sendKey(0, 0, key_codes,
                len(key_codes), 0, 0)
コード例 #4
0
    def node_send_keys(self, node, keys):
        """
        :type node: Node
            :rtype : None
        """

        key_codes = scancodes.from_string(str(keys))
        for key_code in key_codes:
            if isinstance(key_code[0], str):
                if key_code[0] == 'wait':
                    sleep(1)
                continue
            self.conn.lookupByUUIDString(node.uuid).sendKey(
                0, 0, list(key_code), len(key_code), 0)
コード例 #5
0
ファイル: test_scancodes.py プロジェクト: teran/fuel-devops
 def test_wait(self):
     codes = scancodes.from_string("a<Wait>b")
     self.assertEqual([(0x1e,), ('wait',), (0x30,)], codes)
コード例 #6
0
ファイル: test_scancodes.py プロジェクト: teran/fuel-devops
 def test_newlines_are_ignored(self):
     codes = scancodes.from_string("a\nb")
     self.assertEqual([(0x1e,), (0x30,)], codes)
コード例 #7
0
ファイル: test_scancodes.py プロジェクト: teran/fuel-devops
 def test_specials(self):
     codes = scancodes.from_string('<Esc>a<Up>b')
     self.assertEqual([(0x01,), (0x1e,), (0x48,), (0x30,)], codes)
コード例 #8
0
ファイル: test_scancodes.py プロジェクト: teran/fuel-devops
 def test_ABC(self):
     codes = scancodes.from_string('ABC')
     self.assertEqual([(0x2a, 0x1e), (0x2a, 0x30), (0x2a, 0x2e)], codes)
コード例 #9
0
ファイル: test_scancodes.py プロジェクト: teran/fuel-devops
 def test_abc(self):
     codes = scancodes.from_string('abc')
     self.assertEqual([(0x1e,), (0x30,), (0x2e,)], codes)
コード例 #10
0
ファイル: test_scancodes.py プロジェクト: korshenin/devops
 def test_ABC(self):
     codes = scancodes.from_string("ABC")
     self.assertEqual([(0x2A, 0x1E), (0x2A, 0x30), (0x2A, 0x2E)], codes)
コード例 #11
0
ファイル: test_scancodes.py プロジェクト: korshenin/devops
 def test_abc(self):
     codes = scancodes.from_string("abc")
     self.assertEqual([(0x1E,), (0x30,), (0x2E,)], codes)