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

Remove debug commands, add mblookup command #249

Merged
merged 4 commits into from
Mar 22, 2018

Conversation

RecursiveForest
Copy link
Contributor

@RecursiveForest RecursiveForest commented Mar 3, 2018

the debug commands were all variously useless internals-exposing tools that were not of significant debugging utility with the exception of whipper debug musicbrainzngs, which I have elevated to the top-level command whipper mblookup.

Copy link
Member

@Freso Freso left a comment

Choose a reason for hiding this comment

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

Overall the changes seem good and sound. I have some comments/nitpicks, but nothing that absolutely needs to be acted on; it's mostly style/bikeshedding things.

import urllib2

import whipper

import logging
Copy link
Member

Choose a reason for hiding this comment

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

I would probably do these lines like:

[…]
"""

import logging
import urllib2

import whipper

logger =

(As per https://www.python.org/dev/peps/pep-0008/#imports)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's standard to import logging on its own line right above where you define logger, so I'd like to keep it where it is.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, but usually you first import system libs, then third party libs, then your own. I think that is what @Freso meant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is! But I'm saying that despite pep8 it's common practice to import logging on its own line right above logger, out of standard order. As far as I can tell I'm otherwise following the standard import order. If someone feels really strongly about this I'm open to changing it, but this is the style whipper is currently written in and if we decide to change the import order for logging we should do it wholesale in another PR. (I'm fine discussing it here, however.)

print ' Artist: %s' % md.artist.encode('utf-8')
print ' Title: %s' % md.title.encode('utf-8')
print ' Type: %s' % md.releaseType.encode('utf-8') # noqa: E501
print ' URL: %s' % md.url
Copy link
Member

Choose a reason for hiding this comment

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

The other outputs has the %s indented to align with each other, so this one will look out of place when printed. (This seems to be a carry-over from the old code though, so should probably be fixed in its own commit (if not PR).)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch-- should be fixed in this PR.

'drive': drive.Drive,
'offset': offset.Offset,
'image': image.Image
'image': image.Image,
'mblookup': mblookup.MBLookup
Copy link
Member

Choose a reason for hiding this comment

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

This lines doesn't align with the rest of the dict. They should probably all have another space added, or all made to only have one space total. (Of course, if you change mblookup to lookup then it should be fine without altering all the other lines.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I know-- I should un-align the rest of them for consistency.

@MerlijnWajer
Copy link
Collaborator

Changes look good - didn't test the code. ACK from me.

@MerlijnWajer
Copy link
Collaborator

mblookup for filename, mblookup for cmd seems sensible to me.

discId = unicode(self.options.mbdiscid)
except IndexError:
print 'Please specify a MusicBrainz disc id.'
return 3
Copy link
Collaborator

Choose a reason for hiding this comment

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

The return value of 3 has no specific meaning, right? (just returning non-zero)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may be semantic, but I haven't checked if it means anything by a particular standard. It's left over from morituri.

@JoeLametta
Copy link
Collaborator

Will test it today: I'd like to merge this PR then tag a new release (v0.7.0).

@JoeLametta JoeLametta merged commit 574b8b2 into whipper-team:master Mar 22, 2018
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.

4 participants