/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: matkor
  • Date: 2007-08-23 10:17:40 UTC
  • mto: This revision was merged to the branch mainline in revision 265.
  • Revision ID: matkor@laptop-hp-20070823101740-s17kf9qa383wiuje
Code for "branch update" menuitem and toolbox. Typo fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
 
 
3
2
"""GTK+ Frontends for various Bazaar commands."""
4
3
 
5
 
from distutils.core import setup, Command
 
4
from distutils.core import setup
6
5
from distutils.command.install_data import install_data
7
 
from distutils.command.build import build
8
6
from distutils.dep_util import newer
9
7
from distutils.log import info
10
8
import glob
11
9
import os
12
10
import sys
13
11
 
14
 
class Check(Command):
15
 
    description = "Run unit tests"
16
 
 
17
 
    user_options = []
18
 
 
19
 
    def initialize_options(self):
20
 
        pass
21
 
 
22
 
    def finalize_options(self):
23
 
        pass
24
 
 
25
 
    def get_command_name(self):
26
 
        return 'test'
27
 
 
28
 
    def run(self):
29
 
        from bzrlib.tests import TestLoader, TestSuite, TextTestRunner
30
 
        import __init__ as bzrgtk
31
 
        runner = TextTestRunner()
32
 
        loader = TestLoader()
33
 
        suite = TestSuite()
34
 
        suite.addTest(bzrgtk.test_suite())
35
 
        result = runner.run(suite)
36
 
        return result.wasSuccessful()
37
 
 
38
 
 
39
 
class CreateCredits(Command):
40
 
    description = "Create credits file"
41
 
 
42
 
    user_options = [("url=", None, "URL of branch")]
43
 
 
44
 
    def initialize_options(self):
45
 
        self.url = "."
46
 
 
47
 
    def finalize_options(self):
48
 
        pass
49
 
 
50
 
    def get_command_name(self):
51
 
        return 'build_credits'
52
 
 
53
 
    def run(self):
54
 
        from bzrlib.plugin import load_plugins; load_plugins()
55
 
        from bzrlib.branch import Branch
56
 
        from bzrlib.plugins.stats import find_credits
57
 
 
58
 
        import pickle
59
 
 
60
 
        branch = Branch.open(self.url)
61
 
        credits = find_credits(branch.repository, branch.last_revision())
62
 
 
63
 
        pickle.dump(credits, file("credits.pickle", 'w'))
64
 
        return True
65
 
 
66
 
 
67
 
def is_versioned(cmd):
68
 
    from bzrlib.errors import NotBranchError
69
 
    try:
70
 
        from bzrlib.branch import Branch
71
 
        Branch.open(".")
72
 
        return True
73
 
    except NotBranchError:
74
 
        return False
75
 
 
76
 
 
77
 
class BuildData(build):
78
 
    sub_commands = build.sub_commands[:]
79
 
    sub_commands.append(('build_credits', is_versioned))
80
 
 
81
 
 
82
12
class InstallData(install_data):
83
13
    def run(self):
84
14
        self.data_files.extend(self._compile_po_files())
85
 
        self.data_files.extend(self._nautilus_plugin())
 
15
        # Disable for now - performance issues
 
16
        #self.data_files.extend(self._nautilus_plugin())
86
17
        install_data.run(self)
87
 
 
88
 
        try:
89
 
            subprocess.check_call('gtk-update-icon-cache -f -t /usr/share/icons/hicolor')
90
 
        except:
91
 
            pass
92
 
 
 
18
    
93
19
    def _compile_po_files(self):
94
20
        data_files = []
95
21
        
125
51
        files = []
126
52
        if sys.platform[:5] == 'linux':
127
53
            cmd = os.popen('pkg-config --variable=pythondir nautilus-python', 'r')
128
 
            res = cmd.readline().strip()
 
54
            res = cmd.readline()
129
55
            ret = cmd.close()
130
56
            
131
57
            if ret is None:
137
63
 
