Refactor kwdemo and make output translatable
Better reflect the actual behaviour of the extension:
- Make map arguments and -f/--rcfile not mutually exclusive but
extend the current configuration
- Map arguments and -f/--rcfile both override the defaults even
when -d/--default is specified
- -d/--default only overrides the current configuration
Inform the user about extending/overriding behaviour, but only at
the beginning; the following messages become terser, making the
output translatable without too much code clutter.
Rephrase help (use "short/long" option notation etc.).
#!/usr/bin/env python
# $Id$
from distutils.core import setup
import os, time
# specify version, Mercurial version otherwise
version = ''
unknown_version = 'unknown'
def getversion():
global version, unknown_version
if not version and os.path.isdir('.hg'):
p = os.popen('hg --quiet identify 2> %s' % os.devnull)
ident = p.read()[:-1]
if not p.close() and ident:
if ident[-1] != '+':
version = ident
else:
version = ident[:-1]
version += time.strftime('+%Y%m%d')
return version or unknown_version
setup(name='hgkw',
version=getversion(),
description='Mercurial keyword extension (standalone)',
author='Christian Ebert',
author_email='blacktrash@gmx.net',
url='http://www.blacktrash.org/hg/hgkeyword/',
license='GNU GPL',
packages=['hgkw'])