gtk-stream 0.2__tar.gz → 0.2.1__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.2 → gtk_stream-0.2.1}/PKG-INFO +1 -1
- gtk_stream-0.2.1/gtk_stream/common.py +19 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Dropdown.py +2 -4
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Switch.py +3 -8
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream.egg-info/PKG-INFO +1 -1
- {gtk_stream-0.2 → gtk_stream-0.2.1}/pyproject.toml +1 -1
- gtk_stream-0.2/gtk_stream/common.py +0 -11
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/__init__.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/application.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/command_line.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/__init__.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Box.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Button.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Document.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Frame.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Grid.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Label.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/Paned.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/ProgressBar.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/documents/classes/__init__.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/parser.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream/properties.py +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream.egg-info/SOURCES.txt +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream.egg-info/dependency_links.txt +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream.egg-info/entry_points.txt +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream.egg-info/requires.txt +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/gtk_stream.egg-info/top_level.txt +0 -0
- {gtk_stream-0.2 → gtk_stream-0.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: gtk-stream
|
3
|
-
Version: 0.2
|
3
|
+
Version: 0.2.1
|
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://coiffiem.gricad-pages.univ-grenoble-alpes.fr/gtk-stream/
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import sys
|
2
|
+
|
3
|
+
def _data_str_default(*args):
|
4
|
+
return ''
|
5
|
+
def _data_str_by(get_data):
|
6
|
+
def ret(*args):
|
7
|
+
return ":"+get_data(*args)
|
8
|
+
return ret
|
9
|
+
|
10
|
+
def printEvent(event, id, retval = None, get_data = None):
|
11
|
+
data_str = _data_str_default if get_data == None else _data_str_by(get_data)
|
12
|
+
def ret(*args):
|
13
|
+
try:
|
14
|
+
print("{}:{}{}".format(id,event,data_str(*args)), file=sys.stdout)
|
15
|
+
sys.stdout.flush()
|
16
|
+
except Exception as e:
|
17
|
+
print("Exception when writing an event: {}".format(e))
|
18
|
+
return retval
|
19
|
+
return ret
|
@@ -1,5 +1,6 @@
|
|
1
1
|
from ... import Gtk, Gio, GObject
|
2
2
|
from .. import Document
|
3
|
+
from ...common import printEvent
|
3
4
|
|
4
5
|
class Item(Document):
|
5
6
|
def __init__(self, app, value, **kwargs):
|
@@ -41,10 +42,7 @@ class Dropdown(Document):
|
|
41
42
|
|
42
43
|
ret = Gtk.DropDown(model=model, expression=Gtk.PropertyExpression.new(_ItemObject, None, 'item_value'), factory=factory)
|
43
44
|
|
44
|
-
|
45
|
-
print(f"{self.id}:selected:{w.get_selected_item().value}")
|
46
|
-
sys.stdout.flush()
|
47
|
-
ret.connect('notify::selected-item', on_selection_change)
|
45
|
+
ret.connect('notify::selected-item', printEvent('selected', self.id, get_data = lambda w,_: w.get_selected_item().value))
|
48
46
|
return ret
|
49
47
|
def attach_child(self, w, d):
|
50
48
|
pass
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import sys
|
2
|
-
|
3
1
|
from ... import Gtk
|
4
2
|
from ...common import printEvent
|
5
3
|
from .. import Document
|
@@ -11,10 +9,7 @@ class Switch(Document):
|
|
11
9
|
self.managed = parse_property('managed', managed)
|
12
10
|
def render_raw(self):
|
13
11
|
ret = Gtk.Switch()
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
sys.stdout.flush()
|
18
|
-
return self.managed
|
19
|
-
ret.connect('state-set', on_state_set)
|
12
|
+
ret.connect('state-set', printEvent('switch', self.id,
|
13
|
+
retval = self.managed,
|
14
|
+
get_data = lambda _,state: "on" if state else "off"))
|
20
15
|
return ret
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: gtk-stream
|
3
|
-
Version: 0.2
|
3
|
+
Version: 0.2.1
|
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://coiffiem.gricad-pages.univ-grenoble-alpes.fr/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
|