File: robotparser.pyi

package info (click to toggle)
mypy 0.470-complete-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,864 kB
  • ctags: 3,264
  • sloc: python: 21,838; makefile: 18
file content (18 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Stubs for urllib.robotparser (Python 3.4)

from typing import Iterable, NamedTuple, Optional
import sys

_RequestRate = NamedTuple('_RequestRate', [('requests', int), ('seconds', int)])

class RobotFileParser:
    def __init__(self, url: str = ...) -> None: ...
    def set_url(self, url: str) -> None: ...
    def read(self) -> None: ...
    def parse(self, lines: Iterable[str]) -> None: ...
    def can_fetch(self, user_agent: str, url: str) -> bool: ...
    def mtime(self) -> int: ...
    def modified(self) -> None: ...
    if sys.version_info >= (3, 6):
        def crawl_delay(self, useragent: str) -> Optional[str]: ...
        def request_rate(self, useragent: str) -> Optional[_RequestRate]: ...