forked from jeffkowalski/geeknote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·110 lines (97 loc) · 3.12 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import shutil
import codecs
from setuptools import setup
from setuptools.command.install import install
import traceback
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
class full_install(install):
user_options = install.user_options + [
(
"bash-completion-dir=",
None,
"(Linux only) Set bash completion directory (default: /etc/bash_completion.d)",
),
(
"zsh-completion-dir=",
None,
"(Linux only) Set zsh completion directory (default: /usr/local/share/zsh/site-functions)",
),
]
def initialize_options(self):
install.initialize_options(self)
self.bash_completion_dir = "/etc/bash_completion.d"
self.zsh_completion_dir = "/usr/local/share/zsh/site-functions"
def run(self):
if sys.platform.startswith("linux"):
self.install_autocomplete()
install.run(self)
def install_autocomplete(self):
def copy_autocomplete(src, dst):
try:
if os.path.exists(dst):
shutil.copy(src, dst)
print("copying %s -> %s" % (src, dst))
except IOError:
print(
"cannot copy autocomplete script %s to %s, got root ?" % (src, dst)
)
print(traceback.format_exc())
print("installing autocomplete")
# TODO fix autocomplete
# copy_autocomplete(
# "completion/bash_completion/_geeknote", self.bash_completion_dir
# )
# copy_autocomplete(
# "completion/zsh_completion/_geeknote", self.zsh_completion_dir
# )
with open("geeknote/__init__.py") as f:
exec (f.read()) # read __version__
setup(
name="geeknote",
version=__version__,
license="GPL",
author="Vitaly Zdanevich",
# author_email='',
description="Geeknote - is a command line client for Evernote, "
"that can be used on Linux, FreeBSD and OS X.",
long_description=read("README.md"),
url="http://github.com/vitaly-zdanevich/geeknote",
packages=["geeknote"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Environment :: Console",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Utilities",
],
install_requires=[
"evernote2",
"html2text",
"sqlalchemy",
"markdown2",
"beautifulsoup4",
"thrift",
"proxyenv",
"lxml",
],
setup_requires=["pytest-runner"],
tests_require=["mock", "pytest"],
entry_points={
"console_scripts": [
"geeknote = geeknote.geeknote:main",
"gnsync = geeknote.gnsync:main",
]
},
cmdclass={"install": full_install},
platforms="Any",
zip_safe=True,
keywords="Evernote, console",
)