Skip to content

Commit

Permalink
tidy file
Browse files Browse the repository at this point in the history
  • Loading branch information
areski committed May 27, 2012
1 parent 4a85d14 commit 7575c5b
Showing 1 changed file with 33 additions and 37 deletions.
70 changes: 33 additions & 37 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2012 Star2Billing S.L.
#
#
# The Initial Developer of the Original Code is
# Arezqui Belaid <[email protected]>
#
Expand All @@ -20,23 +22,21 @@
import re
from newfies import VERSION


add_django_dependency = True
try:
pkg_resources.get_distribution('Django')
add_django_dependency = False
except pkg_resources.DistributionNotFound:
try:
import django
if django.VERSION[0] >= 1 and django.VERSION[1] >= 2 and django.VERSION[2] >= 0:
if django.VERSION[0] >= 1 and django.VERSION[1] >= 2 \
and django.VERSION[2] >= 0:
add_django_dependency = False
except ImportError:
pass

Distribution({
"setup_requires": add_django_dependency and ['Django >=1.3.0'] or []
})

Distribution({'setup_requires': add_django_dependency
and ['Django >=1.3.0'] or []})

COMMANDS = {}
try:
Expand All @@ -50,11 +50,12 @@
except ImportError:
pass


# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files, temp_data_files, addons_data_files = [], [], [], []
docs_data_files, resources_data_files = [], []

(packages, data_files, temp_data_files, addons_data_files) = ([], [],
[], [])
(docs_data_files, resources_data_files) = ([], [])

root_dir = os.path.dirname(__file__)
if root_dir:
Expand All @@ -67,13 +68,15 @@ def parse_requirements(file_name):
if re.match(r'(\s*#)|(\s*$)', line):
continue
if re.match(r'\s*-e\s+', line):
requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line))
requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1',
line))
elif re.match(r'(\s*git)|(\s*hg)', line):
pass
else:
requirements.append(line)
return requirements


def parse_dependency_links(file_name, install_flag=False):
dependency_links = []
for line in open(file_name, 'r').read().split('\n'):
Expand All @@ -85,25 +88,28 @@ def parse_dependency_links(file_name, install_flag=False):
line_arr_length = len(line.split('/'))
pck_name = line_arr[line_arr_length - 1].split('.git')
if len(pck_name) == 2:
os.system('pip install -f %s %s' % (pck_name[0], line))
os.system('pip install -f %s %s' % (pck_name[0],
line))
if len(pck_name) == 1:
os.system('pip install -f %s %s' % (pck_name, line))
return dependency_links


install_flag=False
if sys.argv[1] == "install":
install_flag = False
if sys.argv[1] == 'install':
install_flag = True

setup(
name='newfies-dialer',
version=VERSION.replace(' ', '-'),
description='Newfies is a Bulk Dialer and Voice Broadcasting application dedicated to provide information via phone technology.',
description='Newfies is a Bulk Dialer and Voice Broadcasting application dedicated to provide information via phone technology.'
,
long_description=open('README.rst').read(),
author='Belaid Arezqui',
author_email='[email protected]',
url='http://www.newfies-dialer.org/',
download_url='https://github.com/Star2Billing/newfies-dialer/tarball/master',
download_url='https://github.com/Star2Billing/newfies-dialer/tarball/master'
,
packages=find_packages(),
include_package_data=True,
license='MPL 2.0 License',
Expand All @@ -115,23 +121,13 @@ def parse_dependency_links(file_name, install_flag=False):
'License :: OSI Approved :: MPL 2.0 License',
'Operating System :: OS Independent',
'Programming Language :: Python, Javascript, HTML',
'Topic :: Voice Broadcast Software'
],
zip_safe = False,
install_requires = parse_requirements('install/conf/requirements.txt'),
dependency_links = parse_dependency_links('install/conf/requirements.txt',
install_flag),
#install_requires = [
# "Django >= 1.3.0",
# "django-notification >= 0.1.2",
# "django-pagination >= 1.0.5",
# "South >= 0.7.2",
#],
setup_requires = [
"Django >= 1.3.0",
"Sphinx >= 0.4.2",
],

# devel
cmdclass = COMMANDS,
)
'Topic :: Voice Broadcast Software',
],
zip_safe=False,
install_requires=parse_requirements('install/conf/requirements.txt'
),
dependency_links=parse_dependency_links('install/conf/requirements.txt'
, install_flag),
setup_requires=['Django >= 1.3.0', 'Sphinx >= 0.4.2'],
cmdclass=COMMANDS,
)

0 comments on commit 7575c5b

Please sign in to comment.