/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: Mark Lee
  • Date: 2009-07-11 18:39:14 UTC
  • mto: This revision was merged to the branch mainline in revision 661.
  • Revision ID: bzr@lazymalevolence.com-20090711183914-zuii3et5skiv2njo
Re-ignore credits.pickle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
 
2
 
2
3
"""GTK+ Frontends for various Bazaar commands."""
3
4
 
4
5
from distutils.core import setup, Command
5
6
from distutils.command.install_data import install_data
 
7
from distutils.command.build import build
6
8
from distutils.dep_util import newer
7
9
from distutils.log import info
8
10
import glob
33
35
        result = runner.run(suite)
34
36
        return result.wasSuccessful()
35
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
 
36
82
class InstallData(install_data):
37
83
    def run(self):
38
84
        self.data_files.extend(self._compile_po_files())
79
125
        files = []
80
126
        if sys.platform[:5] == 'linux':
81
127
            cmd = os.popen('pkg-config --variable=pythondir nautilus-python', 'r')
82
 
            res = cmd.readline()
 
128
            res = cmd.readline().strip()
83
129
            ret = cmd.close()
84
130
            
85
131
            if ret is None:
91
137
 
92
138
setup(
93
139
    name = "bzr-gtk",
94
 
    version = "0.95.0",
 
140
    version = "0.97.0",
95
141
    maintainer = "Jelmer Vernooij",
96
142
    maintainer_email = "jelmer@samba.org",
97
143
    description = "GTK+ Frontends for various Bazaar commands",
98
144
    license = "GNU GPL v2 or later",
99
 
    scripts=['olive-gtk', 'bzr-handle-patch'],
 
145
    scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
 
146
    url = "http://bazaar-vcs.org/BzrGtk",
100
147
    package_dir = {
101
148
        "bzrlib.plugins.gtk": ".",
102
149
        "bzrlib.plugins.gtk.viz": "viz", 
115
162
        "bzrlib.plugins.gtk.branchview",
116
163
        "bzrlib.plugins.gtk.preferences",
117
164
        ],
118
 
    data_files=[('share/olive', ['olive.glade',
119
 
                                 'cmenu.ui',
 
165
    data_files=[('share/olive', ['cmenu.ui',
120
166
                                ]),
121
 
                ('share/olive/icons', ['icons/commit.png',
 
167
                ('share/bzr-gtk', ['credits.pickle']),
 
168
               ('share/bzr-gtk/icons', ['icons/commit.png',
122
169
                                 'icons/commit16.png',
123
170
                                 'icons/diff.png',
124
171
                                 'icons/diff16.png',
129
176
                                 'icons/push.png',
130
177
                                 'icons/push16.png',
131
178
                                 'icons/refresh.png',
132
 
                                 'icons/oliveicon2.png']),
133
 
                ('share/bzr-gtk/icons', ['icons/sign-bad.png',
 
179
                                 'icons/olive-gtk.png',
 
180
                                 'icons/oliveicon2.png',
 
181
                                 'icons/sign-bad.png',
134
182
                                 'icons/sign-ok.png',
135
183
                                 'icons/sign.png',
136
184
                                 'icons/sign-unknown.png',
 
185
                                 'icons/tag-16.png',
137
186
                                 'icons/bug.png',
138
187
                                 'icons/bzr-icon-64.png']),
139
188
                ('share/applications', ['olive-gtk.desktop',
150
199
                        'icons/emblem-bzr-removed.svg'])
151
200
               ],
152
201
    cmdclass={'install_data': InstallData,
 
202
              'build_credits': CreateCredits,
 
203
              'build': BuildData,
153
204
              'check': Check}
154
205
)