@@ -852,6 +852,200 @@ def run(self):
852852 return
853853
854854
855+ class MessageConcatenation (CommandMixin ):
856+ description = 'concatenates and merges the specified PO files'
857+ user_options = [
858+ ('input-files' , None , '' ),
859+ ('files-from=' , 'f' , '' ),
860+ ('directory=' , 'D' , '' ),
861+ ('output-file=' , 'o' , '' ),
862+ ('less-than=' , '<' , '' ),
863+ ('more-than=' , '>' , '' ),
864+ ('unique' , 'u' , '' ),
865+ ('properties-input' , 'P' , '' ),
866+ ('stringtable-input' , None , '' ),
867+ ('to-code=' ,'t' , '' ),
868+ ('use-first' , None , '' ),
869+ ('lang=' , None , '' ),
870+ ('color=' , None , '' ),
871+ ('style=' , None , '' ),
872+ ('no-escape' , 'e' , '' ),
873+ ('escape' , 'E' , '' ),
874+ ('force-po' , None , '' ),
875+ ('indent' , 'i' , '' ),
876+ ('no-location' , None , '' ),
877+ ('add-location' , 'n' , '' ),
878+ ('strict' , None , '' ),
879+ ('properties-output' , None , '' ),
880+ ('stringtable-output' , None , '' ),
881+ ('width=' , 'w' , '' ),
882+ ('no-wrap' , None , '' ),
883+ ('sort-output' , 's' , '' ),
884+ ('sort-by-file' , 'F' , '' ),
885+ ]
886+
887+ as_args = 'input-files'
888+
889+ boolean_options = [
890+ 'unique' ,
891+ 'properties-input' ,
892+ 'stringtable-input' ,
893+ 'use-first' ,
894+ 'no-escape' ,
895+ 'escape' ,
896+ 'force-po' ,
897+ 'indent' ,
898+ 'no-location' ,
899+ 'add-location' ,
900+ 'strict' ,
901+ 'properties-output' ,
902+ 'stringtable-output' ,
903+ 'no-wrap' ,
904+ 'sort-output' ,
905+ 'sort-by-file' ,
906+ ]
907+
908+ option_choices = {
909+ 'color' : ('always' , 'never' , 'auto' , 'html' ),
910+ }
911+
912+ def initialize_options (self ):
913+ self .input_files = None
914+ self .files_from = None
915+ self .directory = None
916+ self .output_file = None
917+ self .less_than = None
918+ self .more_than = None
919+ self .unique = None
920+ self .properties_input = None
921+ self .stringtable_input = None
922+ self .to_code = None
923+ self .use_first = None
924+ self .lang = None
925+ self .color = None
926+ self .color = None
927+ self .style = None
928+ self .no_escape = None
929+ self .escape = None
930+ self .force_po = None
931+ self .indent = None
932+ self .no_location = None
933+ self .add_location = None
934+ self .strict = None
935+ self .properties_output = None
936+ self .stringtable_output = None
937+ self .width = None
938+ self .no_wrap = None
939+ self .sort_output = None
940+ self .sort_by_file = None
941+
942+ def finalize_options (self ):
943+ pass
944+
945+ def run (self ):
946+ pass
947+
948+
949+ class MessageMerge (CommandMixin ):
950+ description = 'combines two Uniforum-style PO files into one'
951+ user_options = [
952+ ('input-files' , None , '' ),
953+ ('directory=' , 'D' , '' ),
954+ ('compendium=' , 'C' , '' ),
955+ ('update' , 'U' , '' ),
956+ ('output-file=' , 'o' , '' ),
957+ ('backup=' , None , '' ),
958+ ('suffix=' , None , '' ),
959+ ('multi-domain' , 'm' , '' ),
960+ ('for-msgfmt' , None , '' ),
961+ ('no-fuzzy-matching' , 'N' , '' ),
962+ ('previous' , None , '' ),
963+ ('properties-input' , 'P' , '' ),
964+ ('stringtable-input' , None , '' ),
965+ ('lang=' , None , '' ),
966+ ('color=' , None , '' ),
967+ ('style=' , None , '' ),
968+ ('no-escape' , 'e' , '' ),
969+ ('escape' , 'E' , '' ),
970+ ('force-po' , None , '' ),
971+ ('indent' , 'i' , '' ),
972+ ('no-location' , None , '' ),
973+ ('add-location' , 'n' , '' ),
974+ ('strict' , None , '' ),
975+ ('properties-output' , None , '' ),
976+ ('stringtable-output' , None , '' ),
977+ ('width=' , 'w' , '' ),
978+ ('no-wrap' , None , '' ),
979+ ('sort-output' , 's' , '' ),
980+ ('sort-by-file' , 'F' , '' ),
981+ ]
982+
983+ as_args = 'input-files'
984+
985+ boolean_options = [
986+ 'update' ,
987+ 'multi-domain' ,
988+ 'for-msgfmt' ,
989+ 'no-fuzzy-matching' ,
990+ 'previous'
991+ 'properties-input' ,
992+ 'stringtable-input' ,
993+ 'no-escape' ,
994+ 'escape' ,
995+ 'force-po' ,
996+ 'indent' ,
997+ 'no-location' ,
998+ 'add-location' ,
999+ 'strict' ,
1000+ 'properties-output' ,
1001+ 'stringtable-output' ,
1002+ 'no-wrap' ,
1003+ 'sort-output' ,
1004+ 'sort-by-file' ,
1005+ ]
1006+
1007+ option_choices = {
1008+ 'color' : ('always' , 'never' , 'auto' , 'html' ),
1009+ }
1010+
1011+ def initialize_options (self ):
1012+ self .input_files = None
1013+ self .directory = None
1014+ self .compendium = None
1015+ self .update = None
1016+ self .output_file = None
1017+ self .backup = None
1018+ self .suffix = None
1019+ self .multi_domain = None
1020+ self .for_msgfmt = None
1021+ self .no_fuzzy_matching = None
1022+ self .previous = None
1023+ self .properties_input = None
1024+ self .stringtable_input = None
1025+ self .lang = None
1026+ self .color = None
1027+ self .style = None
1028+ self .no_escape = None
1029+ self .escape = None
1030+ self .force_po = None
1031+ self .indent = None
1032+ self .no_location = None
1033+ self .add_location = None
1034+ self .strict = None
1035+ self .properties_output = None
1036+ self .stringtable_output = None
1037+ self .width = None
1038+ self .no_wrap = None
1039+ self .sort_output = None
1040+ self .sort_by_file = None
1041+
1042+ def finalize_options (self ):
1043+ pass
1044+
1045+ def run (self ):
1046+ pass
1047+
1048+
8551049class CommandLineInterface :
8561050 """Command-line interface.
8571051
@@ -866,13 +1060,17 @@ class CommandLineInterface:
8661060 'extract' : 'extract messages from source files and generate a POT file' ,
8671061 'init' : 'create new message catalogs from a POT file' ,
8681062 'update' : 'update existing message catalogs from a POT file' ,
1063+ 'msgcat' : 'concatenates and merges the specified PO files' ,
1064+ 'msgmerge' : 'combines two Uniforum-style PO files into one' ,
8691065 }
8701066
8711067 command_classes = {
8721068 'compile' : CompileCatalog ,
8731069 'extract' : ExtractMessages ,
8741070 'init' : InitCatalog ,
8751071 'update' : UpdateCatalog ,
1072+ 'msgcat' : MessageConcatenation ,
1073+ 'msgmerge' : MessageMerge ,
8761074 }
8771075
8781076 log = None # Replaced on instance level
0 commit comments