pgconsole.py
author Radek Brich <brich.radek@ifortuna.cz>
Tue, 29 Apr 2014 17:50:15 +0200
changeset 98 024299702087
parent 93 b72591087495
permissions -rwxr-xr-x
Update batchcopy: When target record exists, allow to ignore / update the error (--dst-exists parameter).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
93
b72591087495 Change python3.2 to python3 in scripts.
Radek Brich <brich.radek@ifortuna.cz>
parents: 11
diff changeset
     1
#!/usr/bin/env python3
10
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     2
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     3
from pgconsole.config import cfg
11
bc69eca59041 PgConsole: add app.py, splitted from pgconsole.py.
Radek Brich <radek.brich@devl.cz>
parents: 10
diff changeset
     4
from pgconsole.app import PgConsoleApp
10
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     5
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     6
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     7
if __name__ == '__main__':
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
    try:
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     9
        cfg.load('pgconsole.xml.gz')
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    10
    except IOError:
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    11
        cfg.new('pgconsole.xml.gz')
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    12
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    13
    try:
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    14
        gtkrc = cfg.root.style.gtkrc.text
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    15
    except AttributeError:
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    16
        pass
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    17
    else:
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    18
        gtk.rc_parse_string(gtkrc)
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    19
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    20
    app = PgConsoleApp()
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    21
    app.main()
f3a1b9792cc9 Added pgconsole. It is my older project, a GUI query console. It uses GTK+ and asynchronous queries.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    22