-
Notifications
You must be signed in to change notification settings - Fork 37
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
Completion support, OPML import/export #67
base: master
Are you sure you want to change the base?
Conversation
Adds shell completion support for arguments and feed names through 'argcomplete' (https://github.com/kislyuk/argcomplete) and lets argparse handle more of the argument validation. -Specified 'nargs' explicitly for the arguments that call the custom action. For options with one argument, nargs, if unspecified, will return a string, for options with more than one argument it will return a list. It seems simpler just to make it always return a list. For this reason some calls to args['names'] in greg.py were changed to args['names'][0].
-Fixed setting argument choices for arguments that take feed names as input. -Adds opml import/export using the 'opml' argument. -Argcomplete is not working with the custom argparse action used to set choices. Need to figure out why not. Removed completion support for now.
Had to add the custom argparse action to argcomplete.safe_actions to get it to parse the action.
Taken from http://stackoverflow.com/questions/120951/how-can-i-normalize-a-url-in-python, referring to http://bugs.python.org/issue918368. Enclosure links with spaces in them were causing greg to fail when attempting to download them, or store them in the list of seen enclosures. This fix uses 'quote' from 'urllib' to replace funny characters in the url with escape sequences. I.e. " " becomes "%20".
Lxml enables nicer formatting for opml export but it isn't necessary.
Thanks a lot. I'll review it as soon as possible. |
So, I was making tests with the opml command and stumbled upon a feed that does not have a "version" attribute, which messes with line 307 of
|
Another thing I've noticed is that you have substituted |
I'd try to keep one convention on function names. I have_been_using_underscores, and you have added a number of camelCase functions. |
Still going through the PR! :-) Thanks a lot for the ton of work @FilipBB |
Sure, thanks for the feedback Manolo. It's quite hacky because I don't have formal programming experience, so I don't know best practices. Let me know when you're done looking it over and I'll try to implement the changes you suggest and send a new PR. |
I was able to merge my recent feature additions with your new file layout. I also added the ability to parse urls with spaces or other funny coded symbols: f8c7c97
Fixes issue #7