def _on_server(self, args): os.chdir(self.original_dir) info = get_info(os.path.abspath(args.path), args.format) self.logger.info( format_info( info, args.format, args.cols_width if args.cols_width else DEFAULT_COLS_WIDTH, _Dumper))
def _on_server(self, args): # stdlib import os # yaml import yaml # Zato from zato.common.component_info import format_info, get_info class _Dumper(yaml.SafeDumper): def represent_none(self, data): return self.represent_scalar('tag:yaml.org,2002:null', '') os.chdir(self.original_dir) info = get_info(os.path.abspath(args.path), args.format) self.logger.info( format_info( info, args.format, args.cols_width if args.cols_width else DEFAULT_COLS_WIDTH, _Dumper))
def handle(self): self.response.content_type = 'application/json' self.response.payload.info = format_info(get_info(self.server.base_dir, INFO_FORMAT.JSON), INFO_FORMAT.JSON)
def handle(self): self.response.content_type = 'application/json' self.response.payload.info = format_info( get_info(self.server.base_dir, INFO_FORMAT.JSON), INFO_FORMAT.JSON)
def _on_server(self, args): os.chdir(self.original_dir) info = get_info(os.path.abspath(args.path), args.format) self.logger.info(format_info(info, args.format, args.cols_width if args.cols_width else DEFAULT_COLS_WIDTH, _Dumper))