-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup.py
62 lines (52 loc) · 1.85 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
import os
from distutils.core import setup
packages = []
for root, dirs, files in os.walk("memento_damage"):
if '__init__.py' in files:
packages.append(root)
packages.reverse()
packages_non_package_dirs = {}
for root, dirs, files in os.walk("memento_damage"):
for package in packages:
if root == package:
non_package_dirs = []
for dir in dirs:
fullpath_dir = os.path.join(root, dir)
if fullpath_dir not in packages:
non_package_dirs.append(dir)
packages_non_package_dirs[package] = non_package_dirs
packages_data = {}
for package, non_package_dirs in packages_non_package_dirs.items():
packages_data.setdefault(package, [])
for non_package_dir in non_package_dirs:
fullpath_non_package_dir = os.path.join(package, non_package_dir)
for root, dirs, files in os.walk(fullpath_non_package_dir):
if len(files) > 0:
packages_data[package] += [os.path.join(root, f) for f in files]
packages = []
package_dir = {}
package_data = {}
for package, data in packages_data.items():
packages.append(package.replace('/', '.'))
package_dir[package.replace('/', '.')] = package
data = [d.replace(package + '/', '') for d in data]
package_data[package.replace('/', '.')] = data
setup(
name='memento-damage',
version='2.0.7',
packages=packages,
package_dir=package_dir,
package_data=package_data,
scripts=['memento_damage/cli/memento-damage', 'memento_damage/cli/memento-damage-server'],
install_requires=[
'pillow',
'html2text',
'flask',
'Flask-SQLAlchemy'
],
url='https://github.com/oduwsdl/web-memento-damage',
license='',
author='erikaris',
author_email='[email protected]',
description='A tool for calculating damage of webpage'
)