示例#1
0
 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))
示例#2
0
文件: info.py 项目: danlg/zato
    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))
示例#3
0
文件: info.py 项目: azazel75/zato
 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)
示例#4
0
文件: info.py 项目: dangnammta/zato
 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)
示例#5
0
 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))