Browse Source

small updates

including restructure of version file
Patrick Schreiber 8 years ago
parent
commit
bbf7b67dfb
5 changed files with 23 additions and 10 deletions
  1. 1 4
      KCG/VERSION
  2. 2 2
      KCG/base/kcg.py
  3. 16 3
      KCG/kcg.py
  4. 1 0
      MANIFEST.in
  5. 3 1
      setup.py

+ 1 - 4
KCG/VERSION

@@ -1,4 +1 @@
-Version: 0.2.3
-Build: 148.0302
-
-NOTE: this program is still in beta state and may have bugs
+0.2.3.148.0302-beta

+ 2 - 2
KCG/base/kcg.py

@@ -323,13 +323,13 @@ class Gui(QtGui.QMainWindow):
         Show the about window.
         :return: -
         """
-        version = open("KCG/VERSION").read()
+        version = open(config.install_path+"VERSION").read()
         about = QtGui.QDialog(self) # TODO: read about text externally? read version externally?
         about.setWindowTitle("KCG - About")
         about_label = QtGui.QLabel(tr("About", "KAPTURE Control Gui\n"
                                       "KCG is a graphical control interface to the KAPTURE board\n\n"
                                       "Author: Patrick Schreiber\n\n"
-                                      )+version)
+                                      "Version:\n")+version)
         about_label.setAlignment(QtCore.Qt.AlignCenter)
         header_label = QtGui.QLabel(tr("About", "KCG"))
         header_label.setStyleSheet("font-size: 25pt; text-align: center;")

+ 16 - 3
KCG/kcg.py

@@ -31,6 +31,19 @@ except ImportError:
     pass
 
 
+def print_version(verbose=False):
+    # print "KCG - KAPTURE Control Gui"
+    # print "=" * 30
+    print "KCG",
+    with open(config.install_path+'VERSION', 'r') as v:
+        print v.read().strip()
+    if verbose:
+        print "=" * 30
+        print "Using Python:"
+        print sys.version
+        print "=" * 30
+        print "From: " + config.install_path
+
 
 def run():
     """
@@ -41,12 +54,12 @@ def run():
     parser.add_argument('--config', type=str, default='', help='Override Configuration file settings.'
                         'Format: "Section:setting=content;Section:setting2=content;Section2:setting3=content" etc.')
     parser.add_argument('--version', action='store_true', help="Print Version and exit")
+    parser.add_argument('--vversion', action='store_true', help="Print Version verbose and exit")
     parser.add_argument('--testing', action='store_true', default=False,
                         help="start KCG in testing version. DO NOT USE THIS IN PRODUCTION.")
     args = parser.parse_args()
-    if args.version:
-        with open('KCG/VERSION', 'r') as v:
-            print v.read()
+    if args.version or args.vversion:
+        print_version(args.vversion)
         sys.exit()
 
     kcgw.testing = args.testing

+ 1 - 0
MANIFEST.in

@@ -3,4 +3,5 @@ recursive-include KCG/icons *
 recursive-include KCG/lang *
 recursive-include KCG/style *
 include KCG/config.cfg
+include KCG/VERSION
 

+ 3 - 1
setup.py

@@ -5,7 +5,7 @@ DESCRIPTION = "KCG KAPTURE Control Gui"
 
 setup(
     name='KCG',
-    version='1.0.1',
+    version='0.2.3.148.0302-beta',
     author='Patrick Schreiber',
     author_email='uldfk@student.kit.edu',
 #    license='GPL',
@@ -24,3 +24,5 @@ setup(
     },
 )
 
+
+