Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

#738 High level arch for stalbeton parsing #739

Merged
merged 2 commits into from
Jul 10, 2019
Merged

#738 High level arch for stalbeton parsing #739

merged 2 commits into from
Jul 10, 2019

Conversation

duker33
Copy link
Contributor

@duker33 duker33 commented Jul 9, 2019

Closes #738

@duker33 duker33 requested a review from ArtemijRodionov July 9, 2019 12:20
@duker33 duker33 self-assigned this Jul 9, 2019


class Page:
BASE = 'https://stalbeton.pro'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BASE = 'https://stalbeton.pro'
SITE_URL = 'https://stalbeton.pro'

path = '/'

def url(self) -> str:
return '/'.join([self.BASE.strip('/'), self.path.strip('/')])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return '/'.join([self.BASE.strip('/'), self.path.strip('/')])
return urljoin(self.BASE, self.path)



class Command(BaseCommand):
"""Generate yml file for a given vendor (YM or price.ru)."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Generate yml file for a given vendor (YM or price.ru)."""

second_level = CatalogPage().second_level()
third_level = chain.from_iterable((s.third_level() for s in second_level))
options = chain.from_iterable((t.options() for t in third_level)) # Ignore PyFlakesBear
# persist it in to our DB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# persist it in to our DB
# save it into our DB

@duker33 duker33 merged commit f7e5cfc into master Jul 10, 2019
@duker33 duker33 deleted the 738_parse_draft branch July 10, 2019 08:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Take catalog from stalbeton
2 participants