Beispiel #1
0
    def __init__(self,
                 user="",
                 password="",
                 timeout=10,
                 debug=False,
                 user_agent=DEFAULT_USER_AGENT):
        """
        Initializes the NERIES Web service client.

        :type user: str, optional
        :param user: The user name used for identification with the Web
            service. This entry in form of a email address is required for
            using the following methods:
            * :meth:`~obspy.neries.client.Client.saveWaveform`
            * :meth:`~obspy.neries.client.Client.getWaveform`
            * :meth:`~obspy.neries.client.Client.getInventory`
            Defaults to ``''``.
        :type password: str, optional
        :param password: A password used for authentication with the Web
            service. Defaults to ``''``.
        :type timeout: int, optional
        :param timeout: Seconds before a connection timeout is raised (default
            is 10 seconds). Available only for Python >= 2.6.x.
        :type debug: boolean, optional
        :param debug: Enables verbose output.
        :type user_agent: str, optional
        :param user_agent: Sets an client identification string which may be
            used on server side for statistical analysis (default contains the
            current module version and basic information about the used
            operation system, e.g.
            ``'ObsPy 0.4.7.dev-r2432 (Windows-7-6.1.7601-SP1, Python 2.7.1)'``.
        """
        self.base_url = "http://www.seismicportal.eu"
        self.timeout = timeout
        self.debug = debug
        self.user_agent = user_agent
        self.user = user
        self.password = password
        # Create an OpenerDirector for Basic HTTP Authentication
        password_mgr = compatibility.HTTPPasswordMgrWithDefaultRealm()
        password_mgr.add_password(None, self.base_url, self.user,
                                  self.password)
        auth_handler = compatibility.HTTPBasicAuthHandler(password_mgr)
        opener = compatibility.build_opener(auth_handler)
        # install globally
        compatibility.install_opener(opener)
Beispiel #2
0
    def __init__(self,
                 base_url="http://teide.geophysik.uni-muenchen.de:8080",
                 user="******",
                 password="******",
                 timeout=10,
                 debug=False,
                 retries=3):
        """
        Initializes the SeisHub Web service client.

        :type base_url: str, optional
        :param base_url: SeisHub connection string. Defaults to
            'http://teide.geophysik.uni-muenchen.de:8080'.
        :type user: str, optional
        :param user: The user name used for identification with the Web
            service. Defaults to ``'admin'``.
        :type password: str, optional
        :param password: A password used for authentication with the Web
            service. Defaults to ``'admin'``.
        :type timeout: int, optional
        :param timeout: Seconds before a connection timeout is raised (default
            is 10 seconds). Available only for Python >= 2.6.x.
        :type debug: boolean, optional
        :param debug: Enables verbose output.
        :type retries: int
        :param retries: Number of retries for failing requests.
        """
        self.base_url = base_url
        self.waveform = _WaveformMapperClient(self)
        self.station = _StationMapperClient(self)
        self.event = _EventMapperClient(self)
        self.timeout = timeout
        self.debug = debug
        self.retries = retries
        self.xml_seeds = {}
        self.station_list = {}
        # Create an OpenerDirector for Basic HTTP Authentication
        password_mgr = HTTPPasswordMgrWithDefaultRealm()
        password_mgr.add_password(None, base_url, user, password)
        auth_handler = HTTPBasicAuthHandler(password_mgr)
        opener = build_opener(auth_handler)
        # install globally
        install_opener(opener)
Beispiel #3
0
    def __init__(self, user="", password="", timeout=10, debug=False,
                 user_agent=DEFAULT_USER_AGENT):
        """
        Initializes the NERIES Web service client.

        :type user: str, optional
        :param user: The user name used for identification with the Web
            service. This entry in form of a email address is required for
            using the following methods:
            * :meth:`~obspy.neries.client.Client.saveWaveform`
            * :meth:`~obspy.neries.client.Client.getWaveform`
            * :meth:`~obspy.neries.client.Client.getInventory`
            Defaults to ``''``.
        :type password: str, optional
        :param password: A password used for authentication with the Web
            service. Defaults to ``''``.
        :type timeout: int, optional
        :param timeout: Seconds before a connection timeout is raised (default
            is 10 seconds). Available only for Python >= 2.6.x.
        :type debug: boolean, optional
        :param debug: Enables verbose output.
        :type user_agent: str, optional
        :param user_agent: Sets an client identification string which may be
            used on server side for statistical analysis (default contains the
            current module version and basic information about the used
            operation system, e.g.
            ``'ObsPy 0.4.7.dev-r2432 (Windows-7-6.1.7601-SP1, Python 2.7.1)'``.
        """
        self.base_url = "http://www.seismicportal.eu"
        self.timeout = timeout
        self.debug = debug
        self.user_agent = user_agent
        self.user = user
        self.password = password
        # Create an OpenerDirector for Basic HTTP Authentication
        password_mgr = compatibility.HTTPPasswordMgrWithDefaultRealm()
        password_mgr.add_password(None, self.base_url, self.user,
                                  self.password)
        auth_handler = compatibility.HTTPBasicAuthHandler(password_mgr)
        opener = compatibility.build_opener(auth_handler)
        # install globally
        compatibility.install_opener(opener)
