Projet

Général

Profil

0001-misc-install-bijoe-manage-using-setuptools-entrypoin.patch

Frédéric Péters, 13 avril 2020 12:40

Télécharger (3,18 ko)

Voir les différences:

Subject: [PATCH] misc: install bijoe-manage using setuptools entrypoint

 bijoe/__init__.py    | 24 ++++++++++++++++++++++++
 debian/bijoe-manage  |  2 +-
 debian/bijoe.install |  2 +-
 manage.py            |  9 ++-------
 setup.py             |  4 +++-
 5 files changed, 31 insertions(+), 10 deletions(-)
bijoe/__init__.py
1
# bijoe - BI dashboard
2
# Copyright (C) 2015-2020  Entr'ouvert
3
#
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU Affero General Public License as published
6
# by the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU Affero General Public License for more details.
13
#
14
# You should have received a copy of the GNU Affero General Public License
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16

  
17
import os
18
import sys
19

  
20

  
21
def manage():
22
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bijoe.settings")
23
    from django.core.management import execute_from_command_line
24
    execute_from_command_line(sys.argv)
debian/bijoe-manage
1 1
#!/bin/sh
2 2

  
3 3
NAME=bijoe
4
MANAGE=/usr/lib/$NAME/manage.py
4
MANAGE=/usr/lib/$NAME/bijoe-manage.py
5 5

  
6 6
# load Debian default configuration
7 7
export BIJOE_SETTINGS_FILE=/usr/lib/$NAME/debian_config.py
debian/bijoe.install
1
usr/bin/manage.py         /usr/lib/bijoe
1
usr/bin/bijoe-manage.py   /usr/lib/bijoe
2 2
debian/bijoe-manage       /usr/bin
3 3
debian/bijoe.service      /lib/systemd/system
4 4
debian/settings.py        /etc/bijoe
manage.py
1 1
#!/usr/bin/env python3
2
import os
3
import sys
4 2

  
5
if __name__ == "__main__":
6
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bijoe.settings")
3
import bijoe
7 4

  
8
    from django.core.management import execute_from_command_line
9

  
10
    execute_from_command_line(sys.argv)
5
bijoe.manage()
setup.py
94 94
                        'XStatic-ChartNew.js', 'gadjo', 'django-jsonfield<1.3',
95 95
                        'python-dateutil', 'djangorestframework<3.8',
96 96
                        'xstatic-select2'],
97
      scripts=['manage.py'],
97
      entry_points={'console_scripts': [
98
          'bijoe-manage.py = bijoe:manage',
99
      ]},
98 100
      cmdclass={
99 101
          'sdist': eo_sdist,
100 102
          'build': build,
101
-