gtk-stream 0.13.1__tar.gz → 0.13.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/PKG-INFO +2 -2
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/_version.py +2 -2
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/application.py +12 -12
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/common.py +6 -6
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Document.py +3 -3
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/parser.py +2 -2
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/properties.py +2 -2
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream.egg-info/PKG-INFO +2 -2
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/README.md +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk-stream +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/__init__.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/command_line.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/__init__.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Box.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Button.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Dropdown.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Entry.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/FlowBox.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Frame.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Grid.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Label.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Paned.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Picture.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/ProgressBar.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Scale.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/ScrolledWindow.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Separator.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Stack.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/Switch.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream/documents/classes/__init__.py +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream.egg-info/SOURCES.txt +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream.egg-info/dependency_links.txt +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream.egg-info/entry_points.txt +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream.egg-info/requires.txt +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/gtk_stream.egg-info/top_level.txt +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/pyproject.toml +0 -0
- {gtk_stream-0.13.1 → gtk_stream-0.13.3}/setup.cfg +0 -0
@@ -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.3
|
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/
|
@@ -19,7 +19,7 @@ import threading
|
|
19
19
|
import signal
|
20
20
|
|
21
21
|
from . import Gtk, GLib, Gdk
|
22
|
-
from .common import
|
22
|
+
from .common import print_event
|
23
23
|
from .properties import parse_property, get_prop_type, set_parse_prop
|
24
24
|
|
25
25
|
class _Object:
|
@@ -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,9 +115,9 @@ 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
|
-
win.connect('close-request',
|
120
|
+
win.connect('close-request', print_event(self.logger, 'close-request', id))
|
121
121
|
win.present()
|
122
122
|
|
123
123
|
@app_message('style', style_store)
|
@@ -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
|
|
@@ -24,7 +24,7 @@ def _data_str_by(get_data):
|
|
24
24
|
return ":"+get_data(*args)
|
25
25
|
return ret
|
26
26
|
|
27
|
-
def
|
27
|
+
def print_event(logger, event, id, retval = None, get_data = None):
|
28
28
|
data_str = _data_str_default if get_data == None else _data_str_by(get_data)
|
29
29
|
def ret(*args):
|
30
30
|
try:
|
@@ -45,14 +45,14 @@ class Logger:
|
|
45
45
|
def __init__(self, level = LogLevel.WARN, stderr = sys.stderr):
|
46
46
|
self.stderr = stderr
|
47
47
|
self.level = level
|
48
|
-
self.debug = self.
|
49
|
-
self.info = self.
|
50
|
-
self.warn = self.
|
51
|
-
self.error = self.
|
48
|
+
self.debug = self._init_logger(LogLevel.DEBUG)
|
49
|
+
self.info = self._init_logger(LogLevel.INFO)
|
50
|
+
self.warn = self._init_logger(LogLevel.WARN)
|
51
|
+
self.error = self._init_logger(LogLevel.ERROR)
|
52
52
|
def flush(self):
|
53
53
|
self.stderr.flush()
|
54
54
|
|
55
|
-
def
|
55
|
+
def _init_logger(self, level):
|
56
56
|
if self.level.value <= level.value:
|
57
57
|
def ret(fmt, *args):
|
58
58
|
print((f"[{level.name}]: {fmt}") % args, file=self.stderr)
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
16
16
|
|
17
17
|
from ...properties import parse_property, get_prop_type
|
18
|
-
from ...common import
|
18
|
+
from ...common import print_event
|
19
19
|
|
20
20
|
class Document:
|
21
21
|
__g_class__ = None
|
@@ -28,8 +28,8 @@ class Document:
|
|
28
28
|
}
|
29
29
|
self.children = []
|
30
30
|
|
31
|
-
def connect_event(self, w, event, name, **
|
32
|
-
w.connect(event,
|
31
|
+
def connect_event(self, w, event, name, **print_event_kwargs):
|
32
|
+
w.connect(event, print_event(self.app.logger, name, self.id, **print_event_kwargs))
|
33
33
|
def add_child(self, child):
|
34
34
|
self.children.append(child)
|
35
35
|
|
@@ -65,7 +65,7 @@ class GtkStreamXMLHandler(sax.ContentHandler):
|
|
65
65
|
# class. This allows defining new messages without
|
66
66
|
# touching the parser
|
67
67
|
self.messages = {
|
68
|
-
f.__tag_name__: self.
|
68
|
+
f.__tag_name__: self.start_message(functools.partial(f,self.app), f.__store__)
|
69
69
|
for f in self.app.__class__.__dict__.values()
|
70
70
|
if hasattr(f, '__tag_name__')
|
71
71
|
}
|
@@ -103,7 +103,7 @@ class GtkStreamXMLHandler(sax.ContentHandler):
|
|
103
103
|
case _:
|
104
104
|
raise Exception("Error: expected 'application' tag")
|
105
105
|
|
106
|
-
def
|
106
|
+
def start_message(self, f, child = None):
|
107
107
|
if child != None:
|
108
108
|
def ret(name,attrs):
|
109
109
|
getC, setC, setChars = child()
|
@@ -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):
|
@@ -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.3
|
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/
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|