Author: bugman Date: Fri May 4 11:40:08 2012 New Revision: 15961 URL: http://svn.gna.org/viewcvs/relax?rev=15961&view=rev Log: The graphics.fetch_icon() function now returns None if no icon is specified. Modified: branches/uf_redesign/graphics/__init__.py Modified: branches/uf_redesign/graphics/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/graphics/__init__.py?rev=15961&r1=15960&r2=15961&view=diff ============================================================================== --- branches/uf_redesign/graphics/__init__.py (original) +++ branches/uf_redesign/graphics/__init__.py Fri May 4 11:40:08 2012 @@ -28,7 +28,7 @@ from string import split -def fetch_icon(icon, size='16x16'): +def fetch_icon(icon=None, size='16x16'): """Return the path to the specified icon. The icon code consists of two parts separated by the '.' character. These are: @@ -38,13 +38,17 @@ To specify the 'graphics/oxygen_icons/16x16/actions/document-open.png' icon, the icon code string would therefore be 'oxygen.actions.document-open'. - @param icon: The special icon code. + @keyword icon: The special icon code. @type icon: str @keyword size: The icon size to fetch. @type size: str @return: The icon path, for example 'oxygen_icons/16x16/actions/document-open.png'. @rtype: str """ + + # No icon. + if icon == None: + return None # Initialise the path. path = 'graphics' + sep