gtk-stream 0.13.5__py3-none-any.whl → 0.14__py3-none-any.whl

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/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.13.5'
16
- __version_tuple__ = version_tuple = (0, 13, 5)
15
+ __version__ = version = '0.14'
16
+ __version_tuple__ = version_tuple = (0, 14)
gtk_stream/application.py CHANGED
@@ -89,6 +89,9 @@ class GtkStreamApp(Gtk.Application):
89
89
  if id is not None:
90
90
  self.named_widgets[id] = w
91
91
 
92
+ def wait_for_init(self):
93
+ self.attrs_set.acquire()
94
+
92
95
  def set_attrs(self, attrs):
93
96
  for name, val in attrs.items():
94
97
  set_parse_prop(self, self, name, val)
@@ -138,7 +141,7 @@ class GtkStreamApp(Gtk.Application):
138
141
  @app_message('remove')
139
142
  def remove_widget(self, id):
140
143
  w = self.named_widgets[id]
141
- w.get_parent().remove(w)
144
+ w.remove_self()
142
145
 
143
146
  @app_message('insert', multiple_store)
144
147
  def insert_widgets(self, documents, into):
@@ -93,8 +93,5 @@ function GTK.receive() {
93
93
  parser_thread = threading.Thread(target = parser_main, daemon = True)
94
94
  parser_thread.start()
95
95
 
96
- # When the parser parses the 'application' tag, it sets the
97
- # application attributes, and releases the semaphore so the
98
- # application can start
99
- app.attrs_set.acquire()
96
+ app.wait_for_init()
100
97
  app.run()
@@ -29,10 +29,12 @@ class Box(Document):
29
29
  def render_raw(self):
30
30
  return Gtk.Box()
31
31
  def insert_child(self, w, d):
32
+ child = d.render_in(w)
32
33
  if isinstance(d, BoxPrepend):
33
34
  if d.after != None:
34
- w.insert_child_after(d.render(), self.app.named_widgets[d.after])
35
+ w.insert_child_after(child, self.app.named_widgets[d.after])
35
36
  else:
36
- w.prepend(d.render())
37
+ w.prepend(child)
37
38
  else:
38
- w.append(d.render())
39
+ w.append(child)
40
+
@@ -26,7 +26,7 @@ class Button(Document):
26
26
  self.connect_event(button, 'clicked', 'clicked')
27
27
  return button
28
28
  def insert_child(self, w, d):
29
- w.set_child(d.render())
29
+ w.set_child(d.render_in(w))
30
30
 
31
31
  class LinkButton(Button):
32
32
  __g_class__ = Gtk.LinkButton
@@ -39,4 +39,4 @@ class LinkButton(Button):
39
39
  retval = True)
40
40
  return button
41
41
  def insert_child(self, w, d):
42
- w.set_child(d.render())
42
+ w.set_child(d.render_in(w))
@@ -42,6 +42,8 @@ class Document:
42
42
  val = v(self.app)
43
43
  self.app.logger.debug("Setting property '%s' to '%s' in widget %s", p, val, self.__class__)
44
44
  w.set_property(p, val)
45
+ if self.id:
46
+ w.set_property("name", self.id)
45
47
  w.insert_child = lambda d: self.insert_child(w, d)
46
48
  def render(self):
47
49
  w = self.render_raw()
@@ -49,6 +51,10 @@ class Document:
49
51
  for child in self.children:
50
52
  self.insert_child(w, child)
51
53
  return w
54
+ def render_in(self, w):
55
+ ret = self.render()
56
+ ret.remove_self = lambda: w.remove(ret)
57
+ return ret
52
58
 
53
59
  def insert_child(self, w, child):
54
60
  raise Exception("Unimplemented method 'insert_child'")
@@ -28,7 +28,8 @@ class FlowBox(Document):
28
28
  def render_raw(self):
29
29
  return Gtk.FlowBox()
30
30
  def insert_child(self, w, d):
31
+ child = d.render_in(w)
31
32
  if isinstance(d, FlowBoxPrepend):
32
- w.prepend(d.render())
33
+ w.prepend(child)
33
34
  else:
34
- w.append(d.render())
35
+ w.append(child)
@@ -28,7 +28,8 @@ class Frame(Document):
28
28
  def render_raw(self):
29
29
  return Gtk.Frame()
30
30
  def insert_child(self, w, d):
31
+ child = d.render_in(w)
31
32
  if isinstance(d, FrameLabel):
32
- w.set_label_widget(d.render())
33
+ w.set_label_widget(child)
33
34
  else:
34
- w.set_child(d.render())
35
+ w.set_child(child)
@@ -33,4 +33,4 @@ class Grid(Document):
33
33
  def render_raw(self):
34
34
  return Gtk.Grid()
35
35
  def insert_child(self, w, d):
36
- w.attach(d.render(), d.x, d.y, d.w, d.h)
36
+ w.attach(d.render_in(w), d.x, d.y, d.w, d.h)
@@ -24,4 +24,4 @@ class ScrolledWindow(Document):
24
24
  def render_raw(self):
25
25
  return Gtk.ScrolledWindow()
