Пример #1
0
    jabber_group.add_option(
        '--jabber-server-port',
        default='5222',
        action='store',
        help="The port of your Jabber server. This is only needed if "
        "your server is missing SRV records")

    parser.add_option_group(jabber_group)
    parser.add_option_group(zulip.generate_option_group(parser, "zulip-"))
    (options, args) = parser.parse_args()

    logging.basicConfig(level=options.log_level,
                        format='%(levelname)-8s %(message)s')

    if options.zulip_config_file is None:
        config_file = zulip.get_default_config_filename()
    else:
        config_file = options.zulip_config_file

    config = SafeConfigParser()
    try:
        with open(config_file, 'r') as f:
            config.readfp(f, config_file)
    except IOError:
        pass
    for option in ("jid", "jabber_password", "conference_domain", "mode",
                   "zulip_email_suffix", "jabber_server_address",
                   "jabber_server_port"):
        if (getattr(options, option) is None
                and config.has_option("jabber_mirror", option)):
            setattr(options, option, config.get("jabber_mirror", option))
Пример #2
0
                            "your server is missing SRV records")
    jabber_group.add_option('--jabber-server-port',
                            default='5222',
                            action='store',
               help="The port of your Jabber server. This is only needed if "
                            "your server is missing SRV records")

    parser.add_option_group(jabber_group)
    parser.add_option_group(zulip.generate_option_group(parser, "zulip-"))
    (options, args) = parser.parse_args()

    logging.basicConfig(level=options.log_level,
                        format='%(levelname)-8s %(message)s')

    if options.zulip_config_file is None:
        config_file = zulip.get_default_config_filename()
    else:
        config_file = options.zulip_config_file

    config = SafeConfigParser()
    try:
        with open(config_file, 'r') as f:
            config.readfp(f, config_file)
    except IOError:
        pass
    for option in ("jid", "jabber_password", "conference_domain", "mode", "zulip_email_suffix",
                   "jabber_server_address", "jabber_server_port"):
        if (getattr(options, option) is None
            and config.has_option("jabber_mirror", option)):
            setattr(options, option, config.get("jabber_mirror", option))