From eabe4af0a34f5535806f0ea0dbbe04c5e53d79aa Mon Sep 17 00:00:00 2001 From: Rael Date: Thu, 22 Oct 2015 15:58:19 -0200 Subject: Moving version info to external file --- scudcloud-1.0/VERSION | 1 + scudcloud-1.0/debian/install | 1 + scudcloud-1.0/scudcloud | 7 +++---- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 scudcloud-1.0/VERSION diff --git a/scudcloud-1.0/VERSION b/scudcloud-1.0/VERSION new file mode 100644 index 0000000..8bdc532 --- /dev/null +++ b/scudcloud-1.0/VERSION @@ -0,0 +1 @@ +1.0.85 diff --git a/scudcloud-1.0/debian/install b/scudcloud-1.0/debian/install index 9309933..aa6e8be 100644 --- a/scudcloud-1.0/debian/install +++ b/scudcloud-1.0/debian/install @@ -1,4 +1,5 @@ LICENSE opt/scudcloud +VERSION opt/scudcloud lib/*.py opt/scudcloud/lib resources/* opt/scudcloud/resources scudcloud opt/scudcloud diff --git a/scudcloud-1.0/scudcloud b/scudcloud-1.0/scudcloud index 6b7498f..734350c 100755 --- a/scudcloud-1.0/scudcloud +++ b/scudcloud-1.0/scudcloud @@ -14,12 +14,11 @@ from scudcloud import ScudCloud # The ScudCloud QMainWindow win = None -VERSION = '1.0.85' - def main(): global win Resources.INSTALL_DIR = INSTALL_DIR signal.signal(signal.SIGINT, exit) + args = parse_arguments() appKey = "scudcloud.pid" socket = QLocalSocket() socket.connectToServer(appKey) @@ -31,7 +30,6 @@ def main(): app = QtGui.QApplication(sys.argv) app.setApplicationName(Resources.APP_NAME) app.setWindowIcon(QtGui.QIcon(Resources.get_path('scudcloud.png'))) - args = parse_arguments() ScudCloud.debug = args.debug ScudCloud.minimized = True if args.minimized is True else None ScudCloud.plugins = False if args.no_plugins is True else True @@ -79,7 +77,8 @@ def parse_arguments(): parser.add_argument('--version', action="store_true", help="print version and exit") args = parser.parse_args() if args.version: - print("ScudCloud "+VERSION) + with open(os.path.join(Resources.INSTALL_DIR, 'VERSION'), "r") as f: + print("ScudCloud "+f.read()) sys.exit() args.confdir = expanduser(args.confdir) return args -- cgit v1.1