-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
setup.py
74 lines (68 loc) · 2.53 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
from setuptools import setup, find_packages
import inspect
import os, errno
import platform
SETUP_PY_FILENAME = inspect.getframeinfo(inspect.currentframe()).filename
ROOT_DIR = os.path.dirname(os.path.abspath(SETUP_PY_FILENAME))
README_MD_PATH = os.path.join(ROOT_DIR, 'README.md')
README_RST_PATH = os.path.join(ROOT_DIR, 'README.rst')
README_TXT_PATH = os.path.join(ROOT_DIR, 'README.txt')
VERSION_TXT_PATH = os.path.join(ROOT_DIR, 'VERSION')
dist_bin_SCRIPTS = ['vncpasswd.py']
if platform.system().startswith('Windows'):
dist_bin_SCRIPTS.append('pass2reg.cmd')
try:
from m2r import parse_from_file
readme = parse_from_file(README_MD_PATH)
f = open(README_RST_PATH,'w')
f.write(readme)
f.close()
os_symlink = getattr(os, "symlink", None)
if callable(os_symlink):
try:
os.symlink(README_RST_PATH, README_TXT_PATH)
except OSError, e:
if e.errno == errno.EEXIST:
os.remove(README_TXT_PATH)
os.symlink(README_RST_PATH, README_TXT_PATH)
else:
f = open(README_TXT_PATH,'w')
f.write(readme)
f.close()
except ImportError:
# m2r may not be installed in user environment
with open(README_MD_PATH) as f:
readme = f.read()
with open(VERSION_TXT_PATH, 'r') as f:
version = f.read().rstrip()
setup(
name='vncpasswd.py',
version=version,
packages=['d3des','WindowsRegistry',],
scripts=dist_bin_SCRIPTS,
license='License :: OSI Approved :: MIT License',
description='A Python implementation of vncpasswd, w/decryption abilities & extra features ;-)',
long_description=readme,
platforms=['any'],
author='James Cuzella',
author_email='[email protected]',
url='https://github.com/trinitronx/vncpasswd.py',
classifiers=[
"Programming Language :: Python :: 2 :: Only",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: Implementation :: CPython",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Topic :: Security :: Cryptography",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Recovery Tools",
"Topic :: System :: Systems Administration",
"Topic :: Utilities"
],
python_requires='<=2.7'
)