mailr20649 - in /branches/relax_disp: ./ docs/latex/fetch_docstrings.py graphics/__init__.py


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

Header


Content

Posted by edward on August 20, 2013 - 21:16:
Author: bugman
Date: Tue Aug 20 21:16:37 2013
New Revision: 20649

URL: http://svn.gna.org/viewcvs/relax?rev=20649&view=rev
Log:
Merged revisions 20647-20648 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r20647 | bugman | 2013-08-20 21:13:35 +0200 (Tue, 20 Aug 2013) | 5 lines
  
  The graphics.fetch_icon() function can now return either the absolute or 
relative path to the icon.
  
  This is a partial solution for bug #21042 (https://gna.org/bugs/?21042).
........
  r20648 | bugman | 2013-08-20 21:15:14 +0200 (Tue, 20 Aug 2013) | 6 lines
  
  Fix for bug #21042 (https://gna.org/bugs/?21042).
  
  The docs/latex/fetch_docstrings.py now asks the graphics.fetch_icon() 
function for the relative path
  to the icon rather than the absolute path.
........

Modified:
    branches/relax_disp/   (props changed)
    branches/relax_disp/docs/latex/fetch_docstrings.py
    branches/relax_disp/graphics/__init__.py

Propchange: branches/relax_disp/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Aug 20 21:16:37 2013
@@ -1,1 +1,1 @@
-/trunk:1-20639
+/trunk:1-20648

Modified: branches/relax_disp/docs/latex/fetch_docstrings.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/docs/latex/fetch_docstrings.py?rev=20649&r1=20648&r2=20649&view=diff
==============================================================================
--- branches/relax_disp/docs/latex/fetch_docstrings.py (original)
+++ branches/relax_disp/docs/latex/fetch_docstrings.py Tue Aug 20 21:16:37 
2013
@@ -258,14 +258,14 @@
 
         # Add the user function class icon.
         if self.uf_class:
-            icon = fetch_icon(self.uf_class.gui_icon, size='128x128', 
format=None)
+            icon = fetch_icon(self.uf_class.gui_icon, size='128x128', 
format=None, full_path=False)
             if icon:
                 self.file.write("\includegraphics[bb=0 0 18 18]{%s} \hfill " 
% icon)
             else:
                 self.file.write("\hfill ")
 
         # Add the user function icon.
-        icon = fetch_icon(self.uf.gui_icon, size='128x128', format=None)
+        icon = fetch_icon(self.uf.gui_icon, size='128x128', format=None, 
full_path=False)
         if icon:
             self.file.write("\includegraphics[bb=0 0 18 18]{%s}\n" % icon)
         else:

Modified: branches/relax_disp/graphics/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/graphics/__init__.py?rev=20649&r1=20648&r2=20649&view=diff
==============================================================================
--- branches/relax_disp/graphics/__init__.py (original)
+++ branches/relax_disp/graphics/__init__.py Tue Aug 20 21:16:37 2013
@@ -35,7 +35,7 @@
 WIZARD_IMAGE_PATH = status.install_path + sep + 'graphics' + sep + 'wizards' 
+ sep
 
 
-def fetch_icon(icon=None, size='16x16', format='png'):
+def fetch_icon(icon=None, size='16x16', format='png', full_path=True):
     """Return the path to the specified icon.
 
     The icon code consists of two parts separated by the '.' character.  
These are:
@@ -51,6 +51,8 @@
     @type size:         str
     @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
+    @keyword full_path: A flag which if True will cause the absolute path to 
be returned.  If False, the relative path will be returned.
+    @type full_path:    bool
     @return:            The icon path, for example 
'oxygen_icons/16x16/actions/document-open.png'.
     @rtype:             str
     """
@@ -60,7 +62,10 @@
         return None
 
     # Initialise the path.
-    path = status.install_path + sep + 'graphics' + sep
+    path = ''
+    if full_path:
+        path += status.install_path + sep
+    path += 'graphics' + sep
 
     # Split up the icon code.
     elements = icon.split('.')




Related Messages


Powered by MHonArc, Updated Tue Aug 20 22:00:02 2013