-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsetup.py
133 lines (118 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
##################################################################################
#
# Copyright 2016 Félix Brezo and Yaiza Rubio (i3visio, [email protected])
#
# This file is part of Deepify. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##################################################################################
import os
import sys
HERE = os.path.abspath(os.path.dirname(__file__))
# Importing the local scrips for the setup and taking the new version number
import deepify
NEW_VERSION = deepify.__version__
import deepify.utils.configuration as configuration
# Depending on the place in which the project is going to be upgraded
from setuptools import setup
try:
raise Exception('Trying to load the markdown manually!')
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
print("warning: pypandoc module not found, could not convert Markdown to RST")
read_md = lambda f: open(f, 'r').read()
except Exception:
read_md = lambda f: open(f, 'r').read()
# Reading the .md file
try:
long_description = read_md(os.path.join(HERE,"README.md"))
except:
long_description = ""
# Creating the application path
applicationPath = configuration.getConfigPath()
applicationPathDefaults = os.path.join(applicationPath, "default")
# Copying the default configuration files.
if not os.path.exists(applicationPathDefaults):
os.makedirs(applicationPathDefaults)
# Launching the setup
setup(
name="deepify",
version=NEW_VERSION,
description="Deepify - A set of GPLv3+ libraries to deal with Deepweb connections.",
author="Felix Brezo and Yaiza Rubio",
author_email="[email protected]",
url="http://github.com/i3visio/deepify",
license="COPYING",
keywords = "python osint harvesting networking tor zeronet privacy",
scripts= [
"scripts/onionGet.py",
"scripts/zeronetGet.py",
"scripts/onionsFromFile.py",
],
classifiers=[
'Development Status :: 4 - Beta',
'Topic :: Software Development :: Libraries',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 2 :: Only',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: Science/Research',
'Intended Audience :: Telecommunications Industry',
'Natural Language :: English',
'Topic :: Communications',
'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
'Topic :: Text Processing :: Markup :: HTML'
],
packages=[
"deepify",
"deepify.utils",
],
long_description=long_description,
install_requires=[
"argparse",
"pysocks",
],
)
############################
### Creating other files ###
############################
try:
configuration.changePermissionsRecursively(applicationPath, int(os.getenv('SUDO_UID')), int(os.getenv('SUDO_GID')))
except:
# Something happened with the permissions... We omit this.
pass
files_to_copy= {
applicationPath : [
],
applicationPathDefaults : [
os.path.join("config", "browser.cfg"),
]
}
# Iterating through all destinations to write the info
for destiny in files_to_copy.keys():
# Grabbing each source file to be moved
for sourceFile in files_to_copy[destiny]:
fileToMove = os.path.join(HERE,sourceFile)
# Choosing the command depending on the SO
if sys.platform == 'win32':
cmd = "copy \"" + fileToMove + "\" \"" + destiny + "\""
elif sys.platform == 'linux2' or sys.platform == 'darwin':
cmd = "sudo cp \"" + fileToMove + "\" \"" + destiny + "\""
#print cmd
output = os.popen(cmd).read()
print