parameters: (self, printer)
docstring: Write a simple CLI (currently just a stub).
docstring_summary: Write a simple CLI (currently just a stub).
docstring_tokens: Write a simple CLI ( currently just a stub ) .
function: def WriteFile(self, printer):
          """Write a simple CLI (currently just a stub)."""
          printer('#!/usr/bin/env python')
          printer('"""CLI for %s, version %s."""',
                  self.__package, self.__version)
          printer('# NOTE: This file is autogenerated and should not be edited '
                  'by hand.')
          # TODO(craigcitro): Add a build stamp, along with some other
          # information.
          printer()
          printer('import code')
          printer('import os')
          printer('import platform')
          printer('import sys')
          printer()
          printer('import protorpc')
          printer('from protorpc import message_types')
          printer('from protorpc import messages')
          printer()
          appcommands_import = 'from google.apputils import appcommands'
          printer(appcommands_import)
  
          flags_import = 'import gflags as flags'
          printer(flags_import)
          printer()
          printer('import %s as apitools_base', self.__base_files_package)
          printer('from %s import cli as apitools_base_cli',
                  self.__base_files_package)
          import_prefix = ''
          printer('%simport %s as client_lib',
                  import_prefix, self.__client_info.client_rule_name)
          printer('%simport %s as messages',
                  import_prefix, self.__client_info.messages_rule_name)
          self.__PrintFlagDeclarations(printer)
          printer()
          printer()
          self.__PrintGetGlobalParams(printer)
          self.__PrintGetClient(printer)
          self.__PrintPyShell(printer)
          self.__PrintCommands(printer)
          printer('def main(_):')
          with printer.Indent():
              printer("appcommands.AddCmd('pyshell', PyShell)")
              for command_info in self.__command_list:
                  printer("appcommands.AddCmd('%s', %s)",
                          command_info.name, command_info.class_name)
              printer()
              printer('apitools_base_cli.SetupLogger()')
              # TODO(craigcitro): Just call SetDefaultCommand as soon as
              # another appcommands release happens and this exists
              # externally.
              printer("if hasattr(appcommands, 'SetDefaultCommand'):")
              with printer.Indent():
                  printer("appcommands.SetDefaultCommand('pyshell')")
          printer()
          printer()
          printer('run_main = apitools_base_cli.run_main')
          printer()
          printer("if __name__ == '__main__':")
          with printer.Indent():
              printer('appcommands.Run()')
function_tokens: def WriteFile ( self , printer ) : printer ( '#!/usr/bin/env python' ) printer ( '"""CLI for %s, version %s."""' , self . __package , self . __version ) printer ( '# NOTE: This file is autogenerated and should not be edited ' 'by hand.' ) # TODO(craigcitro): Add a build stamp, along with some other # information. printer ( ) printer ( 'import code' ) printer ( 'import os' ) printer ( 'import platform' ) printer ( 'import sys' ) printer ( ) printer ( 'import protorpc' ) printer ( 'from protorpc import message_types' ) printer ( 'from protorpc import messages' ) printer ( ) appcommands_import = 'from google.apputils import appcommands' printer ( appcommands_import ) flags_import = 'import gflags as flags' printer ( flags_import ) printer ( ) printer ( 'import %s as apitools_base' , self . __base_files_package ) printer ( 'from %s import cli as apitools_base_cli' , self . __base_files_package ) import_prefix = '' printer ( '%simport %s as client_lib' , import_prefix , self . __client_info . client_rule_name ) printer ( '%simport %s as messages' , import_prefix , self . __client_info . messages_rule_name ) self . __PrintFlagDeclarations ( printer ) printer ( ) printer ( ) self . __PrintGetGlobalParams ( printer ) self . __PrintGetClient ( printer ) self . __PrintPyShell ( printer ) self . __PrintCommands ( printer ) printer ( 'def main(_):' ) with printer . Indent ( ) : printer ( "appcommands.AddCmd('pyshell', PyShell)" ) for command_info in self . __command_list : printer ( "appcommands.AddCmd('%s', %s)" , command_info . name , command_info . class_name ) printer ( ) printer ( 'apitools_base_cli.SetupLogger()' ) # TODO(craigcitro): Just call SetDefaultCommand as soon as # another appcommands release happens and this exists # externally. printer ( "if hasattr(appcommands, 'SetDefaultCommand'):" ) with printer . Indent ( ) : printer ( "appcommands.SetDefaultCommand('pyshell')" ) printer ( ) printer ( ) printer ( 'run_main = apitools_base_cli.run_main' ) printer ( ) printer ( "if __name__ == '__main__':" ) with printer . Indent ( ) : printer ( 'appcommands.Run()' )