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

Moving to Python3 #547

Merged
merged 10 commits into from
Feb 10, 2020
Merged

Moving to Python3 #547

merged 10 commits into from
Feb 10, 2020

Conversation

iambibhas
Copy link
Contributor

Related to hasgeek/hgapp#39

@iambibhas iambibhas requested a review from jace January 30, 2020 12:57
Copy link
Member

@jace jace left a comment

Choose a reason for hiding this comment

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

A few small issues. Okay otherwise.

@@ -324,7 +324,7 @@ def datelocation(self):
end_date=schedule_end_at_date.strftime("%d %b"),
year=schedule_end_at_date.year,
)
return u', '.join(filter(None, [daterange, self.location]))
return ', '.join([_f for _f in [daterange, self.location] if _f])
Copy link
Member

Choose a reason for hiding this comment

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

Is this an accurate replacement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems so.

@@ -532,7 +532,7 @@ def url_id_name(self):
likely never be called directly on an instance. It exists for the SQL
comparator that will be called to load the instance.
"""
return unicode(self.url_id)
return self.url_id
Copy link
Member

Choose a reason for hiding this comment

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

return str(self.url_id) as it's an integer.

@@ -188,7 +188,7 @@ def view(self):
delcommentform = DeleteCommentForm()

links = [
Markup(linkify(unicode(escape(l))))
Markup(linkify(escape(l)))
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be str() as escape returns a HTML string.

dict(
{'delete_url': session.url_for('delete')} if with_delete_url else {}
).items()
)
Copy link
Member

Choose a reason for hiding this comment

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

This ugly block should be replaced with a single dict and two update operations.

@iambibhas iambibhas merged commit b48d0d7 into master Feb 10, 2020
@iambibhas iambibhas deleted the py3 branch February 10, 2020 15:15
vidya-ram added a commit that referenced this pull request Nov 23, 2021
* 2to3 changes

* bumped python version on travis

* added flask-babel2 to requirements

* str and dict fix

* requests response need to be decoded

* Add record key to cypress

* remove unicodecsv

* qrcode svg needs to be string and not bytes

* removed babel2 from requirements

Co-authored-by: Vidya Ramakrishnan <vidya@hasgeek.in>
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.

3 participants