This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup.py
107 lines (98 loc) · 2.86 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
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Raindrop.
#
# The Initial Developer of the Original Code is
# Mozilla Messaging, Inc..
# Portions created by the Initial Developer are Copyright (C) 2009
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
VERSION='0.3.0'
setup(
name='linkdrop',
version=VERSION,
description='',
author='',
author_email='',
url='',
install_requires=[
"Pylons>=1.0",
"docutils",
"nose",
"httplib2",
"oauth2",
"python-dateutil",
"python-openid",
"python-memcached",
"gdata", # google api support
"twitter>=1.4.2"
],
setup_requires=["PasteScript>=1.6.3"],
packages=find_packages(exclude=['ez_setup']),
include_package_data=True,
test_suite='nose.collector',
package_data={'linkdrop': ['i18n/*/LC_MESSAGES/*.mo']},
message_extractors={'linkdrop': [
('**.py', 'python', None),
('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}),
('public/**', 'ignore', None)]},
zip_safe=False,
paster_plugins=['PasteScript', 'Pylons'],
entry_points="""
[paste.app_factory]
main = linkdrop.config.middleware:make_app
static = linkdrop.static:make_static
[paste.filter_app_factory]
csrf = linkdrop.csrf:make_csrf_filter_app
dbgp = linkdrop.debug:make_dbgp_middleware
profiler = linkdrop.debug:make_profile_middleware
[paste.app_install]
main = pylons.util:PylonsInstaller
""",
)
import os, stat
basedir = os.path.join(os.getcwd(), "web")
realdir = VERSION
linkdir = os.path.join(basedir, "current")
# Sanity check, nuke what isn't a symlink
try:
s = os.lstat(linkdir)
if not stat.S_ISLNK(s.st_mode):
if stat.S_ISDIR:
os.rmdir(linkdir)
else:
os.unlink(linkdir)
except OSError, e:
if e.errno != 2: # file does not exist
raise
# Check what the symlink might already point to
# and update if needed
try:
lver = os.readlink(linkdir)
except OSError, e:
lver = None
if e.errno != 2: # file does not exist
raise
if lver != VERSION:
if lver:
os.unlink(linkdir)
os.symlink(realdir, linkdir)