diff --git a/bin/gourmet b/bin/gourmet deleted file mode 100755 index 29bc0d27d..000000000 --- a/bin/gourmet +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python -# PYTHON_ARGCOMPLETE_OK -# Copyright (c) 2004, 2005, 2006, 2007 Tom Hinkle -# You may use and distribute this software under the terms of the -# GNU General Public License, version 2 or later - -import sys - -# The following line is modified at installation time by setup.py so it -# points to the actual modules installation path. -lib_dir = '.' - -if lib_dir not in sys.path: - sys.path.insert(0, lib_dir) - -from gourmet import GourmetRecipeManager -GourmetRecipeManager.startGUI() - diff --git a/setup.py b/setup.py index cb4fdbf80..8cc5af8fb 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -import fileinput import glob import os import os.path as op @@ -9,7 +8,6 @@ import distutils.command.build_py import distutils.command.build_scripts import distutils.core -from distutils.util import convert_path import setuptools @@ -198,39 +196,6 @@ def run(self): distutils.command.build.build.sub_commands.append(("build_i18n", None)) - -class build_scripts(distutils.command.build_scripts.build_scripts): - """build_scripts command - - This specific build_scripts command will modify the bin/gourmet script - so that it contains information on installation prefixes afterwards. - """ - - def copy_scripts(self): - distutils.command.build_scripts.build_scripts.copy_scripts(self) - - if "install" in self.distribution.command_obj: - iobj = self.distribution.command_obj["install"] - lib_dir = iobj.install_lib - data_dir = iobj.install_data - - if iobj.root: - lib_dir = lib_dir[len(iobj.root):] - data_dir = data_dir[len(iobj.root):] - - script = convert_path("bin/gourmet") - outfile = op.join(self.build_dir, op.basename(script)) - - # abuse fileinput to replace two lines in bin/gourmet - for line in fileinput.input(outfile, inplace=1): - if "lib_dir = '.'" in line: - line = "lib_dir = '%s'\n" % lib_dir - elif "data_dir = '.'" in line: - line = "data_dir = '%s'\n" % data_dir - - print(line), - - if sys.platform == "win32": # GTK file inclusion from gi.repository import Gtk @@ -432,8 +397,9 @@ def crawl_plugins(base, basename): include_package_data=True, cmdclass={'build': build_extra, 'build_i18n': build_i18n, - 'build_scripts': build_scripts, }, - - scripts=[op.join('bin', 'gourmet')], + entry_points={ + "console_scripts": [ + "gourmet = gourmet.GourmetRecipeManager:startGUI", + ]} )