소스 검색

d.correlate: fix for Python 3 (#1149)

Nikos Alexandris 4 년 전
부모
커밋
7f212fc320
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      scripts/d.correlate/d.correlate.py

+ 4 - 4
scripts/d.correlate/d.correlate.py

@@ -67,12 +67,12 @@ def main():
                                     stdin="%s %s" % (i, j))
                                     stdin="%s %s" % (i, j))
                 line += 1
                 line += 1
 
 
-                ofile = file(tmpfile, 'w')
+                ofile = open(tmpfile, 'w')
                 gcore.run_command('r.stats', flags='cnA', input=(i, j),
                 gcore.run_command('r.stats', flags='cnA', input=(i, j),
                                   stdout=ofile)
                                   stdout=ofile)
                 ofile.close()
                 ofile.close()
 
 
-                ifile = file(tmpfile, 'r')
+                ifile = open(tmpfile, 'r')
                 first = True
                 first = True
                 for l in ifile:
                 for l in ifile:
                     f = l.rstrip('\r\n').split(' ')
                     f = l.rstrip('\r\n').split(' ')
@@ -98,12 +98,12 @@ def main():
                 p = gcore.feed_command('d.graph', color=color)
                 p = gcore.feed_command('d.graph', color=color)
                 ofile = p.stdin
                 ofile = p.stdin
 
 
-                ifile = file(tmpfile, 'r')
+                ifile = open(tmpfile, 'r')
                 for l in ifile:
                 for l in ifile:
                     f = l.rstrip('\r\n').split(' ')
                     f = l.rstrip('\r\n').split(' ')
                     x = float(f[0])
                     x = float(f[0])
                     y = float(f[1])
                     y = float(f[1])
-                    ofile.write("icon + 0.1 %f %f\n" % ((x - minx + 1) * kx,
+                    ofile.write(b"icon + 0.1 %f %f\n" % ((x - minx + 1) * kx,
                                                         (y - miny + 1) * ky))
                                                         (y - miny + 1) * ky))
                 ifile.close()
                 ifile.close()