mailr17517 - /trunk/graphics/__init__.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on September 19, 2012 - 18:41:
Author: bugman
Date: Wed Sep 19 18:41:08 2012
New Revision: 17517

URL: http://svn.gna.org/viewcvs/relax?rev=17517&view=rev
Log:
The graphics.fetch_icon() function argument 'format' can now be set to None.

This will return the file path without the extension.


Modified:
    trunk/graphics/__init__.py

Modified: trunk/graphics/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/graphics/__init__.py?rev=17517&r1=17516&r2=17517&view=diff
==============================================================================
--- trunk/graphics/__init__.py (original)
+++ trunk/graphics/__init__.py Wed Sep 19 18:41:08 2012
@@ -50,7 +50,7 @@
     @type icon:         str
     @keyword size:      The icon size to fetch.
     @type size:         str
-    @keyword format:    The format of the icon, defaulting to PNG images.  
This can be changed to 'eps.gz' for example.
+    @keyword format:    The format of the icon, defaulting to PNG images.  
This can be changed to 'eps.gz' for example, or None for no file ending.
     @type format:       str
     @return:            The icon path, for example 
'oxygen_icons/16x16/actions/document-open.png'.
     @rtype:             str
@@ -82,7 +82,9 @@
         path += elements[1] + sep
 
     # The file.
-    if format == 'png':
+    if format == None:
+        path = elements[-1]
+    elif format == 'png':
         path += "%s.png" % elements[-1]
     elif format == 'eps.gz':
         path += "%s.eps.gz" % elements[-1]




Related Messages


Powered by MHonArc, Updated Wed Sep 19 19:20:02 2012