<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import division <EOL> from __future__ import print_function <EOL> import argparse <EOL> import phlcon_differential <EOL> import phlcon_user <EOL> import phlsys_makeconduit <EOL> def getFromfilePrefixChars ( ) : <EOL> return "<STR_LIT>" <EOL> def setupParser ( parser ) : <EOL> diffsrc_group = parser . add_argument_group ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> diffsrc = diffsrc_group . add_mutually_exclusive_group ( required = True ) <EOL> req = parser . add_argument_group ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> opt = parser . add_argument_group ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> output_group = parser . add_argument_group ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> output = output_group . add_mutually_exclusive_group ( ) <EOL> diffsrc . add_argument ( <EOL> '<STR_LIT>' , <EOL> metavar = '<STR_LIT>' , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> type = int ) <EOL> diffsrc . add_argument ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> metavar = '<STR_LIT>' , <EOL> type = argparse . FileType ( '<STR_LIT:r>' ) ) <EOL> req . add_argument ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> metavar = '<STR_LIT>' , <EOL> required = True , <EOL> help = '<STR_LIT>' , <EOL> type = str ) <EOL> req . add_argument ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> metavar = '<STR_LIT>' , <EOL> required = True , <EOL> help = '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> type = str ) <EOL> opt . add_argument ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> metavar = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> type = str ) <EOL> opt . add_argument ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> nargs = "<STR_LIT:*>" , <EOL> metavar = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> type = str ) <EOL> opt . add_argument ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT:-c>' , <EOL> nargs = "<STR_LIT:*>" , <EOL> metavar = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , <EOL> type = str ) <EOL> output . add_argument ( <EOL> '<STR_LIT>' , <EOL> action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' ) <EOL> output . add_argument ( <EOL> '<STR_LIT>' , <EOL> action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' ) <EOL> output . add_argument ( <EOL> '<STR_LIT>' , <EOL> action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' ) <EOL> phlsys_makeconduit . add_argparse_arguments ( parser ) <EOL> def process ( args ) : <EOL> conduit = phlsys_makeconduit . make_conduit ( <EOL> args . uri , args . user , args . cert , args . act_as_user ) <EOL> if args . diff_id : <EOL> diff_id = args . diff_id <EOL> else : <EOL> d = { '<STR_LIT>' : args . raw_diff_file . read ( ) } <EOL> diff_id = conduit ( "<STR_LIT>" , d ) [ "<STR_LIT:id>" ] <EOL> fields = { } <EOL> MessageFields = phlcon_differential . MessageFields <EOL> if args . reviewers : <EOL> fields [ MessageFields . reviewer_phids ] = args . reviewers <EOL> if args . ccs : <EOL> fields [ MessageFields . cc_phids ] = args . ccs <EOL> user_phids = phlcon_user . UserPhidCache ( conduit ) <EOL> for users in fields . itervalues ( ) : <EOL> user_phids . add_hint_list ( users ) <EOL> for key in fields . iterkeys ( ) : <EOL> fields [ key ] = [ user_phids . get_phid ( u ) for u in fields [ key ] ] <EOL> fields [ MessageFields . title ] = args . title <EOL> fields [ MessageFields . test_plan ] = args . test_plan <EOL> if args . summary : <EOL> fields [ MessageFields . summary ] = args . summary <EOL> d = { '<STR_LIT>' : diff_id , '<STR_LIT>' : fields } <EOL> result = conduit ( "<STR_LIT>" , d ) <EOL> if args . format_id : <EOL> print ( result [ "<STR_LIT>" ] ) <EOL> elif args . format_url : <EOL> print ( result [ "<STR_LIT>" ] ) <EOL> else : <EOL> print ( ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) . format ( <EOL> rev_id = result [ "<STR_LIT>" ] , <EOL> url = result [ "<STR_LIT>" ] ) ) </s>
