Skip to content

Commit 86638c1

Browse files
committed
Remove the 'all_in_one' option
1 parent 96fdd40 commit 86638c1

File tree

2 files changed

+7
-49
lines changed

2 files changed

+7
-49
lines changed

about_code_tool/genabout.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def process_dje_licenses(self, dje_license_list, dje_license_dict, output_path):
484484
license_list_context.append(gen_path_context)
485485
return license_list_context
486486

487-
def pre_generation(self, gen_location, input_list, action_num, all_in_one):
487+
def pre_generation(self, gen_location, input_list, action_num):
488488
"""
489489
Perfom some pre-generation.
490490
TODO: document me
@@ -506,15 +506,6 @@ def pre_generation(self, gen_location, input_list, action_num, all_in_one):
506506
file_location = join(file_location, basename(file_location))
507507
file_location += '.ABOUT'
508508

509-
if all_in_one:
510-
# This is to get the filename instead of the file path
511-
# Note: The following code is the get the filename instead of
512-
# the file path because the tool is going to put ALL the
513-
# generated ABOUT file into one single directory.
514-
# However, this option will be removed in the later release
515-
# as putting the ALL the ABOUT files in a single directory
516-
# doesn't make very much sense.
517-
file_location = file_location.rpartition('/')[2]
518509
about_file_location = join(gen_location, file_location)
519510
about_file_dir = dirname(about_file_location)
520511
if not os.path.exists(about_file_dir):
@@ -659,11 +650,6 @@ def _exists(location):
659650
3 - Replace the ABOUT file with the current generation
660651
"""
661652

662-
ALL_IN_ONE_HELP = """\
663-
Generate all the ABOUT files in the [output_path] without
664-
any project structure
665-
"""
666-
667653
COPY_FILES_HELP = """\
668654
Copy the '*_file' from the project to the generated location
669655
Project path - Project path
@@ -694,7 +680,6 @@ def _exists(location):
694680
def main(parser, options, args):
695681
verbosity = options.verbosity
696682
action = options.action
697-
all_in_one = options.all_in_one
698683
copy_files_path = options.copy_files
699684
license_text_path = options.license_text_location
700685
mapping_config = options.mapping
@@ -876,8 +861,7 @@ def main(parser, options, args):
876861
dje_license_dict)
877862
components_list = gen.pre_generation(output_path,
878863
input_list,
879-
action_num,
880-
all_in_one)
864+
action_num)
881865
formatted_output = gen.format_output(components_list)
882866
gen.write_output(formatted_output)
883867

@@ -941,8 +925,6 @@ def format_option(self, option):
941925
help=VERBOSITY_HELP)
942926
parser.add_option('--action', type=int,
943927
help=ACTION_HELP)
944-
parser.add_option('--all_in_one', action='store_true',
945-
help=ALL_IN_ONE_HELP)
946928
parser.add_option('--copy_files', type='string',
947929
help=COPY_FILES_HELP)
948930
parser.add_option('--license_text_location', type='string',

about_code_tool/tests/test_genabout.py

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,7 @@ def test_pre_generation_about_is_dir_exists_action_0(self):
446446

447447
result = gen.pre_generation(gen_location,
448448
test_fields,
449-
action_num=0,
450-
all_in_one=False)
449+
action_num=0)
451450
self.assertEqual(expected, result)
452451
self.assertFalse(gen.warnings, 'No warnings should be returned.')
453452
self.assertFalse(gen.errors, 'No errors should be returned.')
@@ -462,8 +461,7 @@ def test_pre_generation_about_exists_action_0(self):
462461
expected = []
463462
result = gen.pre_generation(gen_location,
464463
test_fields,
465-
action_num=0,
466-
all_in_one=False)
464+
action_num=0)
467465
self.assertEqual(expected, result)
468466
self.assertTrue(len(gen.warnings) == 1, 'Should return 1 warnings.')
469467
self.assertFalse(gen.errors, 'No errors should be returned.')
@@ -483,8 +481,7 @@ def test_pre_generation_about_exists_action_1(self):
483481
'name': 'ABOUT tool'}]]
484482

485483
result = gen.pre_generation(GEN_LOCATION, test_fields,
486-
action_num=1,
487-
all_in_one=False)
484+
action_num=1)
488485
self.assertEqual(expected, result)
489486
self.assertFalse(gen.warnings, 'No warnings should be returned.')
490487
self.assertFalse(gen.errors, 'No errors should be returned.')
@@ -507,8 +504,7 @@ def test_pre_generation_about_exists_action_2(self):
507504

508505
result = gen.pre_generation(GEN_LOCATION,
509506
test_input,
510-
action_num=2,
511-
all_in_one=False)
507+
action_num=2)
512508
self.assertEqual(expected, result)
513509
self.assertFalse(gen.warnings, 'No warnings should be returned.')
514510
self.assertFalse(gen.errors, 'No errors should be returned.')
@@ -530,32 +526,12 @@ def test_pre_generation_about_exists_action_3(self):
530526

531527
result = gen.pre_generation(GEN_LOCATION,
532528
test_fields,
533-
action_num=3,
534-
all_in_one=False)
529+
action_num=3)
535530

536531
self.assertEqual(expected, result)
537532
self.assertFalse(gen.warnings, 'No warnings should be returned.')
538533
self.assertFalse(gen.errors, 'No errors should be returned.')
539534

540-
def test_pre_generation_all_in_one(self):
541-
gen = genabout.GenAbout()
542-
test_fields = [{'about_file': 'test_generation/elasticsearch.ABOUT',
543-
'version': '0.19.8',
544-
'about_resource': 'elasticsearch-0.19.8.zip',
545-
'name': 'ElasticSearch'}]
546-
expected = []
547-
result = gen.pre_generation(GEN_LOCATION,
548-
test_fields,
549-
action_num=0,
550-
all_in_one=True)
551-
552-
self.assertFalse(os.path.exists('testdata/test_files_for_genabout/test_generation'),
553-
'This directory should not be generted as the all_in_one is set to True.')
554-
555-
self.assertEqual(expected, result)
556-
self.assertTrue(len(gen.warnings) == 1, 'Should return 1 warning.')
557-
self.assertFalse(gen.errors, 'No errors should be returned.')
558-
559535
def test_format_output(self):
560536
gen = genabout.GenAbout()
561537
test_fields = [

0 commit comments

Comments
 (0)