eric6/Globals/AppInfo.py

changeset 6942
2602857055c5
parent 6645
ad476851d7e0
child 7229
53054eb5b15a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric6/Globals/AppInfo.py	Sun Apr 14 15:09:21 2019 +0200
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2012 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing a function to generate an application info.
+"""
+
+from __future__ import unicode_literals
+
+from UI.Info import Version
+
+
+def makeAppInfo(argv, name, arg, description, options=None):
+    """
+    Module function to generate a dictionary describing the application.
+    
+    @param argv list of commandline parameters (list of strings)
+    @param name name of the application (string)
+    @param arg commandline arguments (string)
+    @param description text describing the application (string)
+    @param options list of additional commandline options
+        (list of tuples of two strings (commandline option,
+        option description)). The options --version, --help and -h are
+        always present and must not be repeated in this list.
+    @return dictionary describing the application
+    """
+    return {
+        "bin": argv[0],
+        "arg": arg,
+        "name": name,
+        "description": description,
+        "version": Version,
+        "options": [] if options is None else options[:]
+    }

eric ide

mercurial