gtk-stream 0.11__py3-none-any.whl → 0.11.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- gtk_stream/_version.py +2 -2
- gtk_stream/application.py +1 -0
- gtk_stream/command_line.py +28 -11
- gtk_stream/documents/classes/Picture.py +5 -6
- gtk_stream/properties.py +8 -2
- {gtk_stream-0.11.dist-info → gtk_stream-0.11.2.dist-info}/METADATA +1 -1
- {gtk_stream-0.11.dist-info → gtk_stream-0.11.2.dist-info}/RECORD +10 -10
- {gtk_stream-0.11.dist-info → gtk_stream-0.11.2.dist-info}/WHEEL +1 -1
- {gtk_stream-0.11.dist-info → gtk_stream-0.11.2.dist-info}/entry_points.txt +0 -0
- {gtk_stream-0.11.dist-info → gtk_stream-0.11.2.dist-info}/top_level.txt +0 -0
gtk_stream/_version.py
CHANGED
gtk_stream/application.py
CHANGED
@@ -95,6 +95,7 @@ class GtkStreamApp(Gtk.Application):
|
|
95
95
|
def newWindow(self, document, id, **attrs):
|
96
96
|
win = Gtk.Window(application=self)
|
97
97
|
for (attr_name, attr_val) in attrs.items():
|
98
|
+
self.logger.debug("Setting attr '%s' on window", attr_name)
|
98
99
|
set_parse_prop(self, win, attr_name, attr_val)
|
99
100
|
self.namedWindows[id] = win
|
100
101
|
win.set_child(document.render())
|
gtk_stream/command_line.py
CHANGED
@@ -18,10 +18,11 @@ import io
|
|
18
18
|
import xml.sax as sax
|
19
19
|
import sys
|
20
20
|
import os
|
21
|
+
import argparse
|
21
22
|
|
22
23
|
from .parser import GtkStreamXMLHandler
|
23
24
|
from .common import Logger, LogLevel
|
24
|
-
from . import GLib
|
25
|
+
from . import GLib, Gtk, Gdk
|
25
26
|
|
26
27
|
logLevel = LogLevel.__dict__.get(os.environ.get('GTK_STREAM_LOGLEVEL', 'WARN'), LogLevel.WARN)
|
27
28
|
|
@@ -34,13 +35,29 @@ class GtkStreamErrorHandler(sax.handler.ErrorHandler):
|
|
34
35
|
raise exc
|
35
36
|
|
36
37
|
def main():
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
parser = argparse.ArgumentParser(
|
39
|
+
prog='gtk-stream',
|
40
|
+
description='A stream-based GUI tool',
|
41
|
+
add_help=False
|
42
|
+
)
|
43
|
+
parser.add_argument('--list-icons', action='store_true')
|
44
|
+
parser.add_argument('-h', '--help', action='store_true')
|
45
|
+
args = parser.parse_args()
|
46
|
+
|
47
|
+
if args.help:
|
48
|
+
parser.print_help()
|
49
|
+
elif args.list_icons:
|
50
|
+
theme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default())
|
51
|
+
for name in theme.get_icon_names():
|
52
|
+
print(name)
|
53
|
+
else:
|
54
|
+
handler = GtkStreamXMLHandler(logger)
|
55
|
+
errHandler = GtkStreamErrorHandler()
|
56
|
+
parser = sax.make_parser()
|
57
|
+
parser.setContentHandler(handler)
|
58
|
+
parser.setErrorHandler(errHandler)
|
59
|
+
try:
|
60
|
+
parser.parse(io.FileIO(0, 'r', closefd=False))
|
61
|
+
except Exception as e:
|
62
|
+
logger.error("Done with exception : %s", e)
|
63
|
+
handler.quit_application()
|
@@ -20,16 +20,15 @@ from .. import Document
|
|
20
20
|
|
21
21
|
class Picture(Document):
|
22
22
|
__g_class__ = Gtk.Picture
|
23
|
-
def __init__(self, app,
|
23
|
+
def __init__(self, app, **kwargs):
|
24
24
|
super().__init__(app, **kwargs)
|
25
|
-
self.src = src
|
26
25
|
def render_raw(self):
|
27
|
-
return Gtk.Picture
|
26
|
+
return Gtk.Picture()
|
28
27
|
|
29
28
|
class Icon(Document):
|
30
29
|
__g_class__ = Gtk.Image
|
31
|
-
def __init__(self, app,
|
30
|
+
def __init__(self, app, **kwargs):
|
32
31
|
super().__init__(app, **kwargs)
|
33
|
-
self.src = src
|
34
32
|
def render_raw(self):
|
35
|
-
return Gtk.Image
|
33
|
+
return Gtk.Image()
|
34
|
+
|
gtk_stream/properties.py
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
import sys
|
18
18
|
|
19
|
-
from . import Gtk
|
19
|
+
from . import Gtk, Gio
|
20
20
|
|
21
21
|
def _const(x):
|
22
22
|
return lambda _: x
|
@@ -51,7 +51,11 @@ def _parse_css_classes_property(val):
|
|
51
51
|
return _const(val.split())
|
52
52
|
def _parse_widget_property(val):
|
53
53
|
return lambda app: app.namedWidgets[val]
|
54
|
-
|
54
|
+
def _parse_window_property(val):
|
55
|
+
return lambda app: app.namedWindows[val]
|
56
|
+
def _parse_gfile_property(val):
|
57
|
+
return _const(Gio.File.new_for_path(val))
|
58
|
+
|
55
59
|
_PARSE_TYPE_PROPERTY = {
|
56
60
|
'GStrv' : _parse_css_classes_property,
|
57
61
|
'GtkOrientation' : _parse_orientation_property,
|
@@ -61,8 +65,10 @@ _PARSE_TYPE_PROPERTY = {
|
|
61
65
|
'gboolean' : _parse_boolean_property,
|
62
66
|
'GtkStringFilterMatchMode' : _parse_searchMode_property,
|
63
67
|
'GtkWidget' : _parse_widget_property,
|
68
|
+
'GtkWindow' : _parse_window_property,
|
64
69
|
'GtkAdjustment' : _parse_adjustment_property,
|
65
70
|
'gchararray' : _const,
|
71
|
+
'GFile' : _parse_gfile_property,
|
66
72
|
}
|
67
73
|
|
68
74
|
def parse_property(prop_type, val):
|
@@ -1,10 +1,10 @@
|
|
1
1
|
gtk_stream/__init__.py,sha256=y6JLknVFexWrSo_Zl7-TXrPR6EQ5XVMeFO1bUzLN9Lg,98
|
2
|
-
gtk_stream/_version.py,sha256=
|
3
|
-
gtk_stream/application.py,sha256=
|
4
|
-
gtk_stream/command_line.py,sha256=
|
2
|
+
gtk_stream/_version.py,sha256=v52WNNFq-_uq9OSfK9O7vLpi66zlufcyohjNPzWbpdk,413
|
3
|
+
gtk_stream/application.py,sha256=uFquTXCV0fbGlSURBmjrg9BK3Enf9N0_WKX6Lv-5Fko,4993
|
4
|
+
gtk_stream/command_line.py,sha256=NdfJ1WTG-NmbW_CGaLCuiEK2SB8jhV-7GVsOW6e-ooI,2104
|
5
5
|
gtk_stream/common.py,sha256=xdscxYgBg_Ux6iyk26gB-AMSgoUIqlZUPgso5YS_gKE,2106
|
6
6
|
gtk_stream/parser.py,sha256=LOCGoTT_L5Qf29YJ2wFfTYLHtH0al-QjpFWf9HEHYxU,6561
|
7
|
-
gtk_stream/properties.py,sha256=
|
7
|
+
gtk_stream/properties.py,sha256=wrKtpyN76BEdm394wBl2A5ssT7Slov-RMf72aREuryk,3255
|
8
8
|
gtk_stream/documents/__init__.py,sha256=T9mIonSi9DWrpXQzbjq0s0TPU0hB7HylfhMA20OfWIg,831
|
9
9
|
gtk_stream/documents/classes/Box.py,sha256=d01o2-JQ3-k0VjvvY8E7mly-u_f1v1NqYz1IDjHZLUo,1381
|
10
10
|
gtk_stream/documents/classes/Button.py,sha256=21bVI7DUWmiusboxdsimTgcqKtLqzQydhS9ifIt4R64,1512
|
@@ -16,7 +16,7 @@ gtk_stream/documents/classes/Frame.py,sha256=zAZvsT-YTZMijsgk7p0YVf6siAmFoCCSXou
|
|
16
16
|
gtk_stream/documents/classes/Grid.py,sha256=jDJ9U1GJZ45hi1VvPsCwFILN7CwEkgjqYqhTzMdtX9o,1249
|
17
17
|
gtk_stream/documents/classes/Label.py,sha256=bBNBTvGs6fM8uLf4EDb2Ro8FmCeS27cnU1Ao-44nRYs,1023
|
18
18
|
gtk_stream/documents/classes/Paned.py,sha256=q1goKJMWBg1d3hS0eanPBxzBqLB-Pz5hUnH9N-RXXh8,1392
|
19
|
-
gtk_stream/documents/classes/Picture.py,sha256=
|
19
|
+
gtk_stream/documents/classes/Picture.py,sha256=p84N1ntCHu47O84m48zC8uKFgso3-38yXpPlAjr4IKU,1153
|
20
20
|
gtk_stream/documents/classes/ProgressBar.py,sha256=NPJtP3qaKiZUEAYEHZk4FEoWSFn2KVorI2SVb8cDnW0,966
|
21
21
|
gtk_stream/documents/classes/Scale.py,sha256=6rW6sBCdpPaqgDEGUPZi5UR8CT3bPmaZQqXXhnl-oaw,1124
|
22
22
|
gtk_stream/documents/classes/ScrolledWindow.py,sha256=WaTPgz6GBC-hjH83SQT2OGUdCapHAgO3xEmSMJZ8q70,1041
|
@@ -24,8 +24,8 @@ gtk_stream/documents/classes/Separator.py,sha256=uw_EgAKs_6pNA8nrOLzruIlJfk4uaog
|
|
24
24
|
gtk_stream/documents/classes/Stack.py,sha256=YA6NDzZL2u4Ko8GXtx8Or-jEWGMCEw2cC1HNkAMRw-8,1030
|
25
25
|
gtk_stream/documents/classes/Switch.py,sha256=jQVuxqS9Pmpp1ymB_dbJPxasJNpm4e35ry0JYPHdAsk,1275
|
26
26
|
gtk_stream/documents/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
|
-
gtk_stream-0.11.dist-info/METADATA,sha256=
|
28
|
-
gtk_stream-0.11.dist-info/WHEEL,sha256=
|
29
|
-
gtk_stream-0.11.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
|
30
|
-
gtk_stream-0.11.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
|
31
|
-
gtk_stream-0.11.dist-info/RECORD,,
|
27
|
+
gtk_stream-0.11.2.dist-info/METADATA,sha256=Naho27fPS6mB7yEnEr09ECYKoNXL9G91tzSfxtTLHUo,807
|
28
|
+
gtk_stream-0.11.2.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
|
29
|
+
gtk_stream-0.11.2.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
|
30
|
+
gtk_stream-0.11.2.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
|
31
|
+
gtk_stream-0.11.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|