3
# Copyright (C) 2006 by Szilveszter Farkas (Phanatic) <szilveszter.farkas@gmail.com>
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
from distutils.core import setup
23
description='Olive - Graphical frontend for Bazaar-NG',
24
author='Szilveszter Farkas (Phanatic)',
25
author_email='szilveszter.farkas@gmail.com',
26
url='https://launchpad.net/products/olive/',
27
packages=['olive', 'olive.backend', 'olive.frontend',
28
'olive.frontend.gtk', 'olive.frontend.gtk.viz'],
29
scripts=['olive-gtk'],
30
data_files=[('share/olive', ['olive.glade',
43
'icons/refresh.png']),
44
('share/applications', ['olive-gtk.desktop']),
45
('share/pixmaps', ['icons/olive-gtk.png'])
3
"""GTK+ Frontends for various Bazaar commands."""
5
from distutils.core import setup, Command
6
from distutils.command.install_data import install_data
7
from distutils.command.build import build
12
description = "Run unit tests"
16
def initialize_options(self):
19
def finalize_options(self):
22
def get_command_name(self):
26
from bzrlib.tests import TestLoader, TestSuite, TextTestRunner
27
import __init__ as bzrgtk
28
runner = TextTestRunner()
31
suite.addTest(bzrgtk.test_suite())
32
result = runner.run(suite)
33
return result.wasSuccessful()
36
class CreateCredits(Command):
37
description = "Create credits file"
39
user_options = [("url=", None, "URL of branch")]
41
def initialize_options(self):
44
def finalize_options(self):
47
def get_command_name(self):
48
return 'build_credits'
51
from bzrlib.plugin import load_plugins; load_plugins()
52
from bzrlib.branch import Branch
53
from bzrlib.plugins.stats import find_credits
57
branch = Branch.open(self.url)
58
credits = find_credits(branch.repository, branch.last_revision())
60
pickle.dump(credits, file("credits.pickle", 'w'))
64
def is_versioned(cmd):
65
from bzrlib.errors import NotBranchError
67
from bzrlib.branch import Branch
70
except NotBranchError:
74
class BuildData(build):
75
sub_commands = build.sub_commands[:]
76
sub_commands.append(('build_credits', is_versioned))
79
class InstallData(install_data):
83
self.data_files.extend(self._nautilus_plugin())
84
install_data.run(self)
87
subprocess.check_call('gtk-update-icon-cache '
88
'-f -t /usr/share/icons/hicolor')
92
def _nautilus_plugin(self):
94
if sys.platform[:5] == 'linux':
95
cmd = os.popen('pkg-config --variable=pythondir nautilus-python',
97
res = cmd.readline().strip()
101
files.append((dest, ['nautilus-bzr.py']))
105
if __name__ == '__main__':
109
maintainer = "Jelmer Vernooij",
110
maintainer_email = "jelmer@samba.org",
111
description = "GTK+ Frontends for various Bazaar commands",
112
license = "GNU GPL v2 or later",
113
scripts = ['bzr-handle-patch', 'bzr-notify'],
114
url = "http://bazaar-vcs.org/BzrGtk",
116
"bzrlib.plugins.gtk": ".",
117
"bzrlib.plugins.gtk.viz": "viz",
118
"bzrlib.plugins.gtk.annotate": "annotate",
119
"bzrlib.plugins.gtk.tests": "tests",
120
"bzrlib.plugins.gtk.branchview": "branchview",
121
"bzrlib.plugins.gtk.preferences": "preferences",
124
"bzrlib.plugins.gtk",
125
"bzrlib.plugins.gtk.viz",
126
"bzrlib.plugins.gtk.annotate",
127
"bzrlib.plugins.gtk.tests",
128
"bzrlib.plugins.gtk.branchview",
129
"bzrlib.plugins.gtk.preferences",
131
data_files=[ ('share/bzr-gtk', ['credits.pickle']),
132
('share/bzr-gtk/icons', ['icons/commit.png',
133
'icons/commit16.png',
143
'icons/sign-bad.png',
146
'icons/sign-unknown.png',
149
'icons/bzr-icon-64.png']),
150
('share/applications', ['bazaar-properties.desktop',
151
'bzr-handle-patch.desktop',
152
'bzr-notify.desktop']),
153
('share/application-registry', ['bzr-gtk.applications']),
154
('share/pixmaps', ['icons/bzr-icon-64.png']),
155
('share/icons/hicolor/scalable/emblems',
156
['icons/emblem-bzr-added.svg',
157
'icons/emblem-bzr-conflict.svg',
158
'icons/emblem-bzr-controlled.svg',
159
'icons/emblem-bzr-modified.svg',
160
'icons/emblem-bzr-removed.svg',
161
'icons/emblem-bzr-ignored.svg'])
163
cmdclass={'install_data': InstallData,
164
'build_credits': CreateCredits,