10
10
text += '// fast_float by ' + line
11
11
if filename == 'CONTRIBUTORS' :
12
12
text += '// with contributions from ' + line
13
- processed_files [filename ] = text + '//\n '
13
+ processed_files [filename ] = text + '//\n // \n '
14
14
15
15
# licenses
16
- for filename in ['LICENSE-MIT' , 'LICENSE-APACHE' ]:
16
+ for filename in ['LICENSE-MIT' , 'LICENSE-APACHE' , 'LICENSE-BOOST' ]:
17
17
lines = []
18
18
with open (filename , encoding = 'utf8' ) as f :
19
19
lines = f .readlines ()
44
44
import argparse
45
45
46
46
parser = argparse .ArgumentParser (description = 'Amalgamate fast_float.' )
47
- parser .add_argument ('--license' , default = 'DUAL ' , choices = ['DUAL' , 'MIT' , 'APACHE' ], help = 'choose license' )
47
+ parser .add_argument ('--license' , default = 'TRIPLE ' , choices = ['DUAL' , 'TRIPLE' , ' MIT' , 'APACHE' , 'BOOST ' ], help = 'choose license' )
48
48
parser .add_argument ('--output' , default = '' , help = 'output file (stdout if none' )
49
49
50
50
args = parser .parse_args ()
51
51
52
52
def license_content (license_arg ):
53
53
result = []
54
-
54
+ if license_arg == 'TRIPLE' :
55
+ result += [
56
+ '// Licensed under the Apache License, Version 2.0, or the\n ' ,
57
+ '// MIT License or the Boost License. This file may not be copied,\n ' ,
58
+ '// modified, or distributed except according to those terms.\n ' ,
59
+ '//\n '
60
+ ]
55
61
if license_arg == 'DUAL' :
56
62
result += [
57
63
'// Licensed under the Apache License, Version 2.0, or the\n ' ,
@@ -60,14 +66,18 @@ def license_content(license_arg):
60
66
'//\n '
61
67
]
62
68
63
- if license_arg in ('DUAL' , 'MIT' ):
69
+ if license_arg in ('DUAL' , 'TRIPLE' , ' MIT' ):
64
70
result .append ('// MIT License Notice\n //\n ' )
65
71
result .append (processed_files ['LICENSE-MIT' ])
66
72
result .append ('//\n ' )
67
- if license_arg in ('DUAL' , 'APACHE' ):
73
+ if license_arg in ('DUAL' , 'TRIPLE' , ' APACHE' ):
68
74
result .append ('// Apache License (Version 2.0) Notice\n //\n ' )
69
75
result .append (processed_files ['LICENSE-APACHE' ])
70
76
result .append ('//\n ' )
77
+ if license_arg in ('TRIPLE' , 'BOOST' ):
78
+ result .append ('// BOOST License Notice\n //\n ' )
79
+ result .append (processed_files ['LICENSE-BOOST' ])
80
+ result .append ('//\n ' )
71
81
72
82
return result
73
83
0 commit comments