ocssw
V2022
|
Classes | |
class | SessionUtils |
Functions | |
def | base_url (url) |
def | full_url (url, link) |
def | is_page (url) |
def | retry (func, *args, **kwargs) |
def | thiscall () |
def | set_mtime (filepath, mtime) |
def | getlinks_html (content, regex='') |
def | getlinks_json (content, regex='') |
def | print_response (response) |
def | is_html (response) |
def | is_json (response) |
def | url_mtime (response) |
Variables | |
int | python2 = sys.version_info.major < 3 |
url = sys.argv[1] | |
bool | debug = False |
format | |
level | |
s = SessionUtils(verbose=True) | |
Function Documentation
◆ base_url()
def seadasutils.SessionUtils.base_url | ( | url | ) |
Definition at line 17 of file SessionUtils.py.
◆ full_url()
def seadasutils.SessionUtils.full_url | ( | url, | |
link | |||
) |
Add query to urljoin() results ONLY if it's a page
Definition at line 22 of file SessionUtils.py.
◆ getlinks_html()
def seadasutils.SessionUtils.getlinks_html | ( | content, | |
regex = '' |
|||
) |
Definition at line 88 of file SessionUtils.py.
◆ getlinks_json()
def seadasutils.SessionUtils.getlinks_json | ( | content, | |
regex = '' |
|||
) |
Definition at line 96 of file SessionUtils.py.
◆ is_html()
def seadasutils.SessionUtils.is_html | ( | response | ) |
Definition at line 116 of file SessionUtils.py.
◆ is_json()
def seadasutils.SessionUtils.is_json | ( | response | ) |
Definition at line 120 of file SessionUtils.py.
◆ is_page()
def seadasutils.SessionUtils.is_page | ( | url | ) |
Make the dangerous assumption that URLs pointing to another web page always end in '/'.
Definition at line 36 of file SessionUtils.py.
◆ print_response()
def seadasutils.SessionUtils.print_response | ( | response | ) |
Definition at line 109 of file SessionUtils.py.
◆ retry()
def seadasutils.SessionUtils.retry | ( | func, | |
* | args, | ||
** | kwargs | ||
) |
Retry specified function call after a short delay
Definition at line 46 of file SessionUtils.py.
◆ set_mtime()
def seadasutils.SessionUtils.set_mtime | ( | filepath, | |
mtime | |||
) |
Set modification time for specified file. Set access time to "now".
Definition at line 74 of file SessionUtils.py.
◆ thiscall()
def seadasutils.SessionUtils.thiscall | ( | ) |
Get function and arguments for caller
Definition at line 61 of file SessionUtils.py.
◆ url_mtime()
def seadasutils.SessionUtils.url_mtime | ( | response | ) |
Returns timestamp of remote file as seconds since the epoch.
Definition at line 124 of file SessionUtils.py.
Variable Documentation
◆ debug
Definition at line 344 of file SessionUtils.py.
◆ format
format |
Definition at line 348 of file SessionUtils.py.
◆ level
level |
Definition at line 348 of file SessionUtils.py.
◆ python2
int python2 = sys.version_info.major < 3 |
Definition at line 7 of file SessionUtils.py.
◆ s
s = SessionUtils(verbose=True) |
Definition at line 351 of file SessionUtils.py.
◆ url
string url = sys.argv[1] |
Definition at line 339 of file SessionUtils.py.