26
26
  def insert_child(self, w, d):
27
- w.set_child(d.render())
27
+ w.set_child(d.render_in(w))
@@ -38,7 +38,7 @@ class Stack(Document):
38
38
  def render_raw(self):
39
39
  return Gtk.Stack()
40
40
  def insert_child(self, w, d):
41
- child = d.render()
41
+ child = d.render_in(w)
42
42
  w.add_child(child)
43
43
  if isinstance(d, StackPage):
44
44
  page = w.get_page(child)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gtk-stream
3
- Version: 0.13.5
3
+ Version: 0.14
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/
@@ -0,0 +1,31 @@
1
+ gtk_stream/__init__.py,sha256=y6JLknVFexWrSo_Zl7-TXrPR6EQ5XVMeFO1bUzLN9Lg,98
2
+ gtk_stream/_version.py,sha256=lmFPHiet63Bn9h104yd9q0T6i7C2c0WCbizqrpAtSuk,408
3
+ gtk_stream/application.py,sha256=1C0AsqemyV2VX_z7C7PWH6eYlQ0Q5jo7PAFjolaO0HM,5562
4
+ gtk_stream/command_line.py,sha256=57slfbV-EUWVI8bsA50IzmCLqNjN9aZpz8J8Gtituro,3105
5
+ gtk_stream/common.py,sha256=2USRh42DmmxtPO1y8gpeU0hMuHfhcqJBPuxtvd46YHg,2112
6
+ gtk_stream/parser.py,sha256=lt1cHYwhrd0SwSQfbxtbK6NdwbnFmgeBDIeNY0eepwc,5709
7
+ gtk_stream/properties.py,sha256=DCcRCP3REdfWDkPEVUsNHi1b2XxXU5toL3pf_SxmqQ4,4039
8
+ gtk_stream/documents/__init__.py,sha256=cMWSmjD2_5oJ2EoSk3Jy9-LPeAGKDIidYNRJvqUzdU8,856
9
+ gtk_stream/documents/classes/Box.py,sha256=3GUaeG4kZks0NPUJT4JmwVCAJJ3aXtNvtG3b1xv2-iE,1411
10
+ gtk_stream/documents/classes/Button.py,sha256=UbFi3FeJzpfBCAArtlnmmkcB24kpEyCmpCORnGuKJsc,1520
11
+ gtk_stream/documents/classes/Document.py,sha256=MnKQs3L9yANSOPaYv3hRfocsRZjsK_Kl4epmIIqF97s,2548
12
+ gtk_stream/documents/classes/Dropdown.py,sha256=8fIUX1HCWIjUfKLPy9NYsW6OskhkontoNDTsCZ7qKxw,2446
13
+ gtk_stream/documents/classes/Entry.py,sha256=KcBwjSu4tI30bQxPlSFSLPxFEUbTaqAdoAzd0XSQciY,1112
14
+ gtk_stream/documents/classes/FlowBox.py,sha256=R6HOf_k2Dgl43JDk_ErA-jK-YM8EsPnu3T46-fXoEic,1246
15
+ gtk_stream/documents/classes/Frame.py,sha256=2clm6-Ww7aYWHlSEMmAU6zB1mvi0KJtXV9zWft1NSJ0,1243
16
+ gtk_stream/documents/classes/Grid.py,sha256=QgEGnPXecHg0E7Sb5d1aMPNyf319u6z0wYtnLlcqLTM,1253
17
+ gtk_stream/documents/classes/Label.py,sha256=bBNBTvGs6fM8uLf4EDb2Ro8FmCeS27cnU1Ao-44nRYs,1023
18
+ gtk_stream/documents/classes/Paned.py,sha256=q1goKJMWBg1d3hS0eanPBxzBqLB-Pz5hUnH9N-RXXh8,1392
19
+ gtk_stream/documents/classes/Picture.py,sha256=p84N1ntCHu47O84m48zC8uKFgso3-38yXpPlAjr4IKU,1153
20
+ gtk_stream/documents/classes/ProgressBar.py,sha256=NPJtP3qaKiZUEAYEHZk4FEoWSFn2KVorI2SVb8cDnW0,966
21
+ gtk_stream/documents/classes/Scale.py,sha256=6rW6sBCdpPaqgDEGUPZi5UR8CT3bPmaZQqXXhnl-oaw,1124
22
+ gtk_stream/documents/classes/ScrolledWindow.py,sha256=SIn_AWtE96QcbTHwNAgYqB0qO_KAjxQlZVkqpJjqypE,1045
23
+ gtk_stream/documents/classes/Separator.py,sha256=uw_EgAKs_6pNA8nrOLzruIlJfk4uaogB0p_jeoY0PHM,960
24
+ gtk_stream/documents/classes/Stack.py,sha256=diZyuBLwuCjn_WE3wx5MBgHN_ty6WXSsyIFRVAbe8yI,1572
25
+ gtk_stream/documents/classes/Switch.py,sha256=jQVuxqS9Pmpp1ymB_dbJPxasJNpm4e35ry0JYPHdAsk,1275
26
+ gtk_stream/documents/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ gtk_stream-0.14.dist-info/METADATA,sha256=g_dERboUXNiJSBBJXdE4mftaA4Cfy6NvYUttk_DQE4w,805
28
+ gtk_stream-0.14.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
29
+ gtk_stream-0.14.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
30
+ gtk_stream-0.14.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
31
+ gtk_stream-0.14.dist-info/RECORD,,
@@ -1,31 +0,0 @@
1
- gtk_stream/__init__.py,sha256=y6JLknVFexWrSo_Zl7-TXrPR6EQ5XVMeFO1bUzLN9Lg,98
2
- gtk_stream/_version.py,sha256=nyWjzUs9M1XFc5MLonkyorh4rhe5dHRCj707gnafzf4,413
3
- gtk_stream/application.py,sha256=SpMUuqYyyW056CIa0kQXhMDdI_e69HjsFBa4ihPomvQ,5500
4
- gtk_stream/command_line.py,sha256=g7Sed0ydnDGKyWHT09murwR-3vZyIKXRWgM4Oi0qDE4,3278
5
- gtk_stream/common.py,sha256=2USRh42DmmxtPO1y8gpeU0hMuHfhcqJBPuxtvd46YHg,2112
6
- gtk_stream/parser.py,sha256=lt1cHYwhrd0SwSQfbxtbK6NdwbnFmgeBDIeNY0eepwc,5709
7
- gtk_stream/properties.py,sha256=DCcRCP3REdfWDkPEVUsNHi1b2XxXU5toL3pf_SxmqQ4,4039
8
- gtk_stream/documents/__init__.py,sha256=cMWSmjD2_5oJ2EoSk3Jy9-LPeAGKDIidYNRJvqUzdU8,856
9
- gtk_stream/documents/classes/Box.py,sha256=TIxRLO0_SjRpE3soimHuNE0q4jDbU_BUCpcuspSPAzg,1382
10
- gtk_stream/documents/classes/Button.py,sha256=21bVI7DUWmiusboxdsimTgcqKtLqzQydhS9ifIt4R64,1512
11
- gtk_stream/documents/classes/Document.py,sha256=DWDH4nl0INxXs_z-vTX_z3E3eHC5JeU3lVWhfzW24Pw,2361
12
- gtk_stream/documents/classes/Dropdown.py,sha256=8fIUX1HCWIjUfKLPy9NYsW6OskhkontoNDTsCZ7qKxw,2446
13
- gtk_stream/documents/classes/Entry.py,sha256=KcBwjSu4tI30bQxPlSFSLPxFEUbTaqAdoAzd0XSQciY,1112
14
- gtk_stream/documents/classes/FlowBox.py,sha256=UoVYS2j_osOV-IgbVoaqluTBCiaXus5dq2e9qhAu2Xo,1225
15
- gtk_stream/documents/classes/Frame.py,sha256=zAZvsT-YTZMijsgk7p0YVf6siAmFoCCSXouZo9XDpsA,1222
16
- gtk_stream/documents/classes/Grid.py,sha256=jDJ9U1GJZ45hi1VvPsCwFILN7CwEkgjqYqhTzMdtX9o,1249
17
- gtk_stream/documents/classes/Label.py,sha256=bBNBTvGs6fM8uLf4EDb2Ro8FmCeS27cnU1Ao-44nRYs,1023
18
- gtk_stream/documents/classes/Paned.py,sha256=q1goKJMWBg1d3hS0eanPBxzBqLB-Pz5hUnH9N-RXXh8,1392
19
- gtk_stream/documents/classes/Picture.py,sha256=p84N1ntCHu47O84m48zC8uKFgso3-38yXpPlAjr4IKU,1153
20
- gtk_stream/documents/classes/ProgressBar.py,sha256=NPJtP3qaKiZUEAYEHZk4FEoWSFn2KVorI2SVb8cDnW0,966
21
- gtk_stream/documents/classes/Scale.py,sha256=6rW6sBCdpPaqgDEGUPZi5UR8CT3bPmaZQqXXhnl-oaw,1124
22
- gtk_stream/documents/classes/ScrolledWindow.py,sha256=WaTPgz6GBC-hjH83SQT2OGUdCapHAgO3xEmSMJZ8q70,1041
23
- gtk_stream/documents/classes/Separator.py,sha256=uw_EgAKs_6pNA8nrOLzruIlJfk4uaogB0p_jeoY0PHM,960
24
- gtk_stream/documents/classes/Stack.py,sha256=icg1TOlCD0IFPv_42uMa7jHbEAgEnuELrTEbnTKiPgU,1568
25
- gtk_stream/documents/classes/Switch.py,sha256=jQVuxqS9Pmpp1ymB_dbJPxasJNpm4e35ry0JYPHdAsk,1275
26
- gtk_stream/documents/classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- gtk_stream-0.13.5.dist-info/METADATA,sha256=7ZhZ5bwiZWYtQqLLvnyZQj5Bau96JqoV6VzyojcNAfo,807
28
- gtk_stream-0.13.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
29
- gtk_stream-0.13.5.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
30
- gtk_stream-0.13.5.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
31
- gtk_stream-0.13.5.dist-info/RECORD,,