[pytango] 53/98: Use entry points instead of scripts for itango

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:17:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

sbodomerle-guest pushed a commit to tag v9.2.0
in repository pytango.

commit d2673cfc235f71bb50ebf297ad3a5333b4c6fbf6
Author: Vincent Michel <vincent.michel at maxlab.lu.se>
Date:   Thu Jun 16 19:03:31 2016 +0200

    Use entry points instead of scripts for itango
---
 scripts/itango  | 27 ---------------------------
 scripts/itango3 | 27 ---------------------------
 setup.py        | 17 +++++++++++++----
 3 files changed, 13 insertions(+), 58 deletions(-)

diff --git a/scripts/itango b/scripts/itango
deleted file mode 100755
index 0692811..0000000
--- a/scripts/itango
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-
-# ------------------------------------------------------------------------------
-# This file is part of PyTango (http://www.tinyurl.com/PyTango)
-#
-# Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain
-# Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France
-#
-# Distributed under the terms of the GNU Lesser General Public License,
-# either version 3 of the License, or (at your option) any later version.
-# See LICENSE.txt for more info.
-# ------------------------------------------------------------------------------
-
-"""The itango startup file. This executable is actually an extension of the 
-   ipython file that can be found in <prefix>/ipython (prefix usually being in 
-   linux '/usr/bin'"""
-
-__all__ = [ "main" ]
-
-__docformat__ = 'restructuredtext'
-    
-def main():
-    import PyTango.ipython
-    PyTango.ipython.run()
-    
-if __name__ == '__main__':
-    main()
diff --git a/scripts/itango3 b/scripts/itango3
deleted file mode 100755
index 23a28e7..0000000
--- a/scripts/itango3
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python3
-
-# ------------------------------------------------------------------------------
-# This file is part of PyTango (http://www.tinyurl.com/PyTango)
-#
-# Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain
-# Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France
-#
-# Distributed under the terms of the GNU Lesser General Public License,
-# either version 3 of the License, or (at your option) any later version.
-# See LICENSE.txt for more info.
-# ------------------------------------------------------------------------------
-
-"""The itango startup file. This executable is actually an extension of the
-   ipython file that can be found in <prefix>/ipython (prefix usually being in
-   linux '/usr/bin'"""
-
-__all__ = [ "main" ]
-
-__docformat__ = 'restructuredtext'
-
-def main():
-    import PyTango.ipython
-    PyTango.ipython.run()
-
-if __name__ == '__main__':
-    main()
diff --git a/setup.py b/setup.py
index 9c7c8a4..04f7c17 100644
--- a/setup.py
+++ b/setup.py
@@ -123,11 +123,17 @@ def has_numpy(with_src=True):
 
 
 def get_script_files():
-    major = int(platform.python_version_tuple()[0])
-    scripts = ['scripts/itango3' if major == 3 else 'scripts/itango']
     if os.name == "nt":
-        scripts.append("scripts/pytango_winpostinstall.py")
-    return scripts
+        return ["scripts/pytango_winpostinstall.py"]
+    return []
+
+
+def get_entry_points():
+    major = int(platform.python_version_tuple()[0])
+    itango = 'itango3' if major == 3 else 'itango'
+    return {
+        "console_scripts": ["{0} = PyTango.ipython:run".format(itango)],
+        "gui_scripts": ["itango-qt = PyTango.ipython:run_qt"]}
 
 
 def add_lib(name, dirs, sys_libs, env_name=None, lib_name=None, inc_suffix=None):
@@ -408,6 +414,8 @@ def setup_args():
 
     scripts = get_script_files()
 
+    entry_points = get_entry_points()
+
     data_files = []
     if os.name == 'nt':
         data_files.append(('scripts', ['doc/_static/itango.ico']))
@@ -502,6 +510,7 @@ def setup_args():
         package_data=package_data,
         data_files=data_files,
         scripts=scripts,
+        entry_points=entry_points,
         provides=provides,
         keywords=Release.keywords,
         requires=requires,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git



More information about the debian-science-commits mailing list