gtk-stream 0.13.2__py3-none-any.whl → 0.13.4__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 +2 -2
- gtk_stream/common.py +6 -6
- gtk_stream/documents/classes/Document.py +3 -3
- gtk_stream/parser.py +2 -2
- {gtk_stream-0.13.2.dist-info → gtk_stream-0.13.4.dist-info}/METADATA +1 -1
- {gtk_stream-0.13.2.dist-info → gtk_stream-0.13.4.dist-info}/RECORD +10 -10
- {gtk_stream-0.13.2.dist-info → gtk_stream-0.13.4.dist-info}/WHEEL +0 -0
- {gtk_stream-0.13.2.dist-info → gtk_stream-0.13.4.dist-info}/entry_points.txt +0 -0
- {gtk_stream-0.13.2.dist-info → gtk_stream-0.13.4.dist-info}/top_level.txt +0 -0
gtk_stream/_version.py
CHANGED
gtk_stream/application.py
CHANGED
@@ -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:
|
@@ -117,7 +117,7 @@ class GtkStreamApp(Gtk.Application):
|
|
117
117
|
set_parse_prop(self, win, attr_name, attr_val)
|
118
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)
|
gtk_stream/common.py
CHANGED
@@ -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
|
|
gtk_stream/parser.py
CHANGED
@@ -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()
|
@@ -1,14 +1,14 @@
|
|
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=dhPsd2j9Al5Z6JN-zXmB6-Uti2Ily2tvtEtKPTNHaCQ,413
|
3
|
+
gtk_stream/application.py,sha256=SpMUuqYyyW056CIa0kQXhMDdI_e69HjsFBa4ihPomvQ,5500
|
4
4
|
gtk_stream/command_line.py,sha256=g7Sed0ydnDGKyWHT09murwR-3vZyIKXRWgM4Oi0qDE4,3278
|
5
|
-
gtk_stream/common.py,sha256=
|
6
|
-
gtk_stream/parser.py,sha256=
|
5
|
+
gtk_stream/common.py,sha256=2USRh42DmmxtPO1y8gpeU0hMuHfhcqJBPuxtvd46YHg,2112
|
6
|
+
gtk_stream/parser.py,sha256=lt1cHYwhrd0SwSQfbxtbK6NdwbnFmgeBDIeNY0eepwc,5709
|
7
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
|
11
|
-
gtk_stream/documents/classes/Document.py,sha256=
|
11
|
+
gtk_stream/documents/classes/Document.py,sha256=DWDH4nl0INxXs_z-vTX_z3E3eHC5JeU3lVWhfzW24Pw,2361
|
12
12
|
gtk_stream/documents/classes/Dropdown.py,sha256=8fIUX1HCWIjUfKLPy9NYsW6OskhkontoNDTsCZ7qKxw,2446
|
13
13
|
gtk_stream/documents/classes/Entry.py,sha256=KcBwjSu4tI30bQxPlSFSLPxFEUbTaqAdoAzd0XSQciY,1112
|
14
14
|
gtk_stream/documents/classes/FlowBox.py,sha256=UoVYS2j_osOV-IgbVoaqluTBCiaXus5dq2e9qhAu2Xo,1225
|
@@ -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.
|
28
|
-
gtk_stream-0.13.
|
29
|
-
gtk_stream-0.13.
|
30
|
-
gtk_stream-0.13.
|
31
|
-
gtk_stream-0.13.
|
27
|
+
gtk_stream-0.13.4.dist-info/METADATA,sha256=FwxFr2wA1vXjuof9IuCzzOYUP94_tJpEvJ55V43r-YE,807
|
28
|
+
gtk_stream-0.13.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
29
|
+
gtk_stream-0.13.4.dist-info/entry_points.txt,sha256=PmhKTb4MMQM6dN2HJcoDSMI8L0lZIFIlFn-BgdfPDpo,60
|
30
|
+
gtk_stream-0.13.4.dist-info/top_level.txt,sha256=vE9zfHGe9Ke7FSe0wBK2WYJI-BpcQNu6xDC3Cu5O8rQ,11
|
31
|
+
gtk_stream-0.13.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|