/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
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
6639.1.1 by Jelmer Vernooij
Support the SOURCE_DATE_EPOCH environment variable.
17
"bash_completion.py - create bash completion script from built-in brz help"
6379.6.7 by Jelmer Vernooij
Move importing from future until after doc string, otherwise the doc string will disappear.
18
6379.6.3 by Jelmer Vernooij
Use absolute_import.
19
from __future__ import absolute_import
20
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
21
import breezy
22
import breezy.help
23
import breezy.commands
6639.1.1 by Jelmer Vernooij
Support the SOURCE_DATE_EPOCH environment variable.
24
from breezy.doc_generate import get_autodoc_datetime
1551.3.11 by Aaron Bentley
Merge from Robert
25
26
27
def get_filename(options):
6639.1.1 by Jelmer Vernooij
Support the SOURCE_DATE_EPOCH environment variable.
28
    return "%s.bash_completion" % (options.brz_name)
1551.3.11 by Aaron Bentley
Merge from Robert
29
30
31
def infogen(options, outfile):
6639.1.1 by Jelmer Vernooij
Support the SOURCE_DATE_EPOCH environment variable.
32
    d = get_autodoc_datetime()
1551.3.11 by Aaron Bentley
Merge from Robert
33
    params = \
7143.15.2 by Jelmer Vernooij
Run autopep8.
34
        {"brzcmd": options.brz_name,
35
         "datestamp": d.strftime("%Y-%m-%d"),
36
         "timestamp": d.strftime("%Y-%m-%d %H:%M:%S +0000"),
37
         "version": breezy.__version__,
38
         }
1551.3.11 by Aaron Bentley
Merge from Robert
39
40
    outfile.write(preamble % params)
41
42
43
preamble = """\
6639.1.1 by Jelmer Vernooij
Support the SOURCE_DATE_EPOCH environment variable.
44
# bash completion functions for for Breezy (%(brzcmd)s)
1551.3.11 by Aaron Bentley
Merge from Robert
45
#
46
# Large parts of this file are autogenerated from the internal
6639.1.1 by Jelmer Vernooij
Support the SOURCE_DATE_EPOCH environment variable.
47
# Breezy documentation and data structures.
1551.3.11 by Aaron Bentley
Merge from Robert
48
#
49
# Generation time: %(timestamp)s
50
"""