]> git.nothing2do.fr Git - get-hack-src.git/commitdiff
Fixed `imageicon` to work with Windows
authorallfro <ndouba@gmail.com>
Tue, 12 Mar 2013 17:47:45 +0000 (14:47 -0300)
committerallfro <ndouba@gmail.com>
Tue, 12 Mar 2013 17:47:45 +0000 (14:47 -0300)
src/canari/resource.py

index 982ab01b61eaf42a3b28948fcecb1439ebe28c9f..1667e5801eecdc41279f1c20e47181d90698b505 100644 (file)
@@ -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')