-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/query #8
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
Conversation
mdncs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with a couple suggestions!
pywb/apps/rewriterapp.py
Outdated
| # fields = t.split(b' ') | ||
| # if len(fields) > 14: | ||
| # fields = fields[:-2] | ||
| # for i in CDXObject().CDX_FORMATS: | ||
| # if len(i) == len(fields): | ||
| # cdxformat = i | ||
| # | ||
| # if not cdxformat: | ||
| # msg = f'unknown {len(fields)}-field cdx format: {fields}' | ||
| # raise CDXException(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this? Generally we'd remove code that's commented out.
| choices = { | ||
| '1': 'Jan', '2': 'Feb', '3': 'Mar', | ||
| '4': 'Apr', '5': 'May', '6': 'Jun', | ||
| '7': 'Jul', '8': 'Aug', '9': 'Sep', | ||
| '10': 'Oct', '11': 'Nov', '12': 'Dec' | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No biggie but we could generate these dynamically and avoid hard-coded values:
>>> import datetime
>>>
>>> choices = {i: datetime.date(2008, i, 1).strftime('%b') for i in range(1, 13)}
>>> choices
{1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun', 7: 'Jul', 8: 'Aug', 9: 'Sep', 10: 'Oct', 11: 'Nov', 12: 'Dec'}
No description provided.