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

Sorting #1

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Sorting #1

wants to merge 14 commits into from

Conversation

Yujingchen
Copy link

-Add command line to support sorting of results
-Now, support sort by price and title with arg "-s price(or title)"

@@ -28,6 +28,7 @@ def __init__(self, params=None, config=None):

def start(self):
self.session = ClientSession(
connector=TCPConnector(verify_ssl=False),
Copy link
Owner

Choose a reason for hiding this comment

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

We shouldn't make this a default. You can add it as a cli option in a different PR if you want.

@@ -61,3 +61,10 @@ def persist_db(query, data):
def clear_db():
with shelve.open(SAVE_FILE) as db:
db.clear()

def convert_str_to_float(string):
trimed_string = ''.join(e for e in string if e.isnumeric())
Copy link
Owner

Choose a reason for hiding this comment

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

This doesn't work for numbers with decimal places, for eg. 23.50.

result[item_id] = new_item

self.print_result(result,self.config)
Copy link
Owner

Choose a reason for hiding this comment

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

The printing functionality is in the vahti.py file. You should instead modify the result.

Copy link
Owner

@fmorato fmorato left a comment

Choose a reason for hiding this comment

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

Looks good overall. Please remove your own debugging comments and prints and check the comments for other small code changes.

@fmorato fmorato force-pushed the master branch 2 times, most recently from 225d0b6 to 54e717f Compare December 18, 2019 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants