Use pure python filesystem handling instead of Qt one
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 12 Dec 2008 10:01:54 +0000 (10:01 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 12 Dec 2008 10:01:54 +0000 (10:01 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2015 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/libbertos.py

index 4d8e8c37b544bb08e22e86056829d7d5811771ad..de56cfe6c2c3d3e65105e093c6691d57be841f36 100644 (file)
@@ -9,26 +9,16 @@
 # Author: Lorenzo Berni <duplo@develer.com>
 #
 
-from PyQt4.QtCore import *
+import os
 
 def isBertosDir(directory):
-    version_file = directory + QDir.separator() + "VERSION"
-    qfile = QFile(version_file)
-    return qfile.exists()
+   return os.path.exists(directory + "/VERSION")
 
 def bertosVersion(directory):
-    version_file = directory + QDir.separator() + "VERSION"
-    qfile = QFile(version_file)
-    qfile.open(QIODevice.ReadOnly)
-    file = QTextStream(qfile)
-    version = file.readLine()
-    qfile.close()
-    return version
+   return open(directory + "/VERSION").readline().strip()
 
 def createBertosProject(directory):
-    bertos_directory = directory
-    QDir().mkdir(directory)
-    bertos_project = directory + QDir.separator() + "project.bertos"
-    qfile = QFile(bertos_project)
-    qfile.open(QIODevice.WriteOnly)
-    qfile.close()
\ No newline at end of file
+    if not os.path.isdir(directory):
+        os.mkdir(directory)
+    open(directory + "/project.bertos", "w")
+    
\ No newline at end of file