mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
parent
60eaa20c2e
commit
0217b6af42
@ -1,4 +1,30 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
# {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
# This file is part of Icinga 2 Web.
|
||||||
|
#
|
||||||
|
# Icinga 2 Web - Head for multiple monitoring backends.
|
||||||
|
# Copyright (C) 2013 Icinga Development Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# @copyright 2013 Icinga Development Team <info@icinga.org>
|
||||||
|
# @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||||
|
# @author Icinga Development Team <info@icinga.org>
|
||||||
|
# {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
import optparse
|
import optparse
|
||||||
@ -14,12 +40,17 @@ FILE_TYPE_CONFIG = {
|
|||||||
'php': {'prefix': ' * ',
|
'php': {'prefix': ' * ',
|
||||||
'firstComment': '/**',
|
'firstComment': '/**',
|
||||||
'lastComment': ' */',
|
'lastComment': ' */',
|
||||||
'linesFirst': 0,
|
'linesBefore': 0,
|
||||||
'linesAfter': 0},
|
'linesAfter': 0},
|
||||||
'js': {'prefix': ' * ',
|
'js': {'prefix': ' * ',
|
||||||
'firstComment': '/**',
|
'firstComment': '/**',
|
||||||
'lastComment': ' */',
|
'lastComment': ' */',
|
||||||
'linesFirst': 0,
|
'linesBefore': 0,
|
||||||
|
'linesAfter': 0},
|
||||||
|
'py': {'prefix': '# ',
|
||||||
|
'firstComment': None,
|
||||||
|
'lastComment': None,
|
||||||
|
'linesBefore': 0,
|
||||||
'linesAfter': 0}
|
'linesAfter': 0}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,11 +187,17 @@ def get_license(type):
|
|||||||
except(KeyError):
|
except(KeyError):
|
||||||
config = FILE_TYPE_CONFIG[type]
|
config = FILE_TYPE_CONFIG[type]
|
||||||
license_data = []
|
license_data = []
|
||||||
license_data.extend([''] * config['linesFirst'])
|
license_data.extend([''] * config['linesBefore'])
|
||||||
license_data.append(config['firstComment'])
|
if config['firstComment'] != None:
|
||||||
|
license_data.append(config['firstComment'])
|
||||||
for line in LICENSE_DATA.split('\n'):
|
for line in LICENSE_DATA.split('\n'):
|
||||||
license_data.append(config['prefix'] + line)
|
if line:
|
||||||
license_data.append(config['lastComment'])
|
license_data.append(config['prefix'] + line)
|
||||||
|
else:
|
||||||
|
# Whitespace is uselses in this case (#4603)
|
||||||
|
license_data.append(config['prefix'].rstrip())
|
||||||
|
if config['lastComment'] != None:
|
||||||
|
license_data.append(config['lastComment'])
|
||||||
license_data.extend([''] * config['linesAfter'])
|
license_data.extend([''] * config['linesAfter'])
|
||||||
__LICENSE_STORE[type] = '\n'.join(license_data)
|
__LICENSE_STORE[type] = '\n'.join(license_data)
|
||||||
__LICENSE_STORE[type] = __LICENSE_STORE[type] % REPLACE_TOKENS
|
__LICENSE_STORE[type] = __LICENSE_STORE[type] % REPLACE_TOKENS
|
||||||
|
@ -1,6 +1,30 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/php
|
||||||
<?php
|
<?php
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
/**
|
||||||
|
* This file is part of Icinga 2 Web.
|
||||||
|
*
|
||||||
|
* Icinga 2 Web - Head for multiple monitoring backends.
|
||||||
|
* Copyright (C) 2013 Icinga Development Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||||
|
* @author Icinga Development Team <info@icinga.org>
|
||||||
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
require_once dirname(__FILE__) . '/../library/Icinga/Application/Cli.php';
|
require_once dirname(__FILE__) . '/../library/Icinga/Application/Cli.php';
|
||||||
|
@ -1,6 +1,30 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/php
|
||||||
<?php
|
<?php
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
/**
|
||||||
|
* This file is part of Icinga 2 Web.
|
||||||
|
*
|
||||||
|
* Icinga 2 Web - Head for multiple monitoring backends.
|
||||||
|
* Copyright (C) 2013 Icinga Development Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||||
|
* @author Icinga Development Team <info@icinga.org>
|
||||||
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
set_include_path(
|
set_include_path(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user