improve lodur einsatz detection
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
f3acbd7ffd
commit
888508d1c6
|
@ -2,6 +2,6 @@
|
|||
Pylokid. From Mail to Lodur - all automated.
|
||||
"""
|
||||
|
||||
__version__ = "3.0.0"
|
||||
__version__ = "3.0.1"
|
||||
__git_version__ = "0"
|
||||
__url__ = "https://github.com/tobru/pylokid"
|
||||
|
|
|
@ -4,4 +4,7 @@ Helper module to run not-installed version (via ``python3 -m pylokid``)
|
|||
from pylokid.main import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
print("Byebye")
|
||||
|
|
|
@ -69,7 +69,12 @@ class Lodur:
|
|||
if state == "open":
|
||||
self.browser.open("{}?modul=36".format(self.url))
|
||||
|
||||
einsatzrapport_url = self.browser.find_link(link_text=f_id)
|
||||
try:
|
||||
einsatzrapport_url = self.browser.find_link(link_regex=re.compile(f_id))
|
||||
except mechanicalsoup.LinkNotFoundError:
|
||||
self.logger.error("[%s] No Einsatzrapport found in Lodur", f_id)
|
||||
return None
|
||||
|
||||
if einsatzrapport_url:
|
||||
lodur_id = re.search(
|
||||
".*event=([0-9]{1,})&.*", einsatzrapport_url["href"]
|
||||
|
|
|
@ -247,10 +247,3 @@ def main():
|
|||
# repeat every
|
||||
logger.info("Waiting %s seconds until next check", IMAP_CHECK_INTERVAL)
|
||||
time.sleep(int(IMAP_CHECK_INTERVAL))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
print("Byebye")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "pylokid"
|
||||
version = "3.0.0"
|
||||
version = "3.0.1"
|
||||
description = ""
|
||||
authors = ["Tobias Brunner <tobias@tobru.ch>"]
|
||||
license = "MIT"
|
||||
|
|
Loading…
Reference in New Issue