From: duplo Date: Fri, 12 Dec 2008 10:01:54 +0000 (+0000) Subject: Use pure python filesystem handling instead of Qt one X-Git-Tag: 2.1.0~667 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d3cf455fdea82915a673070650d1d45e12e8af87;p=bertos.git Use pure python filesystem handling instead of Qt one git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2015 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/libbertos.py b/wizard/libbertos.py index 4d8e8c37..de56cfe6 100644 --- a/wizard/libbertos.py +++ b/wizard/libbertos.py @@ -9,26 +9,16 @@ # Author: Lorenzo Berni # -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