o Sb@sdZddlZddlZddlmZddlmZmZmZddl m Z m Z ddl m Z ddlmZddlmZdd lmZGd d d eZdS) z&Represent MongoClient's configuration.N)ObjectId)commonmonitorpool)LOCAL_THRESHOLD_MSSERVER_SELECTION_TIMEOUT)ConfigurationError) PoolOptionsServerDescription) TOPOLOGY_TYPEc@seZdZddddddeeejddddejdfddZe ddZ e dd Z e d d Z e d d Z e ddZe ddZe ddZe ddZe ddZe ddZe ddZe ddZe ddZe d d!Ze d"d#Zd$d%Zd&d'ZdS)(TopologySettingsNFrcCs| tjkrtdtjdf|pdg|_||_|ptj|_|p"t|_ |p(t j |_ |p.t j|_||_||_| |_| |_| |_| |_| |_||_|pKd|_t|_dt|_dS)zyRepresent MongoClient's configuration. Take a list of (host, port) pairs and optional replica set name. z+heartbeatFrequencyMS cannot be less than %di) localhostiirN)rZMIN_HEARTBEAT_INTERVALr_seeds_replica_set_namerZPool _pool_classr _pool_optionsrZMonitor_monitor_class threading Condition_condition_class_local_threshold_ms_server_selection_timeout_server_selector_fqdn_heartbeat_frequency_direct_load_balanced_srv_service_name_srv_max_hostsrZ _topology_idjoin traceback format_stack_stack)selfseedsreplica_set_name pool_class pool_options monitor_classcondition_classlocal_threshold_msserver_selection_timeoutheartbeat_frequencyserver_selectorfqdnZdirect_connection load_balancedsrv_service_name srv_max_hostsr47/tmp/pip-target-onvjaxws/lib/python/pymongo/settings.py__init__s.        zTopologySettings.__init__cC|jS)zList of server addresses.)rr%r4r4r5r&OzTopologySettings.seedscCr7N)rr8r4r4r5r'Tz!TopologySettings.replica_set_namecCr7r:)rr8r4r4r5r(Xr;zTopologySettings.pool_classcCr7r:)rr8r4r4r5r)\r;zTopologySettings.pool_optionscCr7r:)rr8r4r4r5r*`r;zTopologySettings.monitor_classcCr7r:)rr8r4r4r5r+dr;z TopologySettings.condition_classcCr7r:)rr8r4r4r5r,hr;z#TopologySettings.local_threshold_mscCr7r:)rr8r4r4r5r-lr;z)TopologySettings.server_selection_timeoutcCr7r:)rr8r4r4r5r/pr;z TopologySettings.server_selectorcCr7r:)rr8r4r4r5r.tr;z$TopologySettings.heartbeat_frequencycCr7r:)rr8r4r4r5r0xr;zTopologySettings.fqdncCr7)zConnect directly to a single server, or use a set of servers? True if there is one seed and no replica_set_name. )rr8r4r4r5direct|szTopologySettings.directcCr7)z@True if the client was configured to connect to a load balancer.)rr8r4r4r5r1r9zTopologySettings.load_balancedcCr7)zThe srvServiceName.)rr8r4r4r5r2r9z!TopologySettings.srv_service_namecCr7)zThe srvMaxHosts.)r r8r4r4r5r3r9zTopologySettings.srv_max_hostscCs.|jrtjS|jr tjS|jdurtjStjSr:)r1r Z LoadBalancedr<Singler'ZReplicaSetNoPrimaryUnknownr8r4r4r5get_topology_types z"TopologySettings.get_topology_typecCstdd|jDS)z;Initial dict of (address, ServerDescription) for all seeds.cSsg|]}|t|fqSr4r ).0addressr4r4r5 sz.)dictr&r8r4r4r5get_server_descriptionssz(TopologySettings.get_server_descriptions)__name__ __module__ __qualname__rrrZHEARTBEAT_FREQUENCYZSRV_SERVICE_NAMEr6propertyr&r'r(r)r*r+r,r-r/r.r0r<r1r2r3r?rDr4r4r4r5r sb 1                r )__doc__rr"Z bson.objectidrZpymongorrrZpymongo.commonrrZpymongo.errorsrZ pymongo.poolr Zpymongo.server_descriptionr Zpymongo.topology_descriptionr objectr r4r4r4r5s