Remove utf8
field from the search request as it seems to no longer …
#89
Annotations
5 errors and 1 warning
myfitnesspal/client.py#L193
Continuation line over-indented for hanging indent (E126)
|
myfitnesspal/client.py#L195
Continuation line under-indented for hanging indent (E121)
|
myfitnesspal/client.py#L181
name = raw_name.lower().strip()
if name not in self.ABBREVIATIONS:
return name
return self.ABBREVIATIONS[name]
- def _get_url_for_date(self, date: datetime.date, username: str, friend_username=None) -> str:
+ def _get_url_for_date(
+ self, date: datetime.date, username: str, friend_username=None
+ ) -> str:
if friend_username is not None:
name = friend_username
else:
name = username
date_str = date.strftime("%Y-%m-%d")
return (
- parse.urljoin(self.BASE_URL_SECURE, "food/diary/" + name)
- + f"?date={date_str}"
- )
+ parse.urljoin(self.BASE_URL_SECURE, "food/diary/" + name)
+ + f"?date={date_str}"
+ )
def _get_url_for_measurements(self, page: int = 1, measurement_id: int = 1) -> str:
return (
parse.urljoin(self.BASE_URL_SECURE, "measurements/edit")
+ f"?page={page}&type={measurement_id}"
|
myfitnesspal/client.py#L440
if friend_username is not None:
name = friend_username
else:
name = self.effective_username
# get the exercise URL
- document = self._get_document_for_url(
- self._get_url_for_exercise(date, name)
- )
+ document = self._get_document_for_url(self._get_url_for_exercise(date, name))
# gather the exercise goals
exercise = self._get_exercise(document)
return exercise
def _extract_value(self, element):
|
myfitnesspal/client.py#L483
"or three integers representing year, month, and day "
"respectively."
)
document = self._get_document_for_url(
self._get_url_for_date(
- date, kwargs.get("username", self.effective_username), kwargs.get("friend_username")
+ date,
+ kwargs.get("username", self.effective_username),
+ kwargs.get("friend_username"),
)
)
if "diary is locked with a key" in document.text_content():
raise Exception("Error: diary is locked with a key")
- if kwargs.get("friend_username") is not None and "user maintains a private diary" in document.text_content():
- raise Exception(f"Error: Friend {kwargs.get('friend_username')}'s diary is private.")
+ if (
+ kwargs.get("friend_username") is not None
+ and "user maintains a private diary" in document.text_content()
+ ):
+ raise Exception(
+ f"Error: Friend {kwargs.get('friend_username')}'s diary is private."
+ )
meals = self._get_meals(document)
goals = self._get_goals(document)
complete = self._get_completion(document)
# Since this data requires an additional request, let's just
# allow the day object to run the request if necessary.
notes = lambda: self._get_notes(date) # noqa: E731
water = lambda: self._get_water(date) # noqa: E731
- exercises = lambda: self._get_exercises(date, kwargs.get("friend_username")) # noqa: E731
-
- if 'friend_username' not in kwargs:
+ exercises = lambda: self._get_exercises(
+ date, kwargs.get("friend_username")
+ ) # noqa: E731
+
+ if "friend_username" not in kwargs:
day = Day(
date=date,
meals=meals,
goals=goals,
notes=notes,
|
Run linters
Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-python@v1, samuelmeuli/lint-action@v1.5.3. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
|