~bzr-pqm/bzr/bzr.dev

4070.11.16 by Martin Pool
Fix copyrights and remove assert statement from doc_generate
1
# Copyright (C) 2005 Canonical Ltd
1551.3.11 by Aaron Bentley
Merge from Robert
2
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
7
#
1551.3.11 by Aaron Bentley
Merge from Robert
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
1887.1.1 by Adeodato Simó
Do not separate paragraphs in the copyright statement with blank lines,
12
#
1551.3.11 by Aaron Bentley
Merge from Robert
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1551.3.11 by Aaron Bentley
Merge from Robert
16
6379.6.3 by Jelmer Vernooij
Use absolute_import.
17
from __future__ import absolute_import
18
1551.3.11 by Aaron Bentley
Merge from Robert
19
"bash_completion.py - create bash completion script from built-in bzr help"
20
21
import os
22
import sys
23
import time
24
25
import bzrlib
26
import bzrlib.help
27
import bzrlib.commands
28
29
30
def get_filename(options):
31
    return "%s.bash_completion" % (options.bzr_name)
32
33
34
def infogen(options, outfile):
35
    t = time.time()
36
    tt = time.gmtime(t)
37
    params = \
38
           { "bzrcmd": options.bzr_name,
39
             "datestamp": time.strftime("%Y-%m-%d",tt),
40
             "timestamp": time.strftime("%Y-%m-%d %H:%M:%S +0000",tt),
41
             "version": bzrlib.__version__,
42
             }
43
44
    outfile.write(preamble % params)
45
46
47
preamble = """\
1861.2.8 by Alexander Belchenko
More branding: bazaar-ng -> Bazaar; bazaar-ng.org -> bazaar-vcs.org
48
# bash completion functions for for Bazaar (%(bzrcmd)s)
1551.3.11 by Aaron Bentley
Merge from Robert
49
#
50
# Large parts of this file are autogenerated from the internal
1861.2.8 by Alexander Belchenko
More branding: bazaar-ng -> Bazaar; bazaar-ng.org -> bazaar-vcs.org
51
# Bazaar documentation and data structures.
1551.3.11 by Aaron Bentley
Merge from Robert
52
#
53
# Generation time: %(timestamp)s
54
"""
55