Skip to content

Commit e186aa5

Browse files
committed
Refine import to prevent name conflict #280
Signed-off-by: Thomas Druez <[email protected]>
1 parent 13a5fe8 commit e186aa5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/attributecode/cmd.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
from attributecode import __about_spec_version__
3131
from attributecode import __version__
32-
from attributecode import attrib
33-
from attributecode import gen
32+
from attributecode.attrib import generate_and_save as attrib_generate_and_save
33+
from attributecode.gen import generate as gen_generate
3434
from attributecode import model
3535
from attributecode import severities
3636
from attributecode.util import extract_zip
@@ -115,7 +115,7 @@ def cli():
115115

116116
@click.help_option('-h', '--help')
117117

118-
def inventory_cmd(location, output, quiet, format):
118+
def inventory(location, output, quiet, format):
119119
"""
120120
Collect a JSON or CSV inventory of components from .ABOUT files.
121121
@@ -183,7 +183,7 @@ def inventory_cmd(location, output, quiet, format):
183183

184184
@click.help_option('-h', '--help')
185185

186-
def gen_cmd(location, output, mapping, license_notice_text_location, fetch_license, quiet):
186+
def gen(location, output, mapping, license_notice_text_location, fetch_license, quiet):
187187
"""
188188
Generate .ABOUT files in OUTPUT directory from a JSON or CSV inventory of .ABOUT files at LOCATION.
189189
@@ -200,7 +200,7 @@ def gen_cmd(location, output, mapping, license_notice_text_location, fetch_licen
200200

201201
click.echo('Generating .ABOUT files...')
202202

203-
errors, abouts = gen.generate(
203+
errors, abouts = gen_generate(
204204
location=location, base_dir=output, use_mapping=mapping,
205205
license_notice_text_location=license_notice_text_location,
206206
fetch_license=fetch_license)
@@ -249,7 +249,7 @@ def gen_cmd(location, output, mapping, license_notice_text_location, fetch_licen
249249

250250
@click.help_option('-h', '--help')
251251

252-
def attrib_cmd(location, output, template, mapping, inventory, quiet):
252+
def attrib(location, output, template, mapping, inventory, quiet):
253253
"""
254254
Generate an attribution document at OUTPUT using .ABOUT files at LOCATION.
255255
@@ -265,7 +265,7 @@ def attrib_cmd(location, output, template, mapping, inventory, quiet):
265265
location = extract_zip(location)
266266

267267
inv_errors, abouts = model.collect_inventory(location)
268-
no_match_errors = attrib.generate_and_save(
268+
no_match_errors = attrib_generate_and_save(
269269
abouts=abouts, output_location=output,
270270
use_mapping=mapping, template_loc=template,
271271
inventory_location=inventory)
@@ -297,7 +297,7 @@ def attrib_cmd(location, output, template, mapping, inventory, quiet):
297297

298298
@click.help_option('-h', '--help')
299299

300-
def check_cmd(location, show_all):
300+
def check(location, show_all):
301301
"""
302302
Check and validate .ABOUT file(s) at LOCATION for errors and
303303
print error messages on the terminal.

0 commit comments

Comments
 (0)