Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty docstrings #151

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions drip/drips.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ class DripBaseParamsOptions(TypedDict):


class DripMessage(object):
"""[summary]
"""
Email message abstraction for manage message interactions, based on EmailMultiAlternatives.
You can extend this manually overriding any method that you need.

:param object: [description]
:type object: [type]
:param drip_base: DripBase object to build email
:type drip_base: DripBase
:param user: User to send email
:type user: User
"""

# Ignoring this line because mypy says User is not a valid type
Expand Down
12 changes: 9 additions & 3 deletions drip/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def process_regex(matches: Match[str]) -> Dict[str, Union[str, int]]:


def get_flexible_regex(string: str) -> Dict[str, Union[str, int]]:
# This is the more flexible format
"""
Matches a string using a more flexible regex expression for parsing
it to timedelta object.
"""
matches = re.match(
r"^((?P<weeks>-?((\d*\.\d+)|\d+))\W*w((ee)?(k(s)?)?)(,)?\W*)?"
r"((?P<days>-?((\d*\.\d+)|\d+))\W*d(ay(s)?)?(,)?\W*)?"
Expand All @@ -35,8 +38,11 @@ def get_flexible_regex(string: str) -> Dict[str, Union[str, int]]:


def process_string(string: str) -> datetime.timedelta:
# This is the format we get from sometimes Postgres, sqlite,
# and from serialization
"""
Process a string into a timedelta object, using a standard format used by
Postgres, sqlite, or from serialization. Or a flexible regex expression
if the standard form is not enough.
"""
matches = re.match(
r"^((?P<days>[-+]?\d+) days?,? )?(?P<sign>[-+]?)(?P<hours>\d+):"
r"(?P<minutes>\d+)(:(?P<seconds>\d+(\.\d+)?))?$",
Expand Down