138
64
setup(
139
65
    name = "bzr-gtk",
140
 
    version = "0.97.0",
 
66
    version = "0.90.0",
141
67
    maintainer = "Jelmer Vernooij",
142
68
    maintainer_email = "jelmer@samba.org",
143
69
    description = "GTK+ Frontends for various Bazaar commands",
144
 
    license = "GNU GPL v2 or later",
145
 
    scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
146
 
    url = "http://bazaar-vcs.org/BzrGtk",
 
70
    license = "GNU GPL v2",
 
71
    scripts=['olive-gtk'],
147
72
    package_dir = {
148
73
        "bzrlib.plugins.gtk": ".",
149
74
        "bzrlib.plugins.gtk.viz": "viz", 
150
75
        "bzrlib.plugins.gtk.annotate": "annotate",
151
76
        "bzrlib.plugins.gtk.olive": "olive",
152
 
        "bzrlib.plugins.gtk.tests": "tests",
153
 
        "bzrlib.plugins.gtk.branchview": "branchview",
154
 
        "bzrlib.plugins.gtk.preferences": "preferences",
 
77
        "bzrlib.plugins.gtk.tests": "tests"
155
78
        },
156
79
    packages = [
 
80
        "olive",
157
81
        "bzrlib.plugins.gtk",
158
82
        "bzrlib.plugins.gtk.viz",
159
83
        "bzrlib.plugins.gtk.annotate",
160
84
        "bzrlib.plugins.gtk.olive",
161
 
        "bzrlib.plugins.gtk.tests",
162
 
        "bzrlib.plugins.gtk.branchview",
163
 
        "bzrlib.plugins.gtk.preferences",
 
85
        "bzrlib.plugins.gtk.tests"
164
86
        ],
165
 
    data_files=[('share/olive', ['cmenu.ui',
 
87
    data_files=[('share/olive', ['olive.glade',
 
88
                                 'cmenu.ui',
166
89
                                ]),
167
 
                ('share/bzr-gtk', ['credits.pickle']),
168
 
               ('share/bzr-gtk/icons', ['icons/commit.png',
 
90
                ('share/olive/icons', ['icons/commit.png',
169
91
                                 'icons/commit16.png',
170
92
                                 'icons/diff.png',
171
93
                                 'icons/diff16.png',
176
98
                                 'icons/push.png',
177
99
                                 'icons/push16.png',
178
100
                                 'icons/refresh.png',
179
 
                                 'icons/olive-gtk.png',
180
 
                                 'icons/oliveicon2.png',
181
 
                                 'icons/sign-bad.png',
182
 
                                 'icons/sign-ok.png',
183
 
                                 'icons/sign.png',
184
 
                                 'icons/sign-unknown.png',
185
 
                                 'icons/tag-16.png',
186
 
                                 'icons/bug.png',
187
 
                                 'icons/bzr-icon-64.png']),
 
101
                                 'icons/oliveicon2.png']),
188
102
                ('share/applications', ['olive-gtk.desktop',
189
103
                                        'bazaar-properties.desktop',
190
 
                                        'bzr-handle-patch.desktop',
191
104
                                        'bzr-notify.desktop']),
192
 
                ('share/application-registry', ['bzr-gtk.applications']),
193
 
                ('share/pixmaps', ['icons/olive-gtk.png', 'icons/bzr-icon-64.png']),
194
 
                ('share/icons/hicolor/scalable/emblems', 
195
 
                    ['icons/emblem-bzr-added.svg', 
196
 
                        'icons/emblem-bzr-conflict.svg', 
197
 
                        'icons/emblem-bzr-controlled.svg', 
198
 
                        'icons/emblem-bzr-modified.svg',
199
 
                        'icons/emblem-bzr-removed.svg'])
 
105
                ('share/pixmaps', ['icons/olive-gtk.png'])
200
106
               ],
201
 
    cmdclass={'install_data': InstallData,
202
 
              'build_credits': CreateCredits,
203
 
              'build': BuildData,
204
 
              'check': Check}
 
107
    cmdclass={'install_data': InstallData}
205
108
)