-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsetup.py
executable file
·76 lines (65 loc) · 2.69 KB
/
setup.py
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
#!/usr/bin/env python3
#
# Install script for xxdiff Python code.
#
__version__ = "$Revision$"
__author__ = "Martin Blais <[email protected]>"
import os
from os.path import join
from distutils.core import setup
def read_version():
try:
return open('VERSION', 'r').readline().strip()
except IOError as e:
raise SystemExit(
"Error: you must run setup from the root directory (%s)" % str(e))
# Include all files without having to create MANIFEST.in
def add_all_files(fun):
import os, os.path
from os.path import abspath, dirname, join
def f(self):
for root, dirs, files in os.walk('.'):
if '.hg' in dirs: dirs.remove('.hg')
self.filelist.extend(join(root[2:], fn) for fn in files
if not fn.endswith('.pyc'))
return fun(self)
return f
from distutils.command.sdist import sdist
sdist.add_defaults = add_all_files(sdist.add_defaults)
allscripts = [join('bin', x) for x in os.listdir('bin')
if x.startswith('xx-')]
allscripts.append(join('bin', 'svn-foreign'))
allscripts.append(join('bin', 'termdiff'))
setup(name="xxdiff-scripts",
version=read_version(),
description=\
"Python package for writing scripts around xxdiff",
long_description="""
This package provides a number of scripts that are used to perform a variety of
tasks that all involve getting user verification and feedback using the xxdiff
graphical differences viewer.
For example, there are scripts to perform global renaming of strings within a
large codebase, where each transformed file is viewed by the user with an
xxdiff, accepted, rejected or merged changes written over the original file
(file backups are supported). Also, this infrastructure is mostly provided as
modules, in order to allow users to write file transformations in Python and to
leverage this interactive confirmation process.
There are also scripts that visualize diffs for a number of SCM systems, like
CVS, Subversion, etc. This package was born after a number of these useful
scripts had sprouted, and it became apparent that sharing the common code for
the scripts would be a great advantage to tools writers.
See documentation for a full list of the scripts and their role:
http://furius.ca/xxdiff/doc/xxdiff-scripts.html
""",
license="GNU GPL",
author="Martin Blais",
author_email="[email protected]",
url="http://furius.ca/xxdiff",
download_url="http://github.com/blais/xxdiff",
package_dir = {'': 'lib/python'},
packages = ['xxdiff',
join('xxdiff', 'scripts'),
join('xxdiff', 'scm'),
join('xxdiff', 'db')],
scripts = allscripts
)