gtk-stream 0.11.1__tar.gz → 0.11.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/PKG-INFO +1 -1
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/_version.py +2 -2
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/command_line.py +28 -11
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Picture.py +5 -6
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/properties.py +4 -1
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream.egg-info/PKG-INFO +1 -1
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/README.md +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk-stream +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/__init__.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/application.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/common.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/__init__.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Box.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Button.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Document.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Dropdown.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Entry.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/FlowBox.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Frame.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Grid.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Label.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Paned.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/ProgressBar.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Scale.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/ScrolledWindow.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Separator.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Stack.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/Switch.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/documents/classes/__init__.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream/parser.py +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream.egg-info/SOURCES.txt +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream.egg-info/dependency_links.txt +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream.egg-info/entry_points.txt +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream.egg-info/requires.txt +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/gtk_stream.egg-info/top_level.txt +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/pyproject.toml +0 -0
- {gtk_stream-0.11.1 → gtk_stream-0.11.2}/setup.cfg +0 -0
@@ -18,10 +18,11 @@ import io
|
|
18
18
|
import xml.sax as sax
|
19
19
|
import sys
|
20
20
|
import os
|
21
|
+
import argparse
|
21
22
|
|
22
23
|
from .parser import GtkStreamXMLHandler
|
23
24
|
from .common import Logger, LogLevel
|
24
|
-
from . import GLib
|
25
|
+
from . import GLib, Gtk, Gdk
|
25
26
|
|
26
27
|
logLevel = LogLevel.__dict__.get(os.environ.get('GTK_STREAM_LOGLEVEL', 'WARN'), LogLevel.WARN)
|
27
28
|
|
@@ -34,13 +35,29 @@ class GtkStreamErrorHandler(sax.handler.ErrorHandler):
|
|
34
35
|
raise exc
|
35
36
|
|
36
37
|
def main():
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
parser = argparse.ArgumentParser(
|
39
|
+
prog='gtk-stream',
|
40
|
+
description='A stream-based GUI tool',
|
41
|
+
add_help=False
|
42
|
+
)
|
43
|
+
parser.add_argument('--list-icons', action='store_true')
|
44
|
+
parser.add_argument('-h', '--help', action='store_true')
|
45
|
+
args = parser.parse_args()
|
46
|
+
|
47
|
+
if args.help:
|
48
|
+
parser.print_help()
|
49
|
+
elif args.list_icons:
|
50
|
+
theme = Gtk.IconTheme.get_for_display(Gdk.Display.get_default())
|
51
|
+
for name in theme.get_icon_names():
|
52
|
+
print(name)
|
53
|
+
else:
|
54
|
+
handler = GtkStreamXMLHandler(logger)
|
55
|
+
errHandler = GtkStreamErrorHandler()
|
56
|
+
parser = sax.make_parser()
|
57
|
+
parser.setContentHandler(handler)
|
58
|
+
parser.setErrorHandler(errHandler)
|
59
|
+
try:
|
60
|
+
parser.parse(io.FileIO(0, 'r', closefd=False))
|
61
|
+
except Exception as e:
|
62
|
+
logger.error("Done with exception : %s", e)
|
63
|
+
handler.quit_application()
|
@@ -20,16 +20,15 @@ from .. import Document
|
|
20
20
|
|
21
21
|
class Picture(Document):
|
22
22
|
__g_class__ = Gtk.Picture
|
23
|
-
def __init__(self, app,
|
23
|
+
def __init__(self, app, **kwargs):
|
24
24
|
super().__init__(app, **kwargs)
|
25
|
-
self.src = src
|
26
25
|
def render_raw(self):
|
27
|
-
return Gtk.Picture
|
26
|
+
return Gtk.Picture()
|
28
27
|
|
29
28
|
class Icon(Document):
|
30
29
|
__g_class__ = Gtk.Image
|
31
|
-
def __init__(self, app,
|
30
|
+
def __init__(self, app, **kwargs):
|
32
31
|
super().__init__(app, **kwargs)
|
33
|
-
self.src = src
|
34
32
|
def render_raw(self):
|
35
|
-
return Gtk.Image
|
33
|
+
return Gtk.Image()
|
34
|
+
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
import sys
|
18
18
|
|
19
|
-
from . import Gtk
|
19
|
+
from . import Gtk, Gio
|
20
20
|
|
21
21
|
def _const(x):
|
22
22
|
return lambda _: x
|
@@ -53,6 +53,8 @@ def _parse_widget_property(val):
|
|
53
53
|
return lambda app: app.namedWidgets[val]
|
54
54
|
def _parse_window_property(val):
|
55
55
|
return lambda app: app.namedWindows[val]
|
56
|
+
def _parse_gfile_property(val):
|
57
|
+
return _const(Gio.File.new_for_path(val))
|
56
58
|
|
57
59
|
_PARSE_TYPE_PROPERTY = {
|
58
60
|
'GStrv' : _parse_css_classes_property,
|
@@ -66,6 +68,7 @@ _PARSE_TYPE_PROPERTY = {
|
|
66
68
|
'GtkWindow' : _parse_window_property,
|
67
69
|
'GtkAdjustment' : _parse_adjustment_property,
|
68
70
|
'gchararray' : _const,
|
71
|
+
'GFile' : _parse_gfile_property,
|
69
72
|
}
|
70
73
|
|
71
74
|
def parse_property(prop_type, val):
|
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
|
File without changes
|
File without changes
|