forked from PHACDataHub/django-htmx-autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
51 lines (39 loc) · 1.31 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from setuptools import setup
from setuptools.command.install_lib import install_lib as _install_lib
from setuptools.command.sdist import sdist as _sdist
from distutils.command.build import build as _build
from distutils.cmd import Command
class compile_translations(Command):
description = 'compile message catalogs to MO files via django compilemessages'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import os
import sys
from django.core.management.commands.compilemessages import Command
c = Command()
curdir = os.getcwd()
os.chdir(os.path.realpath('autocomplete'))
c.handle(locale=[], exclude=[], ignore_patterns=[], fuzzy=False, verbosity=0)
os.chdir(curdir)
class build(_build):
sub_commands = [('compile_translations', None)] + _build.sub_commands
class install_lib(_install_lib):
def run(self):
self.run_command('compile_translations')
_install_lib.run(self)
class sdist(_sdist):
def run(self):
self.run_command('compile_translations')
_sdist.run(self)
setup(
cmdclass={
'build': build,
'install_lib': install_lib,
'sdist': sdist,
'compile_translations': compile_translations
}
)