summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2012-04-25 20:21:19 +0200
committerMichael Buesch <m@bues.ch>2012-04-25 20:21:19 +0200
commitc8edb8fd0b558fefbc181aea301e147262a3e8aa (patch)
treec42561e7b2ec0247066754c1a890fa2d1a10d1b4
parent91ae49d11a7ea26434fc169f724944f722ac3d37 (diff)
downloadtoprammer-c8edb8fd0b558fefbc181aea301e147262a3e8aa.tar.xz
toprammer-c8edb8fd0b558fefbc181aea301e147262a3e8aa.zip
Use open() instead of file()
Signed-off-by: Michael Buesch <m@bues.ch>
-rwxr-xr-xreverse-engineering/dump-parser.py2
-rwxr-xr-xtoprammer8
-rwxr-xr-xtoprammer-gui6
3 files changed, 8 insertions, 8 deletions
diff --git a/reverse-engineering/dump-parser.py b/reverse-engineering/dump-parser.py
index 85735f0..916fb86 100755
--- a/reverse-engineering/dump-parser.py
+++ b/reverse-engineering/dump-parser.py
@@ -196,7 +196,7 @@ def main(argv):
usage()
return 1
- fd = file(argv[1])
+ fd = open(argv[1])
parseDumpFile(fd)
return 0
diff --git a/toprammer b/toprammer
index 2c1c7f8..dab17fb 100755
--- a/toprammer
+++ b/toprammer
@@ -89,19 +89,19 @@ IO_handlers = {
"ahex" : IO_ahex,
}
-def fileOut(filename, format, data):
- handler = IO_handlers[format]()
+def fileOut(filename, fmtString, data):
+ handler = IO_handlers[fmtString]()
data = handler.fromBinary(data)
if filename == "-":
sys.stdout.write(data)
else:
- file(filename, "w+b").write(data)
+ open(filename, "w+b").write(data)
def fileIn(filename, fmtString):
if filename == "-":
data = sys.stdin.read()
else:
- data = file(filename, "rb").read()
+ data = open(filename, "rb").read()
if fmtString == "auto":
handler = IO_autodetect(data)()
else:
diff --git a/toprammer-gui b/toprammer-gui
index 5fe49f8..e599918 100755
--- a/toprammer-gui
+++ b/toprammer-gui
@@ -451,7 +451,7 @@ class UnitestDialog(QDialog):
def __saveFile(self, filename):
try:
- fd = file(filename, "w+b")
+ fd = open(filename, "w+b")
fd.write("[TOPRAMMER-UNITEST-SETTINGS]\r\n")
fd.write("fileVersion=%d\r\n" % 1)
@@ -2244,7 +2244,7 @@ class MainWindow(QMainWindow):
extensions = str(selectedFilter).split("(")[1].\
split(")")[0].replace("*", "").strip().split()
try:
- data = file(fn, "rb").read()
+ data = open(fn, "rb").read()
except (IOError), e:
QMessageBox.critical(self, "Failed to read file",
"Failed to read %s:\n%s" %\
@@ -2301,7 +2301,7 @@ class MainWindow(QMainWindow):
else:
assert(0)
try:
- file(fn, "wb").write(data)
+ open(fn, "wb").write(data)
except (IOError), e:
QMessageBox.critical(self, "Failed to write file",
"Failed to write %s:\n%s" %\
bues.ch cgit interface