Skip to content

Commit

Permalink
fix(browser): slugify wasn't enough, use strftime.
Browse files Browse the repository at this point in the history
Should have done this at once!
  • Loading branch information
2e0byo committed Jan 21, 2022
1 parent f9714ec commit ebe1357
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
13 changes: 1 addition & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ halo = "^0.0.31"
fake-useragent = "^0.1.11"
psutil = "^5.8.0"
selenium = "^4.0.0"
slugify = "^0.0.1"

[tool.poetry.dev-dependencies]
devtools = "^0.8.0"
Expand Down
3 changes: 1 addition & 2 deletions yadc/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from psutil import Process
from selenium import webdriver
from selenium.webdriver.common.by import By
from slugify import slugify

from .humanlike import randsleep

Expand Down Expand Up @@ -298,7 +297,7 @@ def __enter__(self) -> webdriver.Chrome:
@staticmethod
def _errorfn(now: datetime = None, suffix: str = "txt"):
now = now or datetime.now()
return f"error-{slugify(now)}.{suffix}"
return f"error-{now.strftime('%Y-%m-%d_%H-%M-%S')}.{suffix}"

def _dump(self, *err):
self._errors_dir.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit ebe1357

Please # to comment.