Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[cfa495]: setup.py Maximize Restore History

Download this file

setup.py    49 lines (41 with data), 1.2 kB

 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
#!/usr/bin/env python3
VERSION = '4.0.0'
long_description = '''\
ReText is simple text editor that supports Markdown and reStructuredText
markup languages. It is written in Python using PyQt libraries.'''
from distutils.core import setup
from distutils.command.build import build
from distutils.command.sdist import sdist
from subprocess import check_call
from glob import glob
def build_translations():
print('running build_translations')
error = None
for ts_file in glob('locale/*.ts'):
try:
check_call(('lrelease', ts_file))
except Exception as e:
error = e
if error:
print('Failed to build translations:', error)
class retext_build(build):
def run(self):
build.run(self)
if not glob('locale/*.qm'):
build_translations()
class retext_sdist(sdist):
def run(self):
build_translations()
sdist.run(self)
setup(name='ReText',
version=VERSION,
description='Simple editor for Markdown and reStructuredText',
long_description=long_description,
author='Dmitry Shachnev',
author_email='mitya57@gmail.com',
url='http://retext.sourceforge.net/',
packages=['ReText'],
scripts=['retext.py', 'wpgen.py'],
cmdclass={'build': retext_build, 'sdist': retext_sdist},
license='GPL 2+'
)