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
|
#!/usr/bin/python
"""GUI to edit databases. Many backend supported (Postgres, Sqlite, MySql,...).
Based on python, GTK, sqlalchemy. It's split into a GUI and a very rich package to create
database interfaces
"""
classifiers = """\
Intended Audience :: Developers
Intended Audience :: Education
Intended Audience :: End Users/Desktop
License :: OSI Approved :: GNU Affero General Public License v3
Operating System :: MacOS
Operating System :: Microsoft
Operating System :: OS Independent
Operating System :: POSIX
Operating System :: POSIX :: Linux
Programming Language :: Python
Topic :: Database :: Front-Ends
Topic :: Software Development :: Libraries
Topic :: Software Development :: Libraries :: Application Frameworks
Topic :: Software Development :: Libraries :: Python Modules"""
import os
import sys
try:
from setuptools import setup, find_packages
except ImportError, e:
print "You need to install setuptools to use this setup.py script"
sys.exit(1)
REQUIRES = []
f = open('sqlkit/__init__.py')
for line in f:
if line.startswith('__version__'):
version = line.split()[2].strip("'")
try:
from sphinx.setup_command import BuildDoc
class BuildDocFromDir(BuildDoc):
def run(self):
"""
Run the normal build but first chdir to the documentation root.
"""
orig_params = [os.path.realpath( '.' ), self.builder_target_dir, self.doctree_dir]
os.chdir( self.source_dir )
self.builder_target_dir = os.path.relpath( self.builder_target_dir, self.source_dir )
self.doctree_dir = os.path.relpath( self.doctree_dir, self.source_dir )
BuildDoc.run( self )
curdir, self.builder_target_dir, self.docree_dir = orig_params
os.chdir( curdir )
cmdclass = {'build_sphinx': BuildDocFromDir}
except ImportError:
cmdclass = {}
def doc_files():
"""
Create a list of documentation files.
"""
files = []
walker = os.walk( 'doc/html' )
while True:
try:
n = walker.next()
new_list = []
files.append( (os.path.join( "share/doc/python-sqlkit-doc", n[0][9:] ), new_list) )
for a_file in n[2]:
new_list.append( "%s/%s" % (n[0], a_file) )
except StopIteration:
break
return files
setup(
name='sqlkit',
version=version,
description=__doc__,
author='Alessandro Dentella',
author_email='sandro@e-den.it',
url='http://sqlkit.argolinux.org/',
install_requires=REQUIRES,
packages = find_packages('.'),
data_files =[('share/applications', ['sqlkit.desktop'])] + doc_files(),
classifiers= classifiers.split('\n'),
include_package_data=True,
zip_safe=False,
cmdclass=cmdclass,
entry_points = {
'gui_scripts': [
'sqledit = sqlkit.scripts.sqledit:main',
]
}
)
|