Add libbertos module, a module containing a group of tools for handling bertos sources
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 11 Dec 2008 14:33:19 +0000 (14:33 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 11 Dec 2008 14:33:19 +0000 (14:33 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2006 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/libbertos.py [new file with mode: 0644]

diff --git a/wizard/libbertos.py b/wizard/libbertos.py
new file mode 100644 (file)
index 0000000..5951cea
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# encoding: utf-8
+#
+# Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# $Id:$
+#
+# Author: Lorenzo Berni <duplo@develer.com>
+#
+
+from PyQt4.QtCore import *
+
+def isBertosDir(directory):
+    version_file = directory + QDir.separator() + "VERSION"
+    qfile = QFile(version_file)
+    return qfile.exists()
+
+def bertosVersion(directory):
+    version_file = directory + QDir.separator() + "VERSION"
+    qfile = QFile(version_file)
+    qfile.open(QIODevice.ReadOnly)
+    file = QTextStream(qfile)
+    return file.readLine()
\ No newline at end of file