INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
Fetch the issues
def fetch_items(self, category, **kwargs): """Fetch the issues :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Fetching issues of '%s' from %s", ...
Parse a Redmine issues JSON stream.
def parse_issues(raw_json): """Parse a Redmine issues JSON stream. The method parses a JSON stream and returns a list iterator. Each item is a dictionary that contains the issue parsed data. :param raw_json: JSON string to parse :returns: a generator of parsed issues "...
Init client
def _init_client(self, from_archive=False): """Init client""" return RedmineClient(self.url, self.api_token, self.archive, from_archive)
Get the information of a list of issues.
def issues(self, from_date=DEFAULT_DATETIME, offset=None, max_issues=MAX_ISSUES): """Get the information of a list of issues. :param from_date: retrieve issues that where updated from that date; dates are converted to UTC :param offset: starting position for the searc...
Get the information of the given issue.
def issue(self, issue_id): """Get the information of the given issue. :param issue_id: issue identifier """ resource = urijoin(self.RISSUES, str(issue_id) + self.CJSON) params = { self.PINCLUDE: ','.join([self.CATTACHMENTS, self.CCHANGESETS, ...
Get the information of the given user.
def user(self, user_id): """Get the information of the given user. :param user_id: user identifier """ resource = urijoin(self.RUSERS, str(user_id) + self.CJSON) params = {} response = self._call(resource, params) return response
Sanitize payload of a HTTP request by removing the token information before storing/ retrieving archived items
def sanitize_for_archive(url, headers, payload): """Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :r...
Call to get a resource.
def _call(self, resource, params): """Call to get a resource. :param method: resource to get :param params: dict with the HTTP parameters needed to get the given resource """ url = self.URL % {'base': self.base_url, 'resource': resource} if self.api_token: ...
Fetch the messages
def fetch_items(self, category, **kwargs): """Fetch the messages :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Looking for messages from '%s' sinc...
Fetch the mbox files from the remote archiver.
def fetch(self, from_date=DEFAULT_DATETIME): """Fetch the mbox files from the remote archiver. This method stores the archives in the path given during the initialization of this object. HyperKitty archives are accessed month by month and stored following the schema year-month....
Fetch data from a Docker Hub repository.
def fetch(self, category=CATEGORY_DOCKERHUB_DATA): """Fetch data from a Docker Hub repository. The method retrieves, from a repository stored in Docker Hub, its data which includes number of pulls, stars, description, among other data. :param category: the category of items to ...
Fetch the Dockher Hub items
def fetch_items(self, category, **kwargs): """Fetch the Dockher Hub items :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ logger.info("Fetching data from '%s' repository of '%s' owner", ...
Init client
def _init_client(self, from_archive=False): """Init client""" return DockerHubClient(archive=self.archive, from_archive=from_archive)
Fetch information about a repository.
def repository(self, owner, repository): """Fetch information about a repository.""" url = urijoin(self.base_url, self.RREPOSITORY, owner, repository) logger.debug("DockerHub client requests: %s", url) response = self.fetch(url) return response.text
Add extra information for custom fields.
def map_custom_field(custom_fields, fields): """Add extra information for custom fields. :param custom_fields: set of custom fields with the extra information :param fields: fields of the issue where to add the extra information :returns: an set of items with the extra information mapped """ d...
Filter custom fields from a given set of fields.
def filter_custom_fields(fields): """Filter custom fields from a given set of fields. :param fields: set of fields :returns: an object with the filtered custom fields """ custom_fields = {} sorted_fields = [field for field in fields if field['custom'] is True] for custom_field in sorted...
Fetch the issues
def fetch_items(self, category, **kwargs): """Fetch the issues :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Looking for issues at site '%s', in p...
Parse a JIRA API raw response.
def parse_issues(raw_page): """Parse a JIRA API raw response. The method parses the API response retrieving the issues from the received items :param items: items from where to parse the issues :returns: a generator of issues """ raw_issues = json.loads(raw_pag...
Init client
def _init_client(self, from_archive=False): """Init client""" return JiraClient(self.url, self.project, self.user, self.password, self.verify, self.cert, self.max_results, self.archive, from_archive)
Get issue comments
def __get_issue_comments(self, issue_id): """Get issue comments""" comments = [] page_comments = self.client.get_comments(issue_id) for page_comment in page_comments: raw_comments = json.loads(page_comment) comments.extend(raw_comments['comments']) ret...
Retrieve all the items from a given date.
def get_items(self, from_date, url, expand_fields=True): """Retrieve all the items from a given date. :param url: endpoint API url :param from_date: obtain items updated since this date :param expand_fields: if True, it includes the expand fields in the payload """ start...
Retrieve all the issues from a given date.
def get_issues(self, from_date): """Retrieve all the issues from a given date. :param from_date: obtain issues updated since this date """ url = urijoin(self.base_url, self.RESOURCE, self.VERSION_API, 'search') issues = self.get_items(from_date, url) return issues
Retrieve all the comments of a given issue.
def get_comments(self, issue_id): """Retrieve all the comments of a given issue. :param issue_id: ID of the issue """ url = urijoin(self.base_url, self.RESOURCE, self.VERSION_API, self.ISSUE, issue_id, self.COMMENT) comments = self.get_items(DEFAULT_DATETIME, url, expand_fields=...
Retrieve all the fields available.
def get_fields(self): """Retrieve all the fields available.""" url = urijoin(self.base_url, self.RESOURCE, self.VERSION_API, 'field') req = self.fetch(url) return req.text
Fetch the builds from the url.
def fetch(self, category=CATEGORY_BUILD): """Fetch the builds from the url. The method retrieves, from a Jenkins url, the builds updated since the given date. :param category: the category of items to fetch :returns: a generator of builds """ kwargs = {} ...
Fetch the contents
def fetch_items(self, category, **kwargs): """Fetch the contents :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ logger.info("Looking for projects at url '%s'", self.url) nbuilds = 0 # number ...
Init client
def _init_client(self, from_archive=False): """Init client""" return JenkinsClient(self.url, self.blacklist_jobs, self.detail_depth, self.sleep_time, archive=self.archive, from_archive=from_archive)
Retrieve all jobs
def get_jobs(self): """ Retrieve all jobs""" url_jenkins = urijoin(self.base_url, "api", "json") response = self.fetch(url_jenkins) return response.text
Retrieve all builds from a job
def get_builds(self, job_name): """ Retrieve all builds from a job""" if self.blacklist_jobs and job_name in self.blacklist_jobs: logger.warning("Not getting blacklisted job: %s", job_name) return payload = {'depth': self.detail_depth} url_build = urijoin(self.b...
Fetch the questions
def fetch_items(self, category, **kwargs): """Fetch the questions :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Looking for questions at site '%s'...
Parse a StackExchange API raw response.
def parse_questions(raw_page): """Parse a StackExchange API raw response. The method parses the API response retrieving the questions from the received items :param items: items from where to parse the questions :returns: a generator of questions """ raw_questi...
Init client
def _init_client(self, from_archive=False): """Init client""" return StackExchangeClient(self.site, self.tagged, self.api_token, self.max_questions, self.archive, from_archive)
Retrieve all the questions from a given date.
def get_questions(self, from_date): """Retrieve all the questions from a given date. :param from_date: obtain questions updated since this date """ page = 1 url = urijoin(self.base_url, self.VERSION_API, "questions") req = self.fetch(url, payload=self.__build_payload(p...
Sanitize payload of a HTTP request by removing the token information before storing/ retrieving archived items
def sanitize_for_archive(url, headers, payload): """Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :r...
Returns the StackExchange argument parser.
def setup_cmd_parser(cls): """Returns the StackExchange argument parser.""" parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES, from_date=True, token_auth=True, ...
Fetch the pages from the backend url.
def fetch(self, category=CATEGORY_PAGE, from_date=DEFAULT_DATETIME, reviews_api=False): """Fetch the pages from the backend url. The method retrieves, from a MediaWiki url, the wiki pages. :param category: the category of items to fetch :param from_date: obtain pages updated si...
Fetch the pages
def fetch_items(self, category, **kwargs): """Fetch the pages :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] reviews_api = kwargs['reviews_api'] mediawi...
Init client
def _init_client(self, from_archive=False): """Init client""" return MediaWikiClient(self.url, self.archive, from_archive)
Get the max date in unixtime format from reviews.
def __get_max_date(self, reviews): """"Get the max date in unixtime format from reviews.""" max_ts = 0 for review in reviews: ts = str_to_datetime(review['timestamp']) ts = datetime_to_utc(ts) if ts.timestamp() > max_ts: max_ts = ts.timestamp()...
Fetch the pages from the backend url for MediaWiki > = 1. 27
def __fetch_1_27(self, from_date=None): """Fetch the pages from the backend url for MediaWiki >=1.27 The method retrieves, from a MediaWiki url, the wiki pages. :returns: a generator of pages """ logger.info("Looking for pages at url '%s'", self.url) npages = ...
Fetch the pages from the backend url.
def __fetch_pre1_27(self, from_date=None): """Fetch the pages from the backend url. The method retrieves, from a MediaWiki url, the wiki pages. :returns: a generator of pages """ def fetch_incremental_changes(namespaces_contents): # Use recent changes API t...
Run an API command.: param cgi: cgi command to run on the server: param params: dict with the HTTP parameters needed to run the given command
def call(self, params): """Run an API command. :param cgi: cgi command to run on the server :param params: dict with the HTTP parameters needed to run the given command """ logger.debug("MediaWiki client calls API: %s params: %s", self.base_url, s...
Retrieve all pages from a namespace starting from apcontinue.
def get_pages(self, namespace, apcontinue=''): """Retrieve all pages from a namespace starting from apcontinue.""" params = { "action": "query", "list": "allpages", "aplimit": self.limit, "apnamespace": namespace, "format": "json" } ...
Retrieve recent pages from all namespaces starting from rccontinue.
def get_recent_pages(self, namespaces, rccontinue=''): """Retrieve recent pages from all namespaces starting from rccontinue.""" namespaces.sort() params = { "action": "query", "list": "recentchanges", "rclimit": self.limit, "rcnamespace": "|".joi...
Fetch the messages the bot can read from the server.
def fetch(self, category=CATEGORY_MESSAGE, offset=DEFAULT_OFFSET, chats=None): """Fetch the messages the bot can read from the server. The method retrieves, from the Telegram server, the messages sent with an offset equal or greater than the given. A list of chats, groups and channels ...
Fetch the messages
def fetch_items(self, category, **kwargs): """Fetch the messages :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ offset = kwargs['offset'] chats = kwargs['chats'] logger.info("Looking f...
Parse a Telegram JSON messages list.
def parse_messages(raw_json): """Parse a Telegram JSON messages list. The method parses the JSON stream and returns an iterator of dictionaries. Each one of this, contains a Telegram message. :param raw_json: JSON string to parse :returns: a generator of parsed messages ...
Init client
def _init_client(self, from_archive=False): """Init client""" return TelegramBotClient(self.bot_token, self.archive, from_archive)
Check if a message can be filtered based in a list of chats.
def _filter_message_by_chats(self, message, chats): """Check if a message can be filtered based in a list of chats. This method returns `True` when the message was sent to a chat of the given list. It also returns `True` when chats is `None`. :param message: Telegram message :p...
Fetch the messages that a bot can read.
def updates(self, offset=None): """Fetch the messages that a bot can read. When the `offset` is given it will retrieve all the messages that are greater or equal to that offset. Take into account that, due to how the API works, all previous messages will be removed from the serv...
Sanitize URL of a HTTP request by removing the token information before storing/ retrieving archived items
def sanitize_for_archive(url, headers, payload): """Sanitize URL of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :retur...
Retrive the given resource.
def _call(self, method, params): """Retrive the given resource. :param resource: resource to retrieve :param params: dict with the HTTP parameters needed to retrieve the given resource """ url = self.base_url % {'token': self.bot_token, 'method': method} log...
Fetch the articles
def fetch_items(self, category, **kwargs): """Fetch the articles :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ offset = kwargs['offset'] logger.info("Fetching articles of '%s' group on '%s' o...
NNTP metadata.
def metadata(self, item, filter_classified=False): """NNTP metadata. This method takes items, overriding `metadata` decorator, to add extra information related to NNTP. :param item: an item fetched by a backend :param filter_classified: sets if classified fields were filtered ...
Parse a NNTP article.
def parse_article(raw_article): """Parse a NNTP article. This method parses a NNTP article stored in a string object and returns an dictionary. :param raw_article: NNTP article string :returns: a dictionary of type `requests.structures.CaseInsensitiveDict` :raises Par...
Init client
def _init_client(self, from_archive=False): """Init client""" return NNTTPClient(self.host, self.archive, from_archive)
Fetch NNTP data from the server or from the archive
def _fetch(self, method, args): """Fetch NNTP data from the server or from the archive :param method: the name of the command to execute :param args: the arguments required by the command """ if self.from_archive: data = self._fetch_from_archive(method, args) ...
Fetch article data
def _fetch_article(self, article_id): """Fetch article data :param article_id: id of the article to fetch """ fetched_data = self.handler.article(article_id) data = { 'number': fetched_data[1].number, 'message_id': fetched_data[1].message_id, ...
Fetch data from NNTP
def _fetch_from_remote(self, method, args): """Fetch data from NNTP :param method: the name of the command to execute :param args: the arguments required by the command """ try: if method == NNTTPClient.GROUP: data = self.handler.group(args) ...
Fetch data from the archive
def _fetch_from_archive(self, method, args): """Fetch data from the archive :param method: the name of the command to execute :param args: the arguments required by the command """ if not self.archive: raise ArchiveError(cause="Archive not provided") data = ...
Fetch the data from a given URL.
def fetch(self, url, payload=None, headers=None, method=GET, stream=False, verify=True): """Fetch the data from a given URL. :param url: link to the resource :param payload: payload of the request :param headers: headers of the request :param method: type of request call (GET or...
Create a http session and initialize the retry object.
def _create_http_session(self): """Create a http session and initialize the retry object.""" self.session = requests.Session() if self.headers: self.session.headers.update(self.headers) retries = urllib3.util.Retry(total=self.max_retries, ...
Setup the rate limit handler.
def setup_rate_limit_handler(self, sleep_for_rate=False, min_rate_to_sleep=MIN_RATE_LIMIT, rate_limit_header=RATE_LIMIT_HEADER, rate_limit_reset_header=RATE_LIMIT_RESET_HEADER): """Setup the rate limit handler. :param sleep_for_rate: sle...
The fetching process sleeps until the rate limit is restored or raises a RateLimitError exception if sleep_for_rate flag is disabled.
def sleep_for_rate_limit(self): """The fetching process sleeps until the rate limit is restored or raises a RateLimitError exception if sleep_for_rate flag is disabled. """ if self.rate_limit is not None and self.rate_limit <= self.min_rate_to_sleep: seconds_to_reset = sel...
Update the rate limit and the time to reset from the response headers.
def update_rate_limit(self, response): """Update the rate limit and the time to reset from the response headers. :param: response: the response object """ if self.rate_limit_header in response.headers: self.rate_limit = int(response.headers[self.rate_limit_header]) ...
Fetch the messages
def fetch_items(self, category, **kwargs): """Fetch the messages :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Fetching messages of '%s' from %s",...
Parse a Supybot IRC log file.
def parse_supybot_log(filepath): """Parse a Supybot IRC log file. The method parses the Supybot IRC log file and returns an iterator of dictionaries. Each one of this, contains a message from the file. :param filepath: path to the IRC log file :returns: a generator of parsed m...
Retrieve the Supybot archives after the given date
def __retrieve_archives(self, from_date): """Retrieve the Supybot archives after the given date""" archives = [] candidates = self.__list_supybot_archives() for candidate in candidates: dt = self.__parse_date_from_filepath(candidate) if dt.date() >= from_date....
List the filepath of the archives stored in dirpath
def __list_supybot_archives(self): """List the filepath of the archives stored in dirpath""" archives = [] for root, _, files in os.walk(self.dirpath): for filename in files: location = os.path.join(root, filename) archives.append(location) ...
Parse a Supybot IRC stream.
def parse(self): """Parse a Supybot IRC stream. Returns an iterator of dicts. Each dicts contains information about the date, type, nick and body of a single log entry. :returns: iterator of parsed lines :raises ParseError: when an invalid line is found parsing the given ...
Parse timestamp section
def _parse_supybot_timestamp(self, line): """Parse timestamp section""" m = self.SUPYBOT_TIMESTAMP_REGEX.match(line) if not m: msg = "date expected on line %s" % (str(self.nline)) raise ParseError(cause=msg) ts = m.group('ts') msg = m.group('msg') ...
Parse message section
def _parse_supybot_msg(self, line): """Parse message section""" patterns = [(self.SUPYBOT_COMMENT_REGEX, self.TCOMMENT), (self.SUPYBOT_COMMENT_ACTION_REGEX, self.TCOMMENT), (self.SUPYBOT_SERVER_REGEX, self.TSERVER), (self.SUPYBOT_BOT_REGEX, se...
Fetch the topics
def fetch_items(self, category, **kwargs): """Fetch the topics :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Looking for topics at '%s', updated ...
Parse a topics page stream.
def __parse_topics_page(self, raw_json): """Parse a topics page stream. The result of parsing process is a generator of tuples. Each tuple contains de identifier of the topic, the last date when it was updated and whether is pinned or not. :param raw_json: JSON stream to parse ...
Retrieve the #page summaries of the latest topics.
def topics_page(self, page=None): """Retrieve the #page summaries of the latest topics. :param page: number of page to retrieve """ params = { self.PKEY: self.api_key, self.PPAGE: page } # http://example.com/latest.json response = self._c...
Retrive the topic with topic_id identifier.
def topic(self, topic_id): """Retrive the topic with `topic_id` identifier. :param topic_id: identifier of the topic to retrieve """ params = { self.PKEY: self.api_key } # http://example.com/t/8.json response = self._call(self.TOPIC, topic_id, ...
Retrieve the post whit post_id identifier.
def post(self, post_id): """Retrieve the post whit `post_id` identifier. :param post_id: identifier of the post to retrieve """ params = { self.PKEY: self.api_key } # http://example.com/posts/10.json response = self._call(self.POSTS, post_id, ...
Sanitize payload of a HTTP request by removing the token information before storing/ retrieving archived items
def sanitize_for_archive(url, headers, payload): """Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :r...
Run an API command.
def _call(self, res, res_id, params): """Run an API command. :param res: type of resource to fetch :param res_id: identifier of the resource :param params: dict with the HTTP parameters needed to run the given command """ if res: url = urijoin(sel...
Fetch the tasks
def fetch_items(self, category, **kwargs): """Fetch the tasks :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Fetching tasks of '%s' from %s", self....
Parse a Phabricator tasks JSON stream.
def parse_tasks(raw_json): """Parse a Phabricator tasks JSON stream. The method parses a JSON stream and returns a list iterator. Each item is a dictionary that contains the task parsed data. :param raw_json: JSON string to parse :returns: a generator of parsed tasks "...
Parse a Phabricator users JSON stream.
def parse_users(raw_json): """Parse a Phabricator users JSON stream. The method parses a JSON stream and returns a list iterator. Each item is a dictionary that contais the user parsed data. :param raw_json: JSON string to parse :returns: a generator of parsed users ""...
Init client
def _init_client(self, from_archive=False): """Init client""" return ConduitClient(self.url, self.api_token, self.max_retries, self.sleep_time, self.archive, from_archive)
Retrieve tasks.
def tasks(self, from_date=DEFAULT_DATETIME): """Retrieve tasks. :param from_date: retrieve tasks that where updated from that date; dates are converted epoch time. """ # Convert 'from_date' to epoch timestamp. # Zero value (1970-01-01 00:00:00) is not allowed for ...
Retrieve tasks transactions.
def transactions(self, *phids): """Retrieve tasks transactions. :param phids: list of tasks identifiers """ params = { self.PIDS: phids } response = self._call(self.MANIPHEST_TRANSACTIONS, params) return response
Retrieve users.
def users(self, *phids): """Retrieve users. :params phids: list of users identifiers """ params = { self.PHIDS: phids } response = self._call(self.PHAB_USERS, params) return response
Retrieve data about PHIDs.
def phids(self, *phids): """Retrieve data about PHIDs. :params phids: list of PHIDs """ params = { self.PHIDS: phids } response = self._call(self.PHAB_PHIDS, params) return response
Sanitize payload of a HTTP request by removing the token information before storing/ retrieving archived items
def sanitize_for_archive(url, headers, payload): """Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :r...
Call a method.
def _call(self, method, params): """Call a method. :param method: method to call :param params: dict with the HTTP parameters needed to call the given method :raises ConduitError: when an error is returned by the server """ url = self.URL % {'base': self.bas...
Fetch the contents
def fetch_items(self, category, **kwargs): """Fetch the contents :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] logger.info("Fetching historical contents of '%...
Extracts the identifier from a Confluence item.
def metadata_id(item): """Extracts the identifier from a Confluence item. This identifier will be the mix of two fields because a historical content does not have any unique identifier. In this case, 'id' and 'version' values are combined because it should not be possible to hav...
Parse a Confluence summary JSON list.
def parse_contents_summary(raw_json): """Parse a Confluence summary JSON list. The method parses a JSON stream and returns an iterator of diccionaries. Each dictionary is a content summary. :param raw_json: JSON string to parse :returns: a generator of parsed content summaries...
Init client
def _init_client(self, from_archive=False): """Init client""" return ConfluenceClient(self.url, archive=self.archive, from_archive=from_archive)
Get the contents of a repository.
def contents(self, from_date=DEFAULT_DATETIME, offset=None, max_contents=MAX_CONTENTS): """Get the contents of a repository. This method returns an iterator that manages the pagination over contents. Take into account that the seconds of `from_date` parameter will be ig...
Get the snapshot of a content for the given version.
def historical_content(self, content_id, version): """Get the snapshot of a content for the given version. :param content_id: fetch the snapshot of this content :param version: snapshot version of the content """ resource = self.RCONTENTS + '/' + str(content_id) params ...
Retrive the given resource.
def _call(self, resource, params): """Retrive the given resource. :param resource: resource to retrieve :param params: dict with the HTTP parameters needed to retrieve the given resource """ url = self.URL % {'base': self.base_url, 'resource': resource} logg...
Parse the result property extracting the value and unit of measure
def _parse_result(self): ''' Parse the result property, extracting the value and unit of measure ''' if self.result is not None: uom = testXMLAttribute(self.result, "uom") value_str = testXMLValue(self.result) try: value = float(value_str) ...
Return a capabilities url
def capabilities_url(self, service_url): """Return a capabilities url """ qs = [] if service_url.find('?') != -1: qs = cgi.parse_qsl(service_url.split('?')[1]) params = [x[0] for x in qs] if 'service' not in params: qs.append(('service', 'WFS')) ...
Get and parse a WFS capabilities document returning an instance of WFSCapabilitiesInfoset
def read(self, url, timeout=30): """Get and parse a WFS capabilities document, returning an instance of WFSCapabilitiesInfoset Parameters ---------- url : string The URL to the WFS capabilities document. timeout : number A timeout value (in second...
Parse a WFS capabilities document returning an instance of WFSCapabilitiesInfoset
def readString(self, st): """Parse a WFS capabilities document, returning an instance of WFSCapabilitiesInfoset string should be an XML capabilities document """ if not isinstance(st, str) and not isinstance(st, bytes): raise ValueError("String must be of type string...