README updated
This commit is contained in:
parent
dc20c91933
commit
1d3a943e74
25
README.md
25
README.md
|
@ -12,11 +12,28 @@ Features
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Login/Logout
|
* Login/Logout
|
||||||
|
* Check in/Check out
|
||||||
|
|
||||||
|
|
||||||
|
Install
|
||||||
|
-------
|
||||||
|
|
||||||
|
Either clone this repo and `pip install .` or use one of the provided packages.
|
||||||
|
Pay attention: this package needs a working binary of [geckodriver](https://github.com/mozilla/geckodriver).
|
||||||
|
You can either proceed in one of the following ways:
|
||||||
|
|
||||||
|
* Install the source distribution and put in your `$PATH` the `geckodriver` binary
|
||||||
|
(that can be downloaded [here](https://github.com/mozilla/geckodriver/releases/))
|
||||||
|
* Install the wheel for your architecture
|
||||||
|
* `pip install .` or `pip install -e .` will download the latest `geckodriver` and
|
||||||
|
put it in a path where the code will be able to find it.
|
||||||
|
|
||||||
|
*BEWARE*: the code gives precedence to the `geckodriver` in `$PATH` over that donwloaded.
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
----
|
----
|
||||||
|
|
||||||
* Check in/out
|
[x] Check in/out
|
||||||
* systemd {unit, timer}
|
[ ] systemd {unit, timer}
|
||||||
* APIs
|
[ ] APIs
|
||||||
* ...
|
[ ] Mailer
|
||||||
|
|
|
@ -9,16 +9,27 @@ from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
import shutil
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
import typing as T
|
import typing as T
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
os.environ["PATH"] = (
|
geckoexe = shutil.which("geckodriver")
|
||||||
os.environ["PATH"] + ":" + pkg_resources.resource_filename(__name__, "bin")
|
if geckoexe is None:
|
||||||
)
|
local_path = pkg_resources.resource_filename(__name__, "bin")
|
||||||
|
try:
|
||||||
|
os.stat(os.path.join(local_path, "geckodriver"))
|
||||||
|
os.environ["PATH"] = os.environ["PATH"] + ":" + local_path
|
||||||
|
except FileNotFoundError:
|
||||||
|
print("Missing geckodriver executable in path", file=sys.stderr)
|
||||||
|
raise
|
||||||
|
|
||||||
from selenium import webdriver as wd
|
from selenium import webdriver as wd # noqa
|
||||||
from selenium.common.exceptions import WebDriverException, NoSuchElementException
|
from selenium.common.exceptions import (
|
||||||
|
WebDriverException,
|
||||||
|
NoSuchElementException,
|
||||||
|
) # noqa
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user