11craft / schevogtk

PyGTK-based database navigator and widget library for Schevo

This URL has Read+Write access

schevogtk / pavement.py
100644 172 lines (146 sloc) 5.171 kb
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
try:
    import paver
except ImportError:
    pass
else:
    from paver.easy import *
    import paver.misctasks
    import paver.setuputils
    from paver.setuputils import setup
 
    from textwrap import dedent
 
    from setuptools import Extension, find_packages
 
 
    VERSION = '3.1.0'
    DOCVERSION = VERSION
    DEVELOPMENT = True
 
 
    # Use branch name if git information is available; otherwise, use
    # version number from setup_meta.
    if DEVELOPMENT:
        try:
            git_head_path = path('.git/HEAD')
            contents = git_head_path.open('rU').readline().strip()
            name, value = contents.split()
            BRANCH = value.split('/')[-1]
            if BRANCH != 'master':
                DOCVERSION += '-' + BRANCH
        except:
            pass
        DOCVERSION += '-dev'
 
 
    setup(
        name='SchevoGtk',
        version=VERSION,
        description="Schevo tools for PyGTK",
        long_description=dedent("""
Provides integration between Schevo_ and PyGTK_.
 
.. _Schevo: http://schevo.org/
 
.. _PyGTK: http://pygtk.org/
 
You can also get the `latest development version
<http://github.com/gldnspud/schevogtk/zipball/master#egg=SchevoGtk-dev>`__.
"""),
        classifiers=[
            'Development Status :: 4 - Beta',
            'Environment :: Console',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: MIT License',
            'Operating System :: OS Independent',
            'Programming Language :: Python',
            'Topic :: Database :: Database Engines/Servers',
            'Topic :: Software Development :: Libraries :: '
                'Application Frameworks',
        ],
        keywords='database dbms',
        author='ElevenCraft Inc.',
        author_email='schevo@googlegroups.com',
        url='http://www.schevo.org/',
        license='MIT',
        packages=find_packages(exclude=['doc', 'tests']),
        include_package_data=True,
        package_data={'': ['*.glade']},
        zip_safe=False,
        install_requires=[
            'Schevo == dev, >= 3.1.0dev-20090919',
            'kiwi == 1.9.26',
            'Gazpacho == 0.7.2',
        ],
        dependency_links=[
            'http://schevo.org/eggs/',
        ],
        tests_require=['nose >= 0.10.4'],
        test_suite='nose.collector',
        entry_points = """
[schevo.schevo_command]
gnav = schevogtk2.script:start
""",
        )
 
 
    options(
        cog=Bunch(
            basdir='doc/source',
            includedir='doc/source',
            pattern='*.txt',
            beginspec='<==',
            endspec='==>',
            endoutput='<==end==>',
        ),
        publish=Bunch(
            username='schevo',
            server='web7.webfaction.com',
            path='/home2/schevo/schevo_docs/schevogtk/%s' % VERSION,
        ),
        sphinx=Bunch(
            docroot='doc',
            builddir='build',
            sourcedir='source',
        ),
    )
 
 
    @task
    @needs('generate_setup', 'minilib', 'setuptools.command.sdist')
    def sdist():
        """Overrides sdist to make sure that our setup.py is generated."""
        pass
 
 
    try:
        import paver.doctools
    except ImportError:
        pass
    else:
        @task
        @needs(['paver.doctools.cog', 'paver.doctools.html', 'paver.doctools.uncog'])
        def html():
            pass
 
 
        @task
        @needs('html')
        def docs():
            import webbrowser
            index_file = path('doc/build/html/index.html')
            webbrowser.open('file://' + index_file.abspath())
 
 
        @task
        @needs(['paver.doctools.cog', 'paver.doctools.html', 'paver.doctools.uncog'])
        @cmdopts([("username=", "u", "Username for remote server"),
                  ("server=", "s", "Server to publish to"),
                  ("path=", "p", "Path to publish to")])
        def publish():
            src_path = path('doc/build/html') / '.'
            dest_path = path(options.path) / '.'
            # Create the remote directory and copy files to it.
            if options.username:
                server = '%s@%s' % (options.username, options.server)
            else:
                server = options.server
            if sys.platform == 'win32':
                sh('plink %s "mkdir -p %s"' % (server, options.path))
                sh('pscp -r -v -batch %s %s:%s' % (src_path, server, dest_path))
            else:
                sh('ssh %s "mkdir -p %s"' % (server, options.path))
                sh('rsync -zav --delete %s %s:%s' % (src_path, server, dest_path))
 
 
        @task
        def doctests():
            from paver.doctools import _get_paths
            import sphinx
            options.order('sphinx', add_rest=True)
            paths = _get_paths()
            sphinxopts = ['', '-b', 'doctest', '-d', paths.doctrees,
                paths.srcdir, paths.htmldir]
            ret = dry(
                "sphinx-build %s" % (" ".join(sphinxopts),), sphinx.main, sphinxopts)
 
 
        @task
        @needs(['doctests', 'nosetests'])
        def test():
            pass