Exemplo n.º 1
0
 def goptionpane_show_text_file_dialog(self, message, title, rows, cols):
     command = pformat(GOptionPane_showTextFileDialog,
                       message=strlib.quote_string(
                           strlib.url_encode(message)),
                       title=strlib.quote_string(strlib.url_encode(title)),
                       rows=rows,
                       cols=cols)
     self.put_pipe(command)
     self.get_result()  # Wait for dialog to close
Exemplo n.º 2
0
    def convert_field(self, value, conversion):
        # print('convert_field')
        # print(value, conversion)
        if conversion == 'b':
            return 'true' if value else 'false'
        elif conversion == 'q':
            return _strlib.quote_string(value)
        elif conversion == 'u':
            return _strlib.quote_string(_strlib.url_encode(value))

        return super().convert_field(value, conversion)
Exemplo n.º 3
0
def test_write_quoted_string():
    quoted = "\a\b\f\n\r\t\v\"\\abcdefghijklmnopqrstuvwxyz1234567890"
    assert quote_string(
        quoted
    ) == '"\\a\\b\\f\\n\\r\\t\\v\\"\\\\abcdefghijklmnopqrstuvwxyz1234567890"'
Exemplo n.º 4
0
 def setSelectedItem(self, gobj, item):
     command = pformat(GChooser_setSelectedItem,
                       id=id(gobj),
                       item=strlib.quote_string(item))
     self.put_pipe(command)
Exemplo n.º 5
0
 def setText(self, gobj, str):
     command = pformat(GTextField_setText,
                       id=id(gobj),
                       text=strlib.quote_string(str))
     self.put_pipe(command)
Exemplo n.º 6
0
 def glabel_set_label(self, gobj, str):
     command = pformat(GLabel_setLabel,
                       id=id(gobj),
                       label=strlib.quote_string(str))
     self.put_pipe(command)
Exemplo n.º 7
0
 def gwindow_set_window_title(self, gw, title):
     command = pformat(GWindow_setTitle,
                       id=id(gw),
                       title=strlib.quote_string(title))
     self.put_pipe(command)