[GRASS-SVN] r43172 - in grass/trunk/gui/wxpython: gui_modules images

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 20 19:00:26 EDT 2010


Author: glynn
Date: 2010-08-20 23:00:26 +0000 (Fri, 20 Aug 2010)
New Revision: 43172

Added:
   grass/trunk/gui/wxpython/images/small_down_arrow.png
   grass/trunk/gui/wxpython/images/small_up_arrow.png
Modified:
   grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
Log:
Move images out of source code into image files


Modified: grass/trunk/gui/wxpython/gui_modules/gcpmanager.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-08-20 22:57:47 UTC (rev 43171)
+++ grass/trunk/gui/wxpython/gui_modules/gcpmanager.py	2010-08-20 23:00:26 UTC (rev 43172)
@@ -62,6 +62,8 @@
 gmpath = os.path.join(globalvar.ETCWXDIR, "icons")
 sys.path.append(gmpath)
 
+imgpath = os.path.join(globalvar.ETCWXDIR, "images")
+
 #
 # global variables
 #
@@ -73,31 +75,22 @@
 tgt_map = ''
 maptype = 'cell'
 
-def getSmallUpArrowData():
-    return \
-'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\
-\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\
-\x00\x00<IDAT8\x8dcddbf\xa0\x040Q\xa4{h\x18\xf0\xff\xdf\xdf\xffd\x1b\x00\xd3\
-\x8c\xcf\x10\x9c\x06\xa0k\xc2e\x08m\xc2\x00\x97m\xd8\xc41\x0c \x14h\xe8\xf2\
-\x8c\xa3)q\x10\x18\x00\x00R\xd8#\xec\xb2\xcd\xc1Y\x00\x00\x00\x00IEND\xaeB`\
-\x82' 
-
 def getSmallUpArrowImage():
-    stream = cStringIO.StringIO(getSmallUpArrowData())
-    return wx.ImageFromStream(stream)
+    stream = open(os.path.join(imgpath, 'small_up_arrow.png'), 'rb')
+    try:
+        img = wx.ImageFromStream(stream)
+    finally:
+        stream.close()
+    return img
 
-def getSmallDnArrowData():
-    return \
-"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\
-\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\
-\x00\x00HIDAT8\x8dcddbf\xa0\x040Q\xa4{\xd4\x00\x06\x06\x06\x06\x06\x16t\x81\
-\xff\xff\xfe\xfe'\xa4\x89\x91\x89\x99\x11\xa7\x0b\x90%\ti\xc6j\x00>C\xb0\x89\
-\xd3.\x10\xd1m\xc3\xe5*\xbc.\x80i\xc2\x17.\x8c\xa3y\x81\x01\x00\xa1\x0e\x04e\
-?\x84B\xef\x00\x00\x00\x00IEND\xaeB`\x82" 
-
 def getSmallDnArrowImage():
-    stream = cStringIO.StringIO(getSmallDnArrowData())
-    return wx.ImageFromStream(stream)
+    stream = open(os.path.join(imgpath, 'small_down_arrow.png'), 'rb')
+    try:
+        img = wx.ImageFromStream(stream)
+    finally:
+        stream.close()
+    stream.close()
+    return img
 
 class GCPWizard(object):
     """

Added: grass/trunk/gui/wxpython/images/small_down_arrow.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/wxpython/images/small_down_arrow.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: grass/trunk/gui/wxpython/images/small_up_arrow.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/wxpython/images/small_up_arrow.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream



More information about the grass-commit mailing list