forked from Ordinati/Ordinati
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
60 lines (49 loc) · 1.69 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
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
import os
import json
def check_bookmarks_file():
if not os.path.exists(os.path.expanduser('~/.ordinati')):
os.mkdir(os.path.expanduser('~') + '/.ordinati')
if not os.path.isfile(os.path.expanduser('~/.ordinati/bookmarks.json')):
f = open(os.path.expanduser('~/.ordinati/bookmarks.json'), 'w+')
objects = []
json.dump(objects, f, indent=4, separators=(',', ': '))
class create_bookmarks_file_develop(develop):
"""Post-installation for development mode."""
def run(self):
check_bookmarks_file()
develop.run(self)
class create_bookmarks_file_install(install):
"""Post-installation for installation mode."""
def run(self):
check_bookmarks_file()
install.run(self)
setup(
name='Ordinati',
version='0.1.0',
author='''
Chintan Soni <[email protected]>,
Husain Zafar <[email protected]>,
Kshitija Waghurdekar <[email protected]>,
Rishika Goyal <[email protected]>''',
packages=find_packages(),
license='AGPLv3',
description='Offline bookmark management command line tool',
url='https://github.com/Ordinati/Ordinati',
keyword='bookmarks manager command line cli',
long_description=open('README.md').read(),
install_requires=[
'Click', 'httplib2'
],
entry_points='''
[console_scripts]
ordinati = ordinati.ordinati:cli
ord = ordinati.ordinati:cli
''',
cmdclass={
'develop': create_bookmarks_file_develop,
'install': create_bookmarks_file_install,
},
)