Example #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))
Example #2
0
File: info.py Project: 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))
Example #3
0
 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)
Example #4
0
 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)
Example #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))