@@ -887,6 +887,200 @@ def run(self):
887887 return
888888
889889
890+ class MessageConcatenation (CommandMixin ):
891+ description = 'concatenates and merges the specified PO files'
892+ user_options = [
893+ ('input-files' , None , '' ),
894+ ('files-from=' , 'f' , '' ),
895+ ('directory=' , 'D' , '' ),
896+ ('output-file=' , 'o' , '' ),
897+ ('less-than=' , '<' , '' ),
898+ ('more-than=' , '>' , '' ),
899+ ('unique' , 'u' , '' ),
900+ ('properties-input' , 'P' , '' ),
901+ ('stringtable-input' , None , '' ),
902+ ('to-code=' ,'t' , '' ),
903+ ('use-first' , None , '' ),
904+ ('lang=' , None , '' ),
905+ ('color=' , None , '' ),
906+ ('style=' , None , '' ),
907+ ('no-escape' , 'e' , '' ),
908+ ('escape' , 'E' , '' ),
909+ ('force-po' , None , '' ),
910+ ('indent' , 'i' , '' ),
911+ ('no-location' , None , '' ),
912+ ('add-location' , 'n' , '' ),
913+ ('strict' , None , '' ),
914+ ('properties-output' , None , '' ),
915+ ('stringtable-output' , None , '' ),
916+ ('width=' , 'w' , '' ),
917+ ('no-wrap' , None , '' ),
918+ ('sort-output' , 's' , '' ),
919+ ('sort-by-file' , 'F' , '' ),
920+ ]
921+
922+ as_args = 'input-files'
923+
924+ boolean_options = [
925+ 'unique' ,
926+ 'properties-input' ,
927+ 'stringtable-input' ,
928+ 'use-first' ,
929+ 'no-escape' ,
930+ 'escape' ,
931+ 'force-po' ,
932+ 'indent' ,
933+ 'no-location' ,
934+ 'add-location' ,
935+ 'strict' ,
936+ 'properties-output' ,
937+ 'stringtable-output' ,
938+ 'no-wrap' ,
939+ 'sort-output' ,
940+ 'sort-by-file' ,
941+ ]
942+
943+ option_choices = {
944+ 'color' : ('always' , 'never' , 'auto' , 'html' ),
945+ }
946+
947+ def initialize_options (self ):
948+ self .input_files = None
949+ self .files_from = None
950+ self .directory = None
951+ self .output_file = None
952+ self .less_than = None
953+ self .more_than = None
954+ self .unique = None
955+ self .properties_input = None
956+ self .stringtable_input = None
957+ self .to_code = None
958+ self .use_first = None
959+ self .lang = None
960+ self .color = None
961+ self .color = None
962+ self .style = None
963+ self .no_escape = None
964+ self .escape = None
965+ self .force_po = None
966+ self .indent = None
967+ self .no_location = None
968+ self .add_location = None
969+ self .strict = None
970+ self .properties_output = None
971+ self .stringtable_output = None
972+ self .width = None
973+ self .no_wrap = None
974+ self .sort_output = None
975+ self .sort_by_file = None
976+
977+ def finalize_options (self ):
978+ pass
979+
980+ def run (self ):
981+ pass
982+
983+
984+ class MessageMerge (CommandMixin ):
985+ description = 'combines two Uniforum-style PO files into one'
986+ user_options = [
987+ ('input-files' , None , '' ),
988+ ('directory=' , 'D' , '' ),
989+ ('compendium=' , 'C' , '' ),
990+ ('update' , 'U' , '' ),
991+ ('output-file=' , 'o' , '' ),
992+ ('backup=' , None , '' ),
993+ ('suffix=' , None , '' ),
994+ ('multi-domain' , 'm' , '' ),
995+ ('for-msgfmt' , None , '' ),
996+ ('no-fuzzy-matching' , 'N' , '' ),
997+ ('previous' , None , '' ),
998+ ('properties-input' , 'P' , '' ),
999+ ('stringtable-input' , None , '' ),
1000+ ('lang=' , None , '' ),
1001+ ('color=' , None , '' ),
1002+ ('style=' , None , '' ),
1003+ ('no-escape' , 'e' , '' ),
1004+ ('escape' , 'E' , '' ),
1005+ ('force-po' , None , '' ),
1006+ ('indent' , 'i' , '' ),
1007+ ('no-location' , None , '' ),
1008+ ('add-location' , 'n' , '' ),
1009+ ('strict' , None , '' ),
1010+ ('properties-output' , None , '' ),
1011+ ('stringtable-output' , None , '' ),
1012+ ('width=' , 'w' , '' ),
1013+ ('no-wrap' , None , '' ),
1014+ ('sort-output' , 's' , '' ),
1015+ ('sort-by-file' , 'F' , '' ),
1016+ ]
1017+
1018+ as_args = 'input-files'
1019+
1020+ boolean_options = [
1021+ 'update' ,
1022+ 'multi-domain' ,
1023+ 'for-msgfmt' ,
1024+ 'no-fuzzy-matching' ,
1025+ 'previous'
1026+ 'properties-input' ,
1027+ 'stringtable-input' ,
1028+ 'no-escape' ,
1029+ 'escape' ,
1030+ 'force-po' ,
1031+ 'indent' ,
1032+ 'no-location' ,
1033+ 'add-location' ,
1034+ 'strict' ,
1035+ 'properties-output' ,
1036+ 'stringtable-output' ,
1037+ 'no-wrap' ,
1038+ 'sort-output' ,
1039+ 'sort-by-file' ,
1040+ ]
1041+
1042+ option_choices = {
1043+ 'color' : ('always' , 'never' , 'auto' , 'html' ),
1044+ }
1045+
1046+ def initialize_options (self ):
1047+ self .input_files = None
1048+ self .directory = None
1049+ self .compendium = None
1050+ self .update = None
1051+ self .output_file = None
1052+ self .backup = None
1053+ self .suffix = None
1054+ self .multi_domain = None
1055+ self .for_msgfmt = None
1056+ self .no_fuzzy_matching = None
1057+ self .previous = None
1058+ self .properties_input = None
1059+ self .stringtable_input = None
1060+ self .lang = None
1061+ self .color = None
1062+ self .style = None
1063+ self .no_escape = None
1064+ self .escape = None
1065+ self .force_po = None
1066+ self .indent = None
1067+ self .no_location = None
1068+ self .add_location = None
1069+ self .strict = None
1070+ self .properties_output = None
1071+ self .stringtable_output = None
1072+ self .width = None
1073+ self .no_wrap = None
1074+ self .sort_output = None
1075+ self .sort_by_file = None
1076+
1077+ def finalize_options (self ):
1078+ pass
1079+
1080+ def run (self ):
1081+ pass
1082+
1083+
8901084class CommandLineInterface :
8911085 """Command-line interface.
8921086
@@ -901,13 +1095,17 @@ class CommandLineInterface:
9011095 'extract' : 'extract messages from source files and generate a POT file' ,
9021096 'init' : 'create new message catalogs from a POT file' ,
9031097 'update' : 'update existing message catalogs from a POT file' ,
1098+ 'msgcat' : 'concatenates and merges the specified PO files' ,
1099+ 'msgmerge' : 'combines two Uniforum-style PO files into one' ,
9041100 }
9051101
9061102 command_classes = {
9071103 'compile' : CompileCatalog ,
9081104 'extract' : ExtractMessages ,
9091105 'init' : InitCatalog ,
9101106 'update' : UpdateCatalog ,
1107+ 'msgcat' : MessageConcatenation ,
1108+ 'msgmerge' : MessageMerge ,
9111109 }
9121110
9131111 log = None # Replaced on instance level
0 commit comments