@command('file', optional=['input-filename', 'output-filename'])
def file_command(options, input_filename=None, output_filename=None):
 with open_input_file(input_filename) as input_file:
  descriptor_content = input_file.read()
 if output_filename:
  output_file = open(output_filename, 'w')
 else:
  output_file = sys.stdout
 file_descriptor = protobuf.decode_message(descriptor.FileDescriptor, descriptor_content)
 generate_python.format_python_file(file_descriptor, output_file)

@ command ( 'file' , optional = [ 'input-filename' , 'output-filename' ] ) def file_command ( options , input_filename = None , output_filename = None ) : with open_input_file ( input_filename ) as input_file : descriptor_content = input_file . read ( ) if output_filename : output_file = open ( output_filename , 'w' ) else : output_file = sys . stdout file_descriptor = protobuf . decode_message ( descriptor . FileDescriptor , descriptor_content ) generate_python . format_python_file ( file_descriptor , output_file )
generate a single descriptor file to python .