Skip to content

Conversation

@omerijaz27
Copy link

No description provided.

@omerijaz27 omerijaz27 requested review from Leeeebs, mdncs and omgoo April 28, 2021 16:23
Copy link

@mdncs mdncs left a 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!

Comment on lines 826 to 835
# 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)
Copy link

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.

Comment on lines +272 to +277
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'
}
Copy link

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'}

@omerijaz27 omerijaz27 merged commit fdb6118 into tna Apr 29, 2021
@omgoo omgoo deleted the feature/Query branch May 21, 2021 09:18
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.

5 participants