Преглед изворни кода

wxGUI: attempt to fix https://trac.osgeo.org/grass/ticket/1554

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54921 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová пре 12 година
родитељ
комит
d75ec4a199
1 измењених фајлова са 5 додато и 3 уклоњено
  1. 5 3
      gui/wxpython/psmap/frame.py

+ 5 - 3
gui/wxpython/psmap/frame.py

@@ -317,7 +317,8 @@ class PsMapFrame(wx.Frame):
 
                 # hack for Windows, change method for loading EPS
                 if sys.platform == 'win32':
-                    im.load = loadPSForWindows(im)
+                    import types
+                    im.load = types.MethodType(loadPSForWindows, im)
                 im.save(self.imgName, format = 'PNG')
                 
             except IOError, e:
@@ -2188,7 +2189,7 @@ def GhostscriptForWindows(tile, size, fp):
 
     import tempfile, os
 
-    file = tempfile.mktemp()
+    file = tempfile.mkstemp()[1]
 
     # Build ghostscript command - for Windows
     command = ["gswin32c",
@@ -2217,7 +2218,8 @@ def GhostscriptForWindows(tile, size, fp):
         status = gs.close()
         if status:
             raise IOError("gs failed (status %d)" % status)
-        im = Image.core.open_ppm(file)
+        im = PILImage.core.open_ppm(file)
+
     finally:
         try: os.unlink(file)
         except: pass