gtk-stream 0.13__py3-none-any.whl → 0.13.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 +10 -10
- gtk_stream/properties.py +14 -3
- {gtk_stream-0.13.dist-info → gtk_stream-0.13.2.dist-info}/METADATA +2 -2
- {gtk_stream-0.13.dist-info → gtk_stream-0.13.2.dist-info}/RECORD +8 -8
- {gtk_stream-0.13.dist-info → gtk_stream-0.13.2.dist-info}/WHEEL +1 -1
- {gtk_stream-0.13.dist-info → gtk_stream-0.13.2.dist-info}/entry_points.txt +0 -0
- {gtk_stream-0.13.dist-info → gtk_stream-0.13.2.dist-info}/top_level.txt +0 -0
gtk_stream/_version.py
CHANGED
gtk_stream/application.py
CHANGED
@@ -54,8 +54,8 @@ class GtkStreamApp(Gtk.Application):
|
|
54
54
|
def __init__(self, logger, **kwargs):
|
55
55
|
super().__init__(**kwargs)
|
56
56
|
self.logger = logger
|
57
|
-
self.
|
58
|
-
self.
|
57
|
+
self.named_widgets = { }
|
58
|
+
self.named_windows = { }
|
59
59
|
|
60
60
|
# The first messages from the pilot may arrive before the
|
61
61
|
# application is ready to process them.
|
@@ -87,7 +87,7 @@ class GtkStreamApp(Gtk.Application):
|
|
87
87
|
|
88
88
|
def name_widget(self, id, w):
|
89
89
|
if id is not None:
|
90
|
-
self.
|
90
|
+
self.named_widgets[id] = w
|
91
91
|
|
92
92
|
def set_attrs(self, attrs):
|
93
93
|
for name, val in attrs.items():
|
@@ -107,7 +107,7 @@ class GtkStreamApp(Gtk.Application):
|
|
107
107
|
print(f"{id}:none-selected")
|
108
108
|
sys.stdout.flush()
|
109
109
|
|
110
|
-
dialog.open(parent = self.
|
110
|
+
dialog.open(parent = self.named_windows[parent], callback = on_choose)
|
111
111
|
|
112
112
|
@app_message('window', single_store)
|
113
113
|
def new_window(self, document, id, **attrs):
|
@@ -115,7 +115,7 @@ class GtkStreamApp(Gtk.Application):
|
|
115
115
|
for (attr_name, attr_val) in attrs.items():
|
116
116
|
self.logger.debug("Setting attr '%s' on window", attr_name)
|
117
117
|
set_parse_prop(self, win, attr_name, attr_val)
|
118
|
-
self.
|
118
|
+
self.named_windows[id] = win
|
119
119
|
win.set_child(document.render())
|
120
120
|
win.connect('close-request', printEvent(self.logger, 'close-request', id))
|
121
121
|
win.present()
|
@@ -133,11 +133,11 @@ class GtkStreamApp(Gtk.Application):
|
|
133
133
|
|
134
134
|
@app_message('close-window')
|
135
135
|
def close_window(self, id):
|
136
|
-
self.
|
136
|
+
self.named_windows[id].close()
|
137
137
|
|
138
138
|
@app_message('remove')
|
139
139
|
def remove_widget(self, id):
|
140
|
-
w = self.
|
140
|
+
w = self.named_widgets[id]
|
141
141
|
w.get_parent().remove(w)
|
142
142
|
|
143
143
|
@app_message('insert', multiple_store)
|
@@ -146,14 +146,14 @@ class GtkStreamApp(Gtk.Application):
|
|
146
146
|
self.insert_widget(doc, into)
|
147
147
|
|
148
148
|
def insert_widget(self, document, into):
|
149
|
-
if into in self.
|
150
|
-
w = self.
|
149
|
+
if into in self.named_widgets:
|
150
|
+
w = self.named_widgets[into]
|
151
151
|
w.insert_child(document)
|
152
152
|
else:
|
153
153
|
raise Exception(f"Error: unknown widget id '{into}'")
|
154
154
|
|
155
155
|
@app_message('set-prop')
|
156
156
|
def set_prop(self, id, name, value):
|
157
|
-
w = self.
|
157
|
+
w = self.named_widgets[id]
|
158
158
|
w.set_property(name, parse_property(get_prop_type(w.__class__, name), value)(self))
|
159
159
|
|
gtk_stream/properties.py
CHANGED
@@ -50,9 +50,9 @@ def _parse_adjustment_property(val):
|
|
50
50
|
def _parse_css_classes_property(val):
|
51
51
|
return _const(val.split())
|
52
52
|
def _parse_widget_property(val):
|
53
|
-
return lambda app: app.
|
53
|
+
return lambda app: app.named_widgets[val]
|
54
54
|
def _parse_window_property(val):
|
55
|
-
return lambda app: app.
|
55
|
+
return lambda app: app.named_windows[val]
|
56
56
|
def _parse_gfile_property(val):
|
57
57
|
return _const(Gio.File.new_for_path(val))
|
58
58
|
def _parse_align_property(val):
|
@@ -63,7 +63,17 @@ def _parse_align_property(val):
|
|
63
63
|
return _const(Gtk.Align.CENTER)
|
64
64
|
case "end":
|
65
65
|
return _const(Gtk.Align.END)
|
66
|
-
|
66
|
+
def _parse_selection_mode_property(val):
|
67
|
+
match val:
|
68
|
+
case "none":
|
69
|
+
return _const(Gtk.SelectionMode.NONE)
|
70
|
+
case "single":
|
71
|
+
return _const(Gtk.SelectionMode.SINGLE)
|
72
|
+
case "browse":
|
73
|
+
return _const(Gtk.SelectionMode.BROWSE)
|
74
|
+
case "multiple":
|
75
|
+
return _const(Gtk.SelectionMode.MULTIPLE)
|
76
|
+
|
67
77
|
_PARSE_TYPE_PROPERTY = {
|
68
78
|
'GStrv' : _parse_css_classes_property,
|
69
79
|
'GtkOrientation' : _parse_orientation_property,
|
@@ -79,6 +89,7 @@ _PARSE_TYPE_PROPERTY = {
|
|
79
89
|
'gchararray' : _const,
|
80
90
|
'GFile' : _parse_gfile_property,
|
81
91
|
'GtkAlign' : _parse_align_property,
|
92
|
+
'GtkSelectionMode' : _parse_selection_mode_property,
|
82
93
|
}
|
83
94
|
|
84
95
|
def parse_property(prop_type, val):
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: gtk-stream
|
3
|
-
Version: 0.13
|
3
|
+
Version: 0.13.2
|
4
4
|
Summary: A simple stream-oriented GUI protocol
|
5
5
|
Author-email: Marc Coiffier <marc.coiffier@univ-grenoble-alpes.fr>
|
6
6
|
Project-URL: Homepage, https://coiffier.net/projects/gtk-stream/
|
@@ -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=
|
2
|
+
gtk_stream/_version.py,sha256=ByxP_AGaDBx1nhN9W4fte2GtMXAPh9eMZ4pSGlztQPc,413
|
3
|
+
gtk_stream/application.py,sha256=nPmMtAvwcikeqanL537oMxRPMcaRZQsmETEVfy-vqvM,5498
|
4
4
|
gtk_stream/command_line.py,sha256=g7Sed0ydnDGKyWHT09murwR-3vZyIKXRWgM4Oi0qDE4,3278
|
5
5
|
gtk_stream/common.py,sha256=xdscxYgBg_Ux6iyk26gB-AMSgoUIqlZUPgso5YS_gKE,2106
|
6
6
|
gtk_stream/parser.py,sha256=5D5VlAHJZghNKHbZJBMWMaBuTcThStQE_58PwC37Uos,5707
|
7
|
-
gtk_stream/properties.py,sha256=
|
7
|
+
gtk_stream/properties.py,sha256=DCcRCP3REdfWDkPEVUsNHi1b2XxXU5toL3pf_SxmqQ4,4039
|
8
8
|
gtk_stream/documents/__init__.py,sha256=cMWSmjD2_5oJ2EoSk3Jy9-LPeAGKDIidYNRJvqUzdU8,856
|
9
9
|
gtk_stream/documents/classes/Box.py,sha256=TIxRLO0_SjRpE3soimHuNE0q4jDbU_BUCpcuspSPAzg,1382
|
10
10
|
gtk_stream/documents/classes/Button.py,sha256=21bVI7DUWmiusboxdsimTgcqKtLqzQydhS9ifIt4R64,1512
|
@@ -24,8 +24,8 @@ gtk_stream/documents/classes/Separator.py,sha256=uw_EgAKs_6pNA8nrOLzruIlJfk4uaog
|
|
24
24
|
gtk_stream/documents/classes/Stack.py,sha256=icg1TOlCD0IFPv_42uMa7jHbEAgEnuELrTEbnTKiPgU,1568
|
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.13.dist-info/METADATA,sha256=
|
28
|
-
gtk_stream-0.13.dist-info/WHEEL,sha256=
|
29
|
-
gtk_stream-0.13.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
|
30
|
-
gtk_stream-0.13.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
|
31
|
-
gtk_stream-0.13.dist-info/RECORD,,
|
27
|
+
gtk_stream-0.13.2.dist-info/METADATA,sha256=xLHfeOKVhS1ANoQYpmoHm10u6_qLzTYBzrwydeAdGkY,807
|
28
|
+
gtk_stream-0.13.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
29
|
+
gtk_stream-0.13.2.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
|
30
|
+
gtk_stream-0.13.2.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
|
31
|
+
gtk_stream-0.13.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|