-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
134 lines (111 loc) · 4.51 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
from setuptools import setup, Command
import gettext
import os
import platform
import site
gettext.install('pdf2odt', 'pdf2odt/locale')
class Doxygen(Command):
description = "Create/update doxygen documentation in doc/html"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
print("Creating Doxygen Documentation")
os.system("""sed -i -e "41d" doc/Doxyfile""")#Delete line 41
os.system("""sed -i -e "41iPROJECT_NUMBER = {}" doc/Doxyfile""".format(__version__))#Insert line 41
os.system("rm -Rf build")
os.chdir("doc")
os.system("doxygen Doxyfile")
os.system("rsync -avzP -e 'ssh -l turulomio' html/ frs.sourceforge.net:/home/users/t/tu/turulomio/userweb/htdocs/doxygen/pdf2odt/ --delete-after")
os.chdir("..")
class Procedure(Command):
description = "Create/update doxygen documentation in doc/html"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
print(_("New Release:"))
print(_(" * Change version and date in version.py"))
print(_(" * Edit Changelog in README"))
print(" * python setup.py doc")
print(" * mcedit locale/es.po")
print(" * python setup.py doc")
print(" * python setup.py install")
print(" * python setup.py doxygen")
print(" * git commit -a -m 'pdf2odt-{}'".format(__version__))
print(" * git push")
print(_(" * Make a new tag in github"))
print(" * python setup.py sdist upload -r pypi")
print(" * python setup.py uninstall")
print(_(" * Create a new gentoo ebuild with the new version"))
print(_(" * Upload to portage repository"))
class Uninstall(Command):
description = "Uninstall installed files with install"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if platform.system()=="Linux":
os.system("rm -Rf {}/pdf2odt*".format(site.getsitepackages()[0]))
os.system("rm /usr/bin/pdf2odt")
else:
os.system("pip uninstall pdf2odt")
class Doc(Command):
description = "Update man pages and translations"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
#es
os.system("xgettext -L Python --no-wrap --no-location --from-code='UTF-8' -o locale/pdf2odt.pot *.py pdf2odt/*.py")
os.system("msgmerge -N --no-wrap -U locale/es.po locale/pdf2odt.pot")
os.system("msgmerge -N --no-wrap -U locale/fr.po locale/pdf2odt.pot")
os.system("msgfmt -cv -o pdf2odt/locale/es/LC_MESSAGES/pdf2odt.mo locale/es.po")
os.system("msgfmt -cv -o pdf2odt/locale/fr/LC_MESSAGES/pdf2odt.mo locale/fr.po")
## Version of modele captured from version to avoid problems with package dependencies
__version__= None
with open('pdf2odt/version.py', encoding='utf-8') as f:
for line in f.readlines():
if line.find("__version__ =")!=-1:
__version__=line.split("'")[1]
with open('README.md', encoding='utf-8') as f:
long_description = f.read()
setup(name='pdf2odt',
version=__version__,
description='Change files and directories permisions and owner recursivily from current directory',
long_description=long_description,
long_description_content_type='text/markdown',
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: System Administrators',
'Topic :: System :: Systems Administration',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 3',
],
keywords='change permissions ownner files directories',
url='https://github.com/turulomio/pdf2odt',
author='Turulomio',
author_email='[email protected]',
license='GPL-3',
packages=['pdf2odt'],
entry_points = {'console_scripts': ['pdf2odt=pdf2odt.core:main',
],
},
install_requires=['colorama','setuptools','officegenerator','pillow','tqdm', 'pytz'],
data_files=[],
cmdclass={ 'doxygen': Doxygen,
'doc': Doc,
'uninstall': Uninstall,
'procedure': Procedure,
},
zip_safe=False,
include_package_data=True
)
_=gettext.gettext#To avoid warnings