@@ -654,7 +654,7 @@ def filter_empty_values(abouts):
654654
655655def main (parser , options , args ):
656656 """
657- Main commnad line entry point.
657+ Main commnand line entry point.
658658 """
659659 verbosity = options .verbosity
660660 action = options .action
@@ -684,25 +684,25 @@ def main(parser, options, args):
684684 if action in valid_actions :
685685 action_num = action
686686 else :
687- print ('Invalid action: should be 0, 1, 2 or 3' )
687+ print ('ERROR: Invalid action: must be one of: 0, 1, 2 or 3' )
688688 sys .exit (errno .EINVAL )
689689
690690 if copy_files_path :
691691 # code to handle tilde character
692692 copy_files_path = os .path .abspath (expanduser (copy_files_path ))
693693 if not path_exists (copy_files_path ):
694- print ("The project path does not exist." )
694+ print ("ERROR: The COPY_FILES path does not exist." )
695695 sys .exit (errno .EINVAL )
696696
697697 if license_text_path :
698698 # code to handle tilde character
699699 license_text_path = os .path .abspath (expanduser (license_text_path ))
700700 if not path_exists (license_text_path ):
701- print ("The license text path does not exist." )
701+ print ("ERROR: LICENSE_TEXT_LOCATION path does not exist." )
702702 sys .exit (errno .EINVAL )
703703
704704 if mapping_config and not path_exists ('MAPPING.CONFIG' ):
705- print ("The file 'MAPPING.CONFIG' does not exist." )
705+ print ("ERROR: The file 'MAPPING.CONFIG' does not exist." )
706706 sys .exit (errno .EINVAL )
707707
708708 if extract_license :
@@ -712,7 +712,7 @@ def main(parser, options, args):
712712 gen_license = True
713713
714714 if not len (args ) == 2 :
715- print ('Input and Output paths are required.' )
715+ print ('ERROR: <input_path> and <utput_path> are required.' )
716716 print ()
717717 parser .print_help ()
718718 sys .exit (errno .EEXIST )
@@ -724,25 +724,25 @@ def main(parser, options, args):
724724 output_path += '/'
725725
726726 if not exists (input_path ):
727- print ('Input path does not exist.' )
727+ print ('ERROR: <input_path> file does not exist.' )
728728 print ()
729729 parser .print_help ()
730730 sys .exit (errno .EEXIST )
731731
732732 if not exists (output_path ):
733- print ('Output path does not exist.' )
733+ print ('ERROR: <output_path> directory does not exist.' )
734734 print ()
735735 parser .print_help ()
736736 sys .exit (errno .EEXIST )
737737
738738 if not isdir (output_path ):
739- print ('Output must be a directory, not a file.' )
739+ print ('ERROR: <output_path> must be a directory, not a file.' )
740740 print ()
741741 parser .print_help ()
742742 sys .exit (errno .EISDIR )
743743
744744 if not input_path .endswith ('.csv' ):
745- print ("Input file name must be a CSV file ends with '.csv'" )
745+ print ("ERROR: <input_path> file must be a CSV file ends with '.csv'" )
746746 print ()
747747 parser .print_help ()
748748 sys .exit (errno .EINVAL )
@@ -751,8 +751,8 @@ def main(parser, options, args):
751751
752752 dup_keys = gen .get_duplicated_keys (input_path )
753753 if dup_keys :
754- print ('The input file contains duplicated keys. '
755- 'Duplicated keys are not allowed.' )
754+ print ('ERROR: The <input_path> CSV file contains duplicated column keys. '
755+ 'Duplicated column keys are not allowed.' )
756756 print (dup_keys )
757757 print ()
758758 print ('Please fix the input file and re-run the tool.' )
@@ -783,43 +783,43 @@ def main(parser, options, args):
783783
784784 if copy_files_path :
785785 if not isdir (copy_files_path ):
786- print ("The COPY_FILES path must be a directory." )
787- print ("'--copy_files' is skipped ." )
786+ print ("WARNING: The COPY_FILES path must be a directory." )
787+ print ("'--copy_files' option ignored ." )
788788 else :
789789 licenses_in_project = True
790790 license_list = gen .verify_files_existence (input_list ,
791791 copy_files_path ,
792792 licenses_in_project )
793793 if not license_list :
794- print ("None of the file was found. '--copy_files' is ignored." )
794+ print ("WARNING: No file found. '--copy_files' is ignored." )
795795 else :
796796 gen .copy_files (output_path , license_list )
797797
798798 if license_text_path :
799799 if not isdir (license_text_path ):
800- print ("The LICENSE_TEXT_LOCATION path must be a directory." )
801- print ("'--license_text_location' is skipped ." )
800+ print ("WARNING: The LICENSE_TEXT_LOCATION path must be a directory." )
801+ print ("'--license_text_location' option ignored ." )
802802 else :
803803 licenses_in_project = False
804804 license_list = gen .verify_files_existence (input_list ,
805805 license_text_path ,
806806 licenses_in_project )
807807 if not license_list :
808- print ("None of the file was found. '--copy_files' is ignored." )
808+ print ("WARNING: No file found. '--copy_files' option ignored." )
809809 else :
810810 gen .copy_files (output_path , license_list )
811811
812812 if extract_license :
813813 if not api_url or not api_username or not api_key :
814- print ("Missing argument for --extract_license" )
814+ print ("ERROR: Missing argument for --extract_license" )
815815 sys .exit (errno .EINVAL )
816816 for line in input_list :
817817 try :
818818 if line ['dje_license_key' ]:
819819 break
820820 except Exception as e :
821821 print (repr (e ))
822- print ("The <input_path> CSV does not contain the required column 'dje_license_key' " )
822+ print ("ERROR: The <input_path> CSV does not contain the required column 'dje_license_key' " )
823823 sys .exit (errno .EINVAL )
824824
825825 if gen_license :
0 commit comments