Beispiel #4
0
    def __init__(self, base_url="http://service.iris.edu/irisws",
                 user="", password="", timeout=20, debug=False,
                 user_agent=DEFAULT_USER_AGENT, major_versions={}):
        """
        Initializes the IRIS Web service client.

        See :mod:`obspy.iris` for all parameters.
        """
        self.base_url = base_url
        self.timeout = timeout
        self.debug = debug
        self.user_agent = user_agent
        self.major_versions = DEFAULT_SERVICE_VERSIONS
        self.major_versions.update(major_versions)
        # Create an OpenerDirector for Basic HTTP Authentication
        password_mgr = compatibility.HTTPPasswordMgrWithDefaultRealm()
        password_mgr.add_password(None, base_url, user, password)
        auth_handler = compatibility.HTTPBasicAuthHandler(password_mgr)
        opener = compatibility.build_opener(auth_handler)
        # install globally
        compatibility.install_opener(opener)
Beispiel #5
0
    def __init__(self, base_url="http://service.iris.edu/irisws",
                 user="", password="", timeout=20, debug=False,
                 user_agent=DEFAULT_USER_AGENT, major_versions={}):
        """
        Initializes the IRIS Web service client.

        See :mod:`obspy.iris` for all parameters.
        """
        self.base_url = base_url
        self.timeout = timeout
        self.debug = debug
        self.user_agent = user_agent
        self.major_versions = DEFAULT_SERVICE_VERSIONS
        self.major_versions.update(major_versions)
        # Create an OpenerDirector for Basic HTTP Authentication
        password_mgr = compatibility.HTTPPasswordMgrWithDefaultRealm()
        password_mgr.add_password(None, base_url, user, password)
        auth_handler = compatibility.HTTPBasicAuthHandler(password_mgr)
        opener = compatibility.build_opener(auth_handler)
        # install globally
        compatibility.install_opener(opener)
Beispiel #6
0
    def __init__(self, base_url="http://teide.geophysik.uni-muenchen.de:8080",
                 user="******", password="******", timeout=10, debug=False,
                 retries=3):
        """
        Initializes the SeisHub Web service client.

        :type base_url: str, optional
        :param base_url: SeisHub connection string. Defaults to
            'http://teide.geophysik.uni-muenchen.de:8080'.
        :type user: str, optional
        :param user: The user name used for identification with the Web
            service. Defaults to ``'admin'``.
        :type password: str, optional
        :param password: A password used for authentication with the Web
            service. Defaults to ``'admin'``.
        :type timeout: int, optional
        :param timeout: Seconds before a connection timeout is raised (default
            is 10 seconds). Available only for Python >= 2.6.x.
        :type debug: boolean, optional
        :param debug: Enables verbose output.
        :type retries: int
        :param retries: Number of retries for failing requests.
        """
        self.base_url = base_url
        self.waveform = _WaveformMapperClient(self)
        self.station = _StationMapperClient(self)
        self.event = _EventMapperClient(self)
        self.timeout = timeout
        self.debug = debug
        self.retries = retries
        self.xml_seeds = {}
        self.station_list = {}
        # Create an OpenerDirector for Basic HTTP Authentication
        password_mgr = HTTPPasswordMgrWithDefaultRealm()
        password_mgr.add_password(None, base_url, user, password)
        auth_handler = HTTPBasicAuthHandler(password_mgr)
        opener = build_opener(auth_handler)
        # install globally
        install_opener(opener)