From bf2041551576861439b6be6438b5c0f65fcbf361 Mon Sep 17 00:00:00 2001 From: allfro Date: Tue, 12 Mar 2013 14:47:45 -0300 Subject: [PATCH] Fixed `imageicon` to work with Windows --- src/canari/resource.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/canari/resource.py b/src/canari/resource.py index 982ab01..1667e58 100644 --- a/src/canari/resource.py +++ b/src/canari/resource.py @@ -19,7 +19,10 @@ etc = 'canari.resources.etc' def imageicon(pkg, name): - return 'file://%s' % resource_filename(pkg, name) + name = resource_filename(pkg, name)) + if name[0] != '/': + return 'file:///%s' % name + return 'file://%s' % name def imagepath(pkg, name): @@ -45,4 +48,4 @@ def icon_resource(name, pkg=None): # etc -conf = resource_filename(etc, 'canari.conf') \ No newline at end of file +conf = resource_filename(etc, 'canari.conf') -- 2.